コード例 #1
0
 public function run()
 {
     $category_left = LuxTree::model()->findByAttributes(array('type' => Constants::LUX_TYPE_HOME_PAGE_1, 'status' => Constants::STATUS_VISIBLE));
     $category_right = LuxTree::model()->findByAttributes(array('type' => Constants::LUX_TYPE_HOME_PAGE_2, 'status' => Constants::STATUS_VISIBLE));
     if ($category_left != null) {
         $left_blocks = LuxContentUnit::model()->findAllByAttributes(array('tree_id' => $category_left->id));
     } else {
         $left_blocks = array();
     }
     if ($category_right != null) {
         $right_blocks = LuxContentUnit::model()->findAllByAttributes(array('tree_id' => $category_right->id));
     } else {
         $right_blocks = array();
     }
     $this->render('title_part', array('left_blocks' => $left_blocks, 'right_blocks' => $right_blocks, 'part' => $this->part));
 }
コード例 #2
0
 public function actionEditPage()
 {
     //get if frm request
     $id = Yii::app()->request->getParam('id', null);
     //get list of categories
     $criteria = new CDbCriteria();
     //        $criteria->addInCondition('type',array(Constants::TYPE_TEXT_PAGE_1_ARRINGTON, Constants::TYPE_TEXT_PAGE_2_ARRINGTON, Constants::TYPE_TITLE_PAGE_ARRINGTON));
     $all_categories = LuxTree::model()->findAll($criteria);
     //find item
     $item = LuxContentUnit::model()->findByPk($id);
     //if not found - send to 404
     if ($item == null) {
         $this->redirect($this->createUrl('/admin/inlux/error/404'));
     }
     //render list
     $this->render('pages_edit', array('categories' => $all_categories, 'item' => $item));
 }