/**
  * Lists all models.
  */
 public function actionIndex()
 {
     $model = $this->loadModel(1);
     $category = new ArticleCategory('search');
     $category->unsetAttributes();
     // clear any default values
     if (isset($_GET['ArticleCategory'])) {
         $category->attributes = $_GET['ArticleCategory'];
     }
     $columnTemp = array();
     if (isset($_GET['GridColumn'])) {
         foreach ($_GET['GridColumn'] as $key => $val) {
             if ($_GET['GridColumn'][$key] == 1) {
                 $columnTemp[] = $key;
             }
         }
     }
     $columns = $category->getGridColumn($columnTemp);
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['ArticleSetting'])) {
         $model->attributes = $_POST['ArticleSetting'];
         $jsonError = CActiveForm::validate($model);
         if (strlen($jsonError) > 2) {
             $errors = $model->getErrors();
             $summary['msg'] = "<div class='errorSummary'><strong>" . Yii::t('phrase', 'Please fix the following input errors:') . "</strong>";
             $summary['msg'] .= "<ul>";
             foreach ($errors as $key => $value) {
                 $summary['msg'] .= "<li>{$value[0]}</li>";
             }
             $summary['msg'] .= "</ul></div>";
             $message = json_decode($jsonError, true);
             $merge = array_merge_recursive($summary, $message);
             $encode = json_encode($merge);
             echo $encode;
         } else {
             if (isset($_GET['enablesave']) && $_GET['enablesave'] == 1) {
                 if ($model->update()) {
                     echo CJSON::encode(array('type' => 0, 'msg' => '<div class="errorSummary success"><strong>' . Phrase::trans(26013, 1) . '</strong></div>'));
                 } else {
                     print_r($model->getErrors());
                 }
             }
         }
         Yii::app()->end();
     }
     $this->pageTitle = Phrase::trans(26001, 1);
     $this->pageDescription = Phrase::trans(26002, 1);
     $this->pageMeta = '';
     $this->render('admin_index', array('model' => $model, 'category' => $category, 'columns' => $columns));
 }
 /**
  * Manages all models.
  */
 public function actionManage()
 {
     $model = new ArticleCategory('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['ArticleCategory'])) {
         $model->attributes = $_GET['ArticleCategory'];
     }
     $columnTemp = array();
     if (isset($_GET['GridColumn'])) {
         foreach ($_GET['GridColumn'] as $key => $val) {
             if ($_GET['GridColumn'][$key] == 1) {
                 $columnTemp[] = $key;
             }
         }
     }
     $columns = $model->getGridColumn($columnTemp);
     $this->pageTitle = Phrase::trans(26014, 1);
     $this->pageDescription = Phrase::trans(26015, 1);
     $this->pageMeta = '';
     $this->render('admin_manage', array('model' => $model, 'columns' => $columns));
 }