public static function getRefCategories() { $criteria = new CDbCriteria(); $criteria->addCondition('type = ' . ReferenceCategories::TYPE_STANDARD); $criteria->order = 'sorter ASC'; return ReferenceCategories::model()->findAll($criteria); }
public static function getReferencesList() { Yii::import('application.modules.referencecategories.models.ReferenceCategories'); $ref = ReferenceCategories::model()->findAllByAttributes(array('type' => ReferenceCategories::TYPE_FOR_EDITOR)); return $ref ? CHtml::listData($ref, 'id', 'title') : array(); }
$form = $this->beginWidget('CustomForm', array('id' => $this->modelName . '-form', 'enableAjaxValidation' => true)); ?> <p class="note"><?php echo Yii::t('common', 'Fields with <span class="required">*</span> are required.'); ?> </p> <?php echo $form->errorSummary($model); ?> <?php $this->widget('application.modules.lang.components.langFieldWidget', array('model' => $model, 'field' => 'title', 'type' => 'string')); if (issetModule('formeditor')) { echo $form->dropDownListRow($model, 'type', ReferenceCategories::getTypeList()); } ?> <div class="clear"></div> <div class="rowold"> <?php echo $form->labelEx($model, 'style'); ?> <?php echo $form->dropDownList($model, 'style', $model->getStyles(), array('class' => 'width150')); ?> <?php echo $form->error($model, 'style'); ?> </div>