Skip to content
Snippets Groups Projects
Commit 00edeb16 authored by lobo's avatar lobo
Browse files

Merge pull request #1877 from colemanw/smarty

CRM-13674 - CRM_Core_* - Add smarty functions
parents 46c5a8a1 4a9538ac
No related branches found
No related tags found
No related merge requests found
...@@ -604,10 +604,41 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { ...@@ -604,10 +604,41 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
self::$_template->assign($var, $value); self::$_template->assign($var, $value);
} }
/**
* assign value to name in template by reference
*
* @param array|string $name name of variable
* @param mixed $value (reference) value of varaible
*
* @return void
* @access public
*/
function assign_by_ref($var, &$value) { function assign_by_ref($var, &$value) {
self::$_template->assign_by_ref($var, $value); self::$_template->assign_by_ref($var, $value);
} }
/**
* appends values to template variables
*
* @param array|string $tpl_var the template variable name(s)
* @param mixed $value the value to append
* @param bool $merge
*/
function append($tpl_var, $value=NULL, $merge=FALSE) {
self::$_template->append($tpl_var, $value, $merge);
}
/**
* Returns an array containing template variables
*
* @param string $name
* @param string $type
* @return array
*/
function get_template_vars($name=null) {
return self::$_template->get_template_vars($name);
}
/** /**
* setter for embedded * setter for embedded
* *
......
...@@ -720,6 +720,28 @@ class CRM_Core_Form extends HTML_QuickForm_Page { ...@@ -720,6 +720,28 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
self::$_template->assign_by_ref($var, $value); self::$_template->assign_by_ref($var, $value);
} }
/**
* appends values to template variables
*
* @param array|string $tpl_var the template variable name(s)
* @param mixed $value the value to append
* @param bool $merge
*/
function append($tpl_var, $value=NULL, $merge=FALSE) {
self::$_template->append($tpl_var, $value, $merge);
}
/**
* Returns an array containing template variables
*
* @param string $name
* @param string $type
* @return array
*/
function get_template_vars($name=null) {
return self::$_template->get_template_vars($name);
}
function &addRadio($name, $title, &$values, $attributes = NULL, $separator = NULL, $required = FALSE) { function &addRadio($name, $title, &$values, $attributes = NULL, $separator = NULL, $required = FALSE) {
$options = array(); $options = array();
if (empty($attributes)) { if (empty($attributes)) {
......
...@@ -273,6 +273,28 @@ class CRM_Core_Page { ...@@ -273,6 +273,28 @@ class CRM_Core_Page {
self::$_template->assign_by_ref($var, $value); self::$_template->assign_by_ref($var, $value);
} }
/**
* appends values to template variables
*
* @param array|string $tpl_var the template variable name(s)
* @param mixed $value the value to append
* @param bool $merge
*/
function append($tpl_var, $value=NULL, $merge=FALSE) {
self::$_template->append($tpl_var, $value, $merge);
}
/**
* Returns an array containing template variables
*
* @param string $name
* @param string $type
* @return array
*/
function get_template_vars($name=null) {
return self::$_template->get_template_vars($name);
}
/** /**
* function to destroy all the session state of this page. * function to destroy all the session state of this page.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment