示例#1
0
 /**
  * Load available languages.
  * @return SSystemLanguage collection
  */
 private function loadLanguages()
 {
     $model = SSystemLanguage::model()->findAll();
     foreach ($model as $lang) {
         $this->_languages[$lang->code] = $lang;
         if ($lang->default === '1') {
             $this->_default = $lang->code;
         }
     }
     return $this->_languages;
 }
 /**
  * Delete language
  */
 public function actionDelete()
 {
     if (Yii::app()->request->isPostRequest) {
         $model = SSystemLanguage::model()->findAllByPk($_REQUEST['id']);
         if (!empty($model)) {
             foreach ($model as $page) {
                 $page->delete();
             }
         }
         if (!Yii::app()->request->isAjaxRequest) {
             $this->redirect('index');
         }
     }
 }