예제 #1
0
 public static function getMenuTree()
 {
     if (empty(self::$menuTree)) {
         $criteria = new CDbCriteria();
         $criteria->condition = '`t`.`parent_id`= :root';
         $criteria->params = array(':root' => 0);
         $criteria->order = '`t`.`id` ASC';
         $criteria->scopes = 'module';
         $rows = new ActiveDataProvider('CategoriesModel', array('criteria' => $criteria));
         foreach ($rows->getData() as $key => $item) {
             self::$menuTree[] = self::getMenuItems($item);
         }
     }
     return self::$menuTree;
 }
예제 #2
0
 public function actionList()
 {
     // Autenticacion
     // $this->_checkAuth();
     $modelo = array_key_exists('model', $_GET) ? $_GET['model'] : '';
     if ($modelo != '') {
         $dataProvider = new ActiveDataProvider($modelo);
         // Almacenamiento Log de sincronizacion
         $this->almacenarHistoriaSincOnline('list', $_GET, 'GET');
         $this->_sendResponse(200, CJSON::encode($dataProvider->getData()));
     } else {
         $this->_sendResponse(501, sprintf('Error: Modo <b>List</b> no esta implementado en el modelo <b>%s</b>', $modelo));
         Yii::app()->end();
     }
 }
예제 #3
0
 public function run()
 {
     $file = new MediaFile();
     $dp = new ActiveDataProvider($file, ['criteria' => $file->parentModel(Yii::app()->controller->user, true)->type(MediaFile::TYPE_VIDEO)->getDbCriteria(), 'pagination' => false]);
     $this->render('_videoPlayList', ['data' => $dp->getData()]);
 }