<?php 
echo $form->errorSummary($model);
?>
		</div>
		<?php 
//begin.Messages
?>
		
		<div class="clearfix">
			<?php 
echo $form->labelEx($model, 'dependency');
?>
			<div class="desc">
				<?php 
if (ArticleCategory::getCategory() != null) {
    echo $form->dropDownList($model, 'dependency', ArticleCategory::getCategory(), array('prompt' => Phrase::trans(26019, 1)));
} else {
    echo $form->dropDownList($model, 'dependency', array(0 => Phrase::trans(26019, 1)));
}
?>
				<?php 
echo $form->error($model, 'dependency');
?>
			</div>
		</div>

		<div class="clearfix">
			<?php 
echo $form->labelEx($model, 'title');
?>
			<div class="desc">
}
?>
						<?php 
echo $form->error($model, 'article_type');
?>
					</div>
				</div>

				<div class="clearfix">
					<?php 
echo $form->labelEx($model, 'cat_id');
?>
					<div class="desc">
						<?php 
$parent = null;
$category = ArticleCategory::getCategory(null, $parent);
if ($category != null) {
    echo $form->dropDownList($model, 'cat_id', $category);
} else {
    echo $form->dropDownList($model, 'cat_id', array('prompt' => Yii::t('phrase', 'No Parent')));
}
?>
						<?php 
echo $form->error($model, 'cat_id');
?>
					</div>
				</div>
	
				<div id="title" class="clearfix <?php 
echo $model->article_type == 4 ? 'hide' : '';
?>
 /**
  * Set default columns to display
  */
 protected function afterConstruct()
 {
     $controller = strtolower(Yii::app()->controller->id);
     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');
         $this->defaultColumns[] = array('name' => 'title', 'value' => '$data->title."<br/><span>".Utility::shortText(Utility::hardDecode($data->body),200)."</span>"', 'htmlOptions' => array('class' => 'bold'), 'type' => 'raw');
         $category = ArticleCategory::model()->findByPk($_GET['category']);
         if (!isset($_GET['category']) || isset($_GET['category']) && $category->dependency == 0) {
             if ($category->dependency == 0) {
                 $parent = $_GET['category'];
             } else {
                 $parent = null;
             }
             $this->defaultColumns[] = array('name' => 'cat_id', 'value' => 'Phrase::trans($data->cat->name, 2)', 'filter' => ArticleCategory::getCategory(null, $parent), 'type' => 'raw');
         }
         $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 (in_array($controller, array('o/admin'))) {
             $this->defaultColumns[] = array('name' => 'published_date', 'value' => 'Utility::dateFormat($data->published_date)', 'htmlOptions' => array('class' => 'center'), 'filter' => Yii::app()->controller->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $this, 'attribute' => 'published_date', 'language' => 'ja', 'i18nScriptFile' => 'jquery.ui.datepicker-en.js', 'htmlOptions' => array('id' => 'published_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'])) {
             if (OmmuSettings::getInfo('site_headline') == 1) {
                 $this->defaultColumns[] = array('name' => 'headline', 'value' => '$data->headline == 1 ? Chtml::image(Yii::app()->theme->baseUrl.\'/images/icons/publish.png\') : Utility::getPublish(Yii::app()->controller->createUrl("headline",array("id"=>$data->article_id)), $data->headline, 9)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
             }
             $this->defaultColumns[] = array('name' => 'publish', 'value' => 'Utility::getPublish(Yii::app()->controller->createUrl("publish",array("id"=>$data->article_id)), $data->publish, 1)', 'htmlOptions' => array('class' => 'center'), 'filter' => array(1 => Yii::t('phrase', 'Yes'), 0 => Yii::t('phrase', 'No')), 'type' => 'raw');
         }
     }
     parent::afterConstruct();
 }