From 0fc9f1094ada131adf616b4335ceaef94037edc5 Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Wed, 8 Oct 2014 12:42:21 +0530 Subject: [PATCH] #29757 Widget creation form --- CRM/Wci/Form/CreateWidget.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index 9e2c303..8570d72 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -3,7 +3,26 @@ require_once 'CRM/Core/Form.php'; require_once 'wci-helper-functions.php'; require_once 'CRM/Wci/BAO/ProgressBar.php'; +?> + + +addScriptFile('org.civicrm.wci', 'tpl-state.js'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'REQUEST' @@ -106,7 +127,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->addWysiwyg('custom_template', ts('Custom template'), ''); + $this->add('textarea', 'custom_template', ts('Custom template')); + //$this->addWysiwyg('custom_template', ts('Custom template'), ''); $this->addButtons(array( array( 'type' => 'submit', @@ -117,6 +139,13 @@ class CRM_Wci_Form_CreateWidget extends CRM_Core_Form { // export form elements $this->assign('elementNames', $this->getRenderableElementNames()); + + $smarty = CRM_Core_Smarty::singleton(); + /** Keep template in civicrm-wci/templates folder*/ + $output = $smarty->fetch('Widget.tpl'); + $elem = $this->getElement('custom_template'); + $elem->setValue($output); + parent::buildQuickForm(); } -- 2.25.1