X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=class%2Ftemplate%2FPHP_Template.class.php;h=e09e53116337170b0cf972da99cef64950736638;hp=7bc8ad62dd7ec097da254d025fea39a6581aad2e;hb=335aac838df96dc73774aa319074deb2ace3a000;hpb=d4c2aa240cb09ef33ece91769f2781186edffd2d diff --git a/class/template/PHP_Template.class.php b/class/template/PHP_Template.class.php index 7bc8ad62..e09e5311 100644 --- a/class/template/PHP_Template.class.php +++ b/class/template/PHP_Template.class.php @@ -103,6 +103,48 @@ FIXME: Proposed idea to add a parameter here that turns variable } + /** + * Clears the values of all assigned varaiables. + * + */ + function clear_all_assign() { + + $this->values = array(); + + } + + /** + * Returns assigned variable value(s). + * + * @param string $varname If given, the value of that variable + * is returned, assuming it has been + * previously assigned. If not specified + * an array of all assigned variables is + * returned. (optional) + * + * @return mixed Desired single variable value or list of all + * assigned variable values. + * + */ + function get_template_vars($varname=NULL) { + + // just looking for one value + // + if (!empty($varname)) { + if (!empty($this->values[$varname])) + return $this->values[$varname]; + else +// FIXME: this OK? What does Smarty do? + return NULL; + } + + + // return all variable values + // + return $this->values; + + } + /** * Appends values to template variables *