From: Jagadedes Date: Wed, 8 Oct 2014 07:12:21 +0000 (+0530) Subject: #29757 Widget creation form X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0fc9f1094ada131adf616b4335ceaef94037edc5;p=com.zyxware.civiwci.git #29757 Widget creation form --- 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(); }