From abc1995a7f556f2cff6817c797cbf40899c1a7da Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Fri, 10 Oct 2014 10:00:06 +0530 Subject: [PATCH] #29762 Custom template integration in widget creation form --- CRM/Wci/Form/CreateWidget.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index c69796b..ccc5b7e 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -122,8 +122,8 @@ class CRM_Wci_Form_CreateWidget extends CRM_Core_Form { } $this->add('textarea', 'style_rules', ts('Additional Style Rules')); $this->add('checkbox', 'override', ts('Override default template')); - $this->add('textarea', 'custom_template', ts('Custom template')); - //$this->addWysiwyg('custom_template', ts('Custom template'), ''); + $this->add('textarea', 'custom_template', ts('Custom template:
Please customize the smarty v2 template only if you know what you are doing')); + $this->addButtons(array( array( 'type' => 'submit', @@ -139,7 +139,6 @@ class CRM_Wci_Form_CreateWidget extends CRM_Core_Form { if (isset($this->_id)) { /** Updating existing widget*/ - //$query = "SELECT * FROM civicrm_wci_widget where id=" . $this->_id; $query = "SELECT pb.id as pbid, w.* FROM civicrm_wci_widget w INNER JOIN civicrm_wci_progress_bar pb on pb.id = w.progress_bar_id where w.id=" . $this->_id; $params = array(); @@ -198,12 +197,10 @@ where w.id=" . $this->_id; } else { /** Keep template in civicrm-wci/templates folder*/ - $output = $smarty->fetch('Widget.tpl'); $output = file_get_contents('sites/all/modules/civicrm/extensions/civicrm-wci/templates/Widget.tpl'); $elem = $this->getElement('custom_template'); $elem->setValue($output); } - parent::buildQuickForm(); } -- 2.25.1