From 3557cd4ac821347d3b5f2540120078063b5c5293 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 16 Jul 2014 06:51:33 +0000 Subject: [PATCH] fixed PHP Strict Standards: Declaration of etemplate_widget_*::set_attrs() should be compatible with etemplate_widget::set_attrs() --- .../inc/class.etemplate_widget_menupopup.inc.php | 7 ++++--- .../inc/class.etemplate_widget_nextmatch.inc.php | 16 ++++++++++++---- .../inc/class.etemplate_widget_textbox.inc.php | 7 ++++--- .../inc/class.etemplate_widget_tree.inc.php | 5 +++-- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/etemplate/inc/class.etemplate_widget_menupopup.inc.php b/etemplate/inc/class.etemplate_widget_menupopup.inc.php index ebb9e22087..e38712913d 100644 --- a/etemplate/inc/class.etemplate_widget_menupopup.inc.php +++ b/etemplate/inc/class.etemplate_widget_menupopup.inc.php @@ -48,12 +48,13 @@ class etemplate_widget_menupopup extends etemplate_widget * Reimplemented to parse our differnt attributes * * @param string|XMLReader $xml + * @param boolean $cloned=true true: object does NOT need to be cloned, false: to set attribute, set them in cloned object * @return etemplate_widget_template current object or clone, if any attribute was set * @todo Use legacy_attributes instead of leaving it to typeOptions method to parse them */ - public function set_attrs($xml) + public function set_attrs($xml, $cloned=true) { - parent::set_attrs($xml); + parent::set_attrs($xml, $cloned); // set attrs[multiple] from attrs[options], unset options only if it just contains number or rows if ($this->attrs['options'] > 1) @@ -94,7 +95,7 @@ class etemplate_widget_menupopup extends etemplate_widget switch ($widget_type) { - case 'select-account': + case 'select-account': // If in allowed options, skip account check to support app-specific options if(count($allowed) > 0 && in_array($val,$allowed)) continue; diff --git a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php index 9ac912398d..b217ab1a3d 100644 --- a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php +++ b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php @@ -175,7 +175,7 @@ class etemplate_widget_nextmatch extends etemplate_widget { $cat_app = $value['cat_app'] ? $value['cat_app'] : $GLOBALS['egw_info']['flags']['current_app']; $value['options-cat_id'] = array(); - + // Add 'All', if not already there if(!$value['options-cat_id'][''] && !($value['options-cat_id'][0] && $value['options-cat_id'][0]['value'] == '')) { @@ -369,7 +369,7 @@ class etemplate_widget_nextmatch extends etemplate_widget if ($knownUids) { // row_id not set for nextmatch --> just skip them, we can't identify the rows - if (!$row_id) + if (!$row_id) { foreach($knownUids as $uid) { @@ -1024,9 +1024,17 @@ class etemplate_widget_nextmatch_filterheader extends etemplate_widget_menupopup */ class etemplate_widget_nextmatch_accountfilter extends etemplate_widget_menupopup { - public function set_attrs($xml) + /** + * Parse and set extra attributes from xml in template object + * + * @param string|XMLReader $xml + * @param boolean $cloned=true true: object does NOT need to be cloned, false: to set attribute, set them in cloned object + * @return etemplate_widget_template current object or clone, if any attribute was set + */ + public function set_attrs($xml, $cloned=true) { - parent::set_attrs($xml); + parent::set_attrs($xml, $cloned); + $this->attrs['type'] = 'select-account'; } } diff --git a/etemplate/inc/class.etemplate_widget_textbox.inc.php b/etemplate/inc/class.etemplate_widget_textbox.inc.php index d3912d89b2..ff3fe70573 100644 --- a/etemplate/inc/class.etemplate_widget_textbox.inc.php +++ b/etemplate/inc/class.etemplate_widget_textbox.inc.php @@ -49,11 +49,12 @@ class etemplate_widget_textbox extends etemplate_widget * Reimplemented to handle legacy read-only by setting size < 0 * * @param string|XMLReader $xml - * @return etemplate_widget_textbox current object or clone, if any attribute was set + * @param boolean $cloned=true true: object does NOT need to be cloned, false: to set attribute, set them in cloned object + * @return etemplate_widget_template current object or clone, if any attribute was set */ - public function set_attrs($xml) + public function set_attrs($xml, $cloned=true) { - parent::set_attrs($xml); + parent::set_attrs($xml, $cloned); // Legacy handling only // A negative size triggered the HTML readonly attibute, but not etemplate readonly, diff --git a/etemplate/inc/class.etemplate_widget_tree.inc.php b/etemplate/inc/class.etemplate_widget_tree.inc.php index e65e3bcdbc..a962e7e008 100644 --- a/etemplate/inc/class.etemplate_widget_tree.inc.php +++ b/etemplate/inc/class.etemplate_widget_tree.inc.php @@ -51,12 +51,13 @@ class etemplate_widget_tree extends etemplate_widget * Reimplemented to parse our differnt attributes * * @param string|XMLReader $xml + * @param boolean $cloned=true true: object does NOT need to be cloned, false: to set attribute, set them in cloned object * @return etemplate_widget_template current object or clone, if any attribute was set */ - public function set_attrs($xml) + public function set_attrs($xml, $cloned=true) { $this->attrs['type'] = $xml->localName; - parent::set_attrs($xml); + parent::set_attrs($xml, $cloned); // set attrs[multiple] from attrs[options] if ($this->attrs['options'] > 1)