From dfac311a882b8753e5509b5daff6a12dac375082 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Sep 2011 10:23:07 +0000 Subject: [PATCH] Doxygen --- htdocs/core/class/canvas.class.php | 60 ++++++++++++++++-------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 5e7d4321ca4..edf58f117b1 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -110,33 +110,6 @@ class Canvas //print ' => template_dir='.$this->template_dir.'
'; } - - /** - * Return if a canvas contains an action controller - * - * @return boolean Return if canvas contains actions (old feature. now actions should be inside hooks) - */ - function hasActions() - { - return (! is_object($this->control)); - } - - /** - * Shared method for canvas to execute actions - * - * @param string &$action Action string - * @param int $id Object id - * @return mixed Return return code of doActions of canvas - */ - function doActions(&$action='view', $id=0) - { - if (method_exists($this->control,'doActions')) - { - $ret = $this->control->doActions($action, $id); - return $ret; - } - } - /** * Shared method for canvas to assign values for templates * @@ -176,5 +149,38 @@ class Canvas include($this->template_dir.($this->card?$this->card.'_':'').$this->actiontype.'.tpl.php'); // Include native PHP template } + + // This functions should not be used anymore because canvas should contains only templates. + // http://wiki.dolibarr.org/index.php/Canvas_development + + /** + * Return if a canvas contains an action controller + * + * @return boolean Return if canvas contains actions (old feature. now actions should be inside hooks) + */ + function hasActions() + { + return (! is_object($this->control)); + } + + /** + * Shared method for canvas to execute actions + * + * @param string &$action Action string + * @param int $id Object id + * @return mixed Return return code of doActions of canvas + * @deprecated This function is called if you add a doActions class inside your canvas. Try to not + * do that and add action code into a hook instead. + * @see http://wiki.dolibarr.org/index.php/Canvas_development + */ + function doActions(&$action='view', $id=0) + { + if (method_exists($this->control,'doActions')) + { + $ret = $this->control->doActions($action, $id); + return $ret; + } + } + } ?>