Example #1
0
 /**
  * @return array
  */
 public function getChoices()
 {
     if (!$this->blank) {
         return parent::getChoices();
     }
     return array_merge(array('' => $this->blank), parent::getChoices());
 }
 /**
  * Registers scripts for autocomplete text field
  */
 protected function registerScriptForAutoCompleteTextField()
 {
     parent::registerScriptForAutoCompleteTextField();
     Yii::app()->clientScript->registerScriptFile(Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.modules.productTemplates.elements.assets')) . '/ProductTemplateUtils.js', CClientScript::POS_END);
 }
 /**
  * Render a hidden input, a text input with an auto-complete
  * event, and a select button. These three items together
  * form the Role Editable Element
  * @return The element's content as a string.
  */
 protected function renderControlEditable()
 {
     assert('$this->model->{$this->attribute} instanceof Role');
     return parent::renderControlEditable();
 }
 protected function renderNonEditable()
 {
     if ($this->model->project->id > 0) {
         return parent::renderNonEditable();
     }
 }
 protected function getSelectLinkUrlParams()
 {
     return array_merge(parent::getSelectLinkUrlParams(), array('stateMetadataAdapterClassName' => 'EmailTemplatesForMarketingStateMetadataAdapter'));
 }