Example #1
0
 protected function executeImpl(ArrayAdapter $params)
 {
     $id = $params->int('id');
     $uts = $params->int('date');
     $show = $params->bool('show');
     $type = $params->str('type');
     $pp = Handlers::getInstance()->getPostsProcessorByPostType($type);
     AdminPostsBean::inst()->updateState($pp->dbBean(), $id, $uts, $show);
     return new AjaxSuccess();
 }
Example #2
0
 protected function executeImpl(ArrayAdapter $params)
 {
     $name = $params->str('name');
     $type = $params->str('type');
     $ident = $params->str('ident');
     $rubId = $params->int('rubId');
     check_condition($name, 'Name is empty');
     $pp = Handlers::getInstance()->getPostsProcessorByPostType($type);
     $pp->getFolding()->assertExistsEntity($ident);
     AdminPostsBean::inst()->registerPost($pp->dbBean(), $ident, $name, $rubId);
     return new AjaxSuccess();
 }
Example #3
0
 public function buildContent()
 {
     $PARAMS['uts_php'] = time();
     $PARAMS['uts_db'] = UtilsBean::inst()->getDbUnixTimeStamp();
     $posts = array();
     /* @var $pp PostsProcessor */
     foreach (Handlers::getInstance()->getPostsProcessors() as $pp) {
         $posts[$pp->postsTitle()] = AdminPostsBean::inst()->getAllPosts($pp->dbBean());
     }
     $PARAMS['data'] = $posts;
     echo $this->getFoldedEntity()->fetchTpl($PARAMS);
 }
Example #4
0
 public function buildContent()
 {
     $RES = array();
     /* @var $pp PostsProcessor */
     foreach (Handlers::getInstance()->getPostsProcessors() as $pp) {
         $bean = $pp->dbBean();
         $type = $pp->getPostType();
         $tpls = $pp->getAccessibleTemplates();
         /* @var $value DirItem */
         foreach ($tpls as $tplDi) {
             $ident = $tplDi->getNameNoExt();
             $post = AdminPostsBean::inst()->getPostByIdent($bean, $ident);
             $tplDi->setData('post', $post);
         }
         usort($tpls, array($this, 'sortTpl'));
         $rubrics = $bean instanceof RubricsBean ? AdminPostsBean::inst()->getAllRubrics($bean) : null;
         $RES[] = array('type' => $pp->getPostType(), 'title' => $pp->postsTitle(), 'templates' => $tpls, 'rubrics' => $rubrics);
     }
     echo $this->getFoldedEntity()->fetchTpl(array('data' => $RES));
 }