Exemplo n.º 1
0
 public static function GetLngArray()
 {
     /* @var $item Languages */
     $lngArr = array();
     //if admin controller - arrington controller
     if (Yii::app()->controller->id == 'panel') {
         $all = Languages::model()->findAllByAttributes(array('status' => Constants::STATUS_VISIBLE), array('order' => 'priority ASC'));
     } elseif (Yii::app()->controller->id == 'lmt') {
         $all = LmtLanguages::model()->findAllByAttributes(array('status' => Constants::STATUS_VISIBLE), array('order' => 'priority ASC'));
     } else {
         $all = LuxLanguages::model()->findAllByAttributes(array('status' => Constants::STATUS_VISIBLE), array('order' => 'priority ASC'));
     }
     foreach ($all as $item) {
         $lngArr[$item->notification] = $item->prefix;
     }
     if (empty($lngArr) || count($lngArr) == 0) {
         $lngArr[strtoupper(DEFAULT_LANGUAGE)] = DEFAULT_LANGUAGE;
     }
     return $lngArr;
 }
Exemplo n.º 2
0
 public function actionLngDelete()
 {
     /* @var $language LmtLanguages */
     $id = Yii::app()->request->getParam('id', null);
     $language = LmtLanguages::model()->findByPk($id);
     if ($language == null) {
         $this->redirect($this->createUrl('/admin/lmt/login'));
     }
     $language->delete();
     $this->redirect($this->createUrl('/admin/lmt/languages'));
 }