atoulme | b80b468 | 2009-01-22 13:08:36 +0000 | [diff] [blame] | 1 | <?php |
| 2 | /******************************************************************************* |
| 3 | * Copyright (c) 2007-2009 Intalio, Inc. |
| 4 | * All rights reserved. This program and the accompanying materials |
| 5 | * are made available under the terms of the Eclipse Public License v1.0 |
| 6 | * which accompanies this distribution, and is available at |
| 7 | * http://www.eclipse.org/legal/epl-v10.html |
| 8 | * |
| 9 | * Contributors: |
| 10 | * Antoine Toulme, Intalio Inc. |
| 11 | *******************************************************************************/ |
| 12 | |
| 13 | // Use a class to define the hooks to avoid bugs with already defined functions. |
| 14 | class Reference { |
| 15 | /** |
| 16 | * Returns the root path to the images. |
| 17 | * May be a distant server or a local folder. |
| 18 | */ |
atoulme | dbe670e | 2009-01-27 11:23:51 +0000 | [diff] [blame] | 19 | function _imageRoot() { |
atoulme | b80b468 | 2009-01-22 13:08:36 +0000 | [diff] [blame] | 20 | return "http://dev.eclipse.org"; |
| 21 | } |
| 22 | |
atoulme | dbe670e | 2009-01-27 11:23:51 +0000 | [diff] [blame] | 23 | /** |
| 24 | * Returns a string representing a JS function named fnCheckUrl that |
| 25 | * is called to check on the integrity of the url of the map file. |
| 26 | */ |
atoulme | b80b468 | 2009-01-22 13:08:36 +0000 | [diff] [blame] | 27 | function validateMapFileUrl($url) { |
atoulme | dbe670e | 2009-01-27 11:23:51 +0000 | [diff] [blame] | 28 | return "function fnCheckUrl() {}"; |
atoulme | b80b468 | 2009-01-22 13:08:36 +0000 | [diff] [blame] | 29 | } |
| 30 | |
atoulme | a4adf8e | 2009-01-27 19:01:35 +0000 | [diff] [blame] | 31 | /** |
| 32 | * Outputs the head of the html page. |
| 33 | */ |
| 34 | function head() { |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Outputs the footer of the html page. |
| 39 | */ |
| 40 | function footer() { |
| 41 | } |
atoulme | b80b468 | 2009-01-22 13:08:36 +0000 | [diff] [blame] | 42 | } |
| 43 | |
atoulme | 1307303 | 2009-01-27 16:31:27 +0000 | [diff] [blame] | 44 | function __register_html_ref($addon) { |
atoulme | dbe670e | 2009-01-27 11:23:51 +0000 | [diff] [blame] | 45 | $addon->register('image_root', array('Reference', '_imageRoot')); |
| 46 | $addon->register('validate_map_file_url', array('Reference', 'validateMapFileUrl')); |
atoulme | a4adf8e | 2009-01-27 19:01:35 +0000 | [diff] [blame] | 47 | $addon->register('head', array('Reference', 'head')); |
| 48 | $addon->register('footer', array('Reference', 'footer')); |
atoulme | b80b468 | 2009-01-22 13:08:36 +0000 | [diff] [blame] | 49 | } |
| 50 | |
atoulme | 1307303 | 2009-01-27 16:31:27 +0000 | [diff] [blame] | 51 | global $register_function_html; |
| 52 | $register_function_html = '__register_html_ref'; |
| 53 | |
atoulme | b80b468 | 2009-01-22 13:08:36 +0000 | [diff] [blame] | 54 | ?> |