<div id="ajax-message"> <?php echo $form->errorSummary($model); ?> </div> <?php //begin.Messages ?> <div class="clearfix"> <?php echo $form->labelEx($model, 'cat_id'); ?> <div class="desc"> <?php $category = OmmuMenuCategory::getCategory(); if ($category != null) { echo $form->dropDownList($model, 'cat_id', $category, array('prompt' => Yii::t('phrase', 'Select One'))); } else { echo $form->dropDownList($model, 'cat_id', array('prompt' => Yii::t('phrase', 'Select One'))); } ?> <?php echo $form->error($model, 'cat_id'); ?> <?php /*<div class="small-px silent"></div>*/ ?> </div> </div>
/** * Set default columns to display */ protected function afterConstruct() { if (count($this->defaultColumns) == 0) { /* $this->defaultColumns[] = array( 'class' => 'CCheckBoxColumn', 'name' => 'id', 'selectableRows' => 2, 'checkBoxHtmlOptions' => array('name' => 'trash_id[]') ); */ $this->defaultColumns[] = array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'); if (!isset($_GET['category'])) { $this->defaultColumns[] = array('name' => 'cat_id', 'value' => 'Phrase::trans($data->cat_relation->name, 2)', 'filter' => OmmuMenuCategory::getCategory(), 'type' => 'raw'); } $this->defaultColumns[] = array('name' => 'title', 'value' => 'Phrase::trans($data->name, 2)'); $this->defaultColumns[] = array('name' => 'dependency', 'value' => '$data->dependency != 0 ? $data->dependency : "-"'); $this->defaultColumns[] = array('name' => 'creation_search', 'value' => '$data->creation_relation->displayname'); $this->defaultColumns[] = array('name' => 'creation_date', 'value' => 'Utility::dateFormat($data->creation_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'creation_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'creation_date_filter'), 'options' => array('showOn' => 'focus', 'dateFormat' => 'dd-mm-yy', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true)); if (!isset($_GET['type'])) { $this->defaultColumns[] = array('name' => 'publish', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->id)), $data->publish, 1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Phrase::trans(588, 0), 0 => Phrase::trans(589, 0)), 'type' => 'raw'); } } parent::afterConstruct(); }