コード例 #1
0
ファイル: PortletPages.php プロジェクト: frenzelgmbh/scms
 protected function renderContent()
 {
     $query = Page::getAdapterForPages($this->limit);
     $dpPages = new ActiveDataProvider(array('query' => $query, 'pagination' => array('pageSize' => 10)));
     //here we don't return the view, here we just echo it!
     echo $this->render('@frenzelgmbh/scms/widgets/views/_pages', array('dpPages' => $dpPages));
 }
コード例 #2
0
ファイル: PageForm.php プロジェクト: frenzelgmbh/scms
 public function search($params)
 {
     $query = Page::find();
     $dataProvider = new ActiveDataProvider(array('query' => $query));
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $this->addCondition($query, 'id');
     $this->addCondition($query, 'name', true);
     $this->addCondition($query, 'body', true);
     $this->addCondition($query, 'parent_pages_id');
     $this->addCondition($query, 'ord');
     $this->addCondition($query, 'time_create');
     $this->addCondition($query, 'time_update');
     //$this->addCondition($query, 'special');
     $this->addCondition($query, 'title', true);
     $this->addCondition($query, 'template', true);
     $this->addCondition($query, 'category', true);
     $this->addCondition($query, 'tags', true);
     $this->addCondition($query, 'description', true);
     $this->addCondition($query, 'date_associated');
     $this->addCondition($query, 'vars', true);
     $this->addCondition($query, 'status', true);
     return $dataProvider;
 }
コード例 #3
0
 public function init()
 {
     $this->_model = Page::findOne($this->id);
     if (!is_null($this->_model)) {
         $this->title = $this->_model->title;
         $this->adminActions[] = array('action' => Url::to(array('/pages/page/onlineview', 'id' => $this->_model->id)), 'content' => "<i class='icon icon-eye-open icon-1x tipster' title='anzeigen'> </i>");
         $this->adminActions[] = array('action' => Url::to(array('/pages/page/update', 'id' => $this->_model->id)), 'content' => "<i class='icon icon-pencil icon-1x tipster' title='bearbeiten'> </i>");
     }
     parent::init();
 }
コード例 #4
0
 protected function renderContent()
 {
     $hits = NULL;
     $model = new PageSearchForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->searchstring !== '') {
             $hits = Page::searchByString($model->searchstring)->all();
         }
     }
     echo $this->render('@frenzelgmbh/scms/widgets/views/_search', array('model' => $model, 'hits' => $hits));
 }
コード例 #5
0
ファイル: Page.php プロジェクト: frenzelgmbh/scms
 /**
  * Forms an associative, multidimensional array holding only the first
  * level of nodes. Used when lazy loading is enabled and only the first
  * nodes should be shown.
  * 
  * @param int dataview_id The id of the dataview to show this tree for
  * @param User $user The user model to filter this tree for (Defaults to false, meaning no user filter)
  *
  * @return array The parent child data as associative, multidimensional array
  */
 public static function rootTreeAsArray($id)
 {
     $checkRootNode = Page::findOne($id);
     if (is_null($checkRootNode->parent_pages_id) or $checkRootNode->parent_pages_id == 0) {
         $rootNode = $checkRootNode->id;
     } else {
         $rootNode = $checkRootNode->parent_pages_id;
     }
     $roots = array();
     $roots = Page::find()->where(array('id' => $rootNode))->All();
     $out = array();
     foreach ($roots as $root) {
         $currow = array('id' => $root->id, 'child' => $root->noChildren, 'text' => $root->name);
         $out[] = $currow;
     }
     return $trees = array('id' => 0, 'item' => $out);
 }
コード例 #6
0
ファイル: PageController.php プロジェクト: frenzelgmbh/scms
 /**
  * creates the JSON for the dhtmlx tree object
  * @param  integer $id     The id of the current id
  * @param  integer $rootId The id of the shown root node
  * @return JSON         Returns a json array, that can be parsed by dhtmlx tree component
  */
 public function actionJsontreeview($id = NULL, $rootId = NULL)
 {
     $data = array();
     if (!is_NULL($rootId) and is_null($id)) {
         $data = Page::rootTreeAsArray($rootId);
     } else {
         $data = Page::nodeChildren($id, true);
     }
     return Yii::$app->response->sendContentAsFile(Json::encode($data), 'tree.json', 'application/json');
     exit;
 }
コード例 #7
0
 protected function renderContent()
 {
     $historics = Page::findOldVersions($this->id)->All();
     echo $this->render('@frenzelgmbh/scms/widgets/views/portlet_cms_history', array('historics' => $historics));
 }