CRM-13674 - CRM_Core_* - Add smarty functions
authorColeman Watts <coleman@civicrm.org>
Tue, 29 Oct 2013 21:55:22 +0000 (14:55 -0700)
committerColeman Watts <coleman@civicrm.org>
Tue, 29 Oct 2013 21:55:22 +0000 (14:55 -0700)
CRM/Core/Controller.php
CRM/Core/Form.php
CRM/Core/Page.php

index 22a5bf579c6f1f72e6c31f44a83cb9456a95b939..21a4ac461b3686fa30c2a2e9eee793b5096a610c 100644 (file)
@@ -604,10 +604,41 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
     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) {
     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
    *
index 5fcc342d2d3d6da5bb4d4e0a5d8724b5d2a6b4be..91728c21bec8a1d0959ae46f6a96f461e72241bb 100644 (file)
@@ -720,6 +720,28 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     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) {
     $options = array();
     if (empty($attributes)) {
index 3d74a087dd8b521e0ccf43b684c02f1445f5f02e..95ff5575788cfb1e070f0ae980556e11bebddec3 100644 (file)
@@ -273,6 +273,28 @@ class CRM_Core_Page {
     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.
    *