diff --git a/etemplate/inc/class.ajax_select_widget.inc.php b/etemplate/inc/class.ajax_select_widget.inc.php index ff608bd4c0..289c61e468 100644 --- a/etemplate/inc/class.ajax_select_widget.inc.php +++ b/etemplate/inc/class.ajax_select_widget.inc.php @@ -58,7 +58,7 @@ class ajax_select_widget private $debug = false; - function ajax_select_widget($ui='') + function __construct($ui='') { switch($ui) diff --git a/etemplate/inc/class.date_widget.inc.php b/etemplate/inc/class.date_widget.inc.php index 109117ef1a..dbb755027e 100644 --- a/etemplate/inc/class.date_widget.inc.php +++ b/etemplate/inc/class.date_widget.inc.php @@ -66,7 +66,7 @@ class date_widget * * @param string $ui '' for html */ - function date_widget($ui) + function __construct($ui) { if ($ui == 'html') { diff --git a/etemplate/inc/class.etemplate_widget.inc.php b/etemplate/inc/class.etemplate_widget.inc.php index 9854f6178e..136d014f7c 100644 --- a/etemplate/inc/class.etemplate_widget.inc.php +++ b/etemplate/inc/class.etemplate_widget.inc.php @@ -12,13 +12,14 @@ */ use EGroupware\Api\Etemplate\Widget; +use EGroupware\Api\Etemplate; /** * eTemplate widget baseclass * * @deprecated use Api\Etemplate\Widget */ -class etemplate_widget extends Widget {} +class etemplate_widget extends Etemplate\Widget {} /** * eTemplate Extension: Entry widget diff --git a/etemplate/inc/class.link_widget.inc.php b/etemplate/inc/class.link_widget.inc.php index 0a4536be5b..523260f16b 100644 --- a/etemplate/inc/class.link_widget.inc.php +++ b/etemplate/inc/class.link_widget.inc.php @@ -96,16 +96,6 @@ class link_widget */ const LIMIT_LINKS = 1000; - /** - * Constructor of the extension - * - * @param string $ui '' for html - */ - function link_widget($ui='') - { - - } - /** * pre-processing of the extension * diff --git a/etemplate/inc/class.manual_widget.inc.php b/etemplate/inc/class.manual_widget.inc.php index 42e7d9a851..030b049416 100644 --- a/etemplate/inc/class.manual_widget.inc.php +++ b/etemplate/inc/class.manual_widget.inc.php @@ -16,7 +16,7 @@ * * With the value or the name of the widget, you can specify a certain manual page * (eg. ManualAddressbook). Additional params can be past to the manual app with - * $GLOBALS['egw_info']['flags']['params']['manual']. + * $GLOBALS['egw_info']['flags']['params']['manual']. * If no page is set after that two mechanisms the URL will contains the referer. * * @package etemplate @@ -26,7 +26,7 @@ */ class manual_widget { - /** + /** * exported methods of this class * @var array $public_functions */ @@ -48,7 +48,7 @@ * * @param string $ui '' for html */ - function manual_widget($ui) + function __construct($ui) { $this->ui = $ui; } @@ -60,7 +60,7 @@ * * @param string $name form-name of the control * @param mixed &$value value / existing content, can be modified - * @param array &$cell array with the widget, can be modified for ui-independent widgets + * @param array &$cell array with the widget, can be modified for ui-independent widgets * @param array &$readonlys names of widgets as key, to be made readonly * @param mixed &$extension_data data the extension can store persisten between pre- and post-process * @param object &$tmpl reference to the template we belong too @@ -89,7 +89,7 @@ $cell['onclick'] = $GLOBALS['egw']->framework->open_manual_js($link).'; return false;'; if (!$cell['label']) $cell['label'] = 'Manual'; if (!$cell['help']) $cell['help'] = /*lang(*/'Open the online help.'/*)*/; - + if (!$cell['readonly'] && !isset($GLOBALS['egw_info']['user']['apps']['manual'])) { $cell['readonly'] = true; // we disable / remove the button, if use has no run-rights for the manual diff --git a/etemplate/inc/class.path_widget.inc.php b/etemplate/inc/class.path_widget.inc.php index bf46911cf7..d74c557110 100644 --- a/etemplate/inc/class.path_widget.inc.php +++ b/etemplate/inc/class.path_widget.inc.php @@ -12,7 +12,7 @@ /** * eTemplate Extension: widget to display a path with clickable components * - * The value is an array with id => label pairs. + * The value is an array with id => label pairs. * Returned will be the id of the clicked component or nothing at all. * * @package etemplate @@ -22,7 +22,7 @@ */ class path_widget { - /** + /** * exported methods of this class * @var array */ @@ -41,7 +41,7 @@ * * @param string $ui '' for html */ - function select_widget($ui) + function __construct($ui) { $this->ui = $ui; } @@ -53,7 +53,7 @@ * * @param string $name form-name of the control * @param mixed &$value value / existing content, can be modified - * @param array &$cell array with the widget, can be modified for ui-independent widgets + * @param array &$cell array with the widget, can be modified for ui-independent widgets * @param array &$readonlys names of widgets as key, to be made readonly * @param mixed &$extension_data data the extension can store persisten between pre- and post-process * @param object &$tmpl reference to the template we belong too @@ -81,7 +81,7 @@ $sep['label'] = $seperator; soetemplate::add_child($cell,$sep); unset($sep); - + $button = soetemplate::empty_cell('button',$cell_name.'['.$id.']'); $button['label'] = $label; $button['onchange'] = 1; // display as link @@ -89,7 +89,7 @@ $button['help'] = $cell['help'] ? $cell['help'] : lang($label)."($i)"; soetemplate::add_child($cell,$button); unset($button); - } + } return True; // extra Label Ok } @@ -113,7 +113,7 @@ function post_process($name,&$value,&$extension_data,&$loop,&$tmpl,$value_in) { $value = ''; - + foreach((array)$value_in as $id => $pressed) { if ($pressed && isset($extension_data[$id])) diff --git a/etemplate/inc/class.select_widget.inc.php b/etemplate/inc/class.select_widget.inc.php index 54476fb763..b54d0d5dde 100644 --- a/etemplate/inc/class.select_widget.inc.php +++ b/etemplate/inc/class.select_widget.inc.php @@ -75,7 +75,7 @@ class select_widget * * @param string $ui '' for html */ - function select_widget($ui='') + function __construct($ui='') { foreach($this->monthnames as $k => $name) { diff --git a/etemplate/inc/class.tab_widget.inc.php b/etemplate/inc/class.tab_widget.inc.php index 8de84c7c4a..05bce16834 100644 --- a/etemplate/inc/class.tab_widget.inc.php +++ b/etemplate/inc/class.tab_widget.inc.php @@ -41,21 +41,12 @@ */ var $human_name = 'Tabs'; // this is the name for the editor - /** - * Constructor of the extension - * - * @param string $ui '' for html - */ - function tab_widget($ui) - { - } - /** * pre-processing of the extension * * This function is called before the extension gets rendered * - * @param string $name form-name of the control + * @param string $form_name form-name of the control * @param mixed &$value value / existing content, can be modified * @param array &$cell array with the widget, can be modified for ui-independent widgets * @param array &$readonlys names of widgets as key, to be made readonly diff --git a/etemplate/inc/class.tree_widget.inc.php b/etemplate/inc/class.tree_widget.inc.php index 7348b0df24..2fa65dc0be 100644 --- a/etemplate/inc/class.tree_widget.inc.php +++ b/etemplate/inc/class.tree_widget.inc.php @@ -15,7 +15,7 @@ */ class tree_widget { - /** + /** * exported methods of this class * @var array */ @@ -37,7 +37,7 @@ class tree_widget * * @param string $ui '' for html */ - function tree_widget($ui) + function __construct($ui) { $this->ui = $ui; } @@ -49,7 +49,7 @@ class tree_widget * * @param string $name form-name of the control * @param mixed &$value value / existing content, can be modified - * @param array &$cell array with the widget, can be modified for ui-independent widgets + * @param array &$cell array with the widget, can be modified for ui-independent widgets * @param array &$readonlys names of widgets as key, to be made readonly * @param mixed &$extension_data data the extension can store persisten between pre- and post-process * @param etemplate &$tmpl reference to the template we belong too @@ -134,10 +134,10 @@ class tree_widget $onCheck = 'onCheck_'.$tree_id; $script .= " function $onCheck(id) { - document.getElementsByName('$name')[0].value=$tree_id.getAllChecked(); + document.getElementsByName('$name')[0].value=$tree_id.getAllChecked(); $onclick; } - function $onNodeSelect(id) { + function $onNodeSelect(id) { $tree_id.setCheck(id,$tree_id.isItemChecked(id) ? 0 : 1); $onCheck(id); } @@ -146,7 +146,7 @@ class tree_widget else // single selection { $script .= " - function $onNodeSelect(id) { + function $onNodeSelect(id) { document.getElementsByName('$name')[0].value=id; $onclick; } @@ -161,7 +161,7 @@ class tree_widget return True; // extra Label Ok } - + /** * postprocessing method, called after the submission of the form * @@ -182,7 +182,7 @@ class tree_widget function post_process($name,&$value,&$extension_data,&$loop,&$tmpl,$value_in) { //echo "value_in"; _debug_array($value_in); - + if (!preg_match('/^[0-9\\/'.($extension_data['multiple']?',':'').']*$/',$value_in)) return false; // guard against xss and other malious content $value = $extension_data['multiple'] ? explode(',',$value_in) : $value_in;