fixed PHP Strict Standards: Declaration of etemplate_widget_*::set_attrs() should be compatible with etemplate_widget::set_attrs()

This commit is contained in:
Ralf Becker 2014-07-14 10:02:47 +00:00
parent 8a36e40b10
commit c54e53d405
4 changed files with 23 additions and 12 deletions

View File

@ -48,12 +48,13 @@ class etemplate_widget_menupopup extends etemplate_widget
* Reimplemented to parse our differnt attributes * Reimplemented to parse our differnt attributes
* *
* @param string|XMLReader $xml * @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 * @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 * @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 // set attrs[multiple] from attrs[options], unset options only if it just contains number or rows
if ($this->attrs['options'] > 1) if ($this->attrs['options'] > 1)

View File

@ -1024,9 +1024,17 @@ class etemplate_widget_nextmatch_filterheader extends etemplate_widget_menupopup
*/ */
class etemplate_widget_nextmatch_accountfilter 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'; $this->attrs['type'] = 'select-account';
} }
} }

View File

@ -49,11 +49,12 @@ class etemplate_widget_textbox extends etemplate_widget
* Reimplemented to handle legacy read-only by setting size < 0 * Reimplemented to handle legacy read-only by setting size < 0
* *
* @param string|XMLReader $xml * @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 // Legacy handling only
// A negative size triggered the HTML readonly attibute, but not etemplate readonly, // A negative size triggered the HTML readonly attibute, but not etemplate readonly,

View File

@ -51,12 +51,13 @@ class etemplate_widget_tree extends etemplate_widget
* Reimplemented to parse our differnt attributes * Reimplemented to parse our differnt attributes
* *
* @param string|XMLReader $xml * @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 * @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; $this->attrs['type'] = $xml->localName;
parent::set_attrs($xml); parent::set_attrs($xml, $cloned);
// set attrs[multiple] from attrs[options] // set attrs[multiple] from attrs[options]
if ($this->attrs['options'] > 1) if ($this->attrs['options'] > 1)