Exemple #1
0
 protected function executePrepend(PHPTAL $TAL)
 {
     //DbControl::$debug = true;
     try {
         // XT admin
         if (LBoxXT::isLoggedAdmin() && count($_POST[$this->getFormGroupName()]["xt"]) > 0) {
             switch ($_POST[$this->getFormGroupName()]["xt"]["action"]) {
                 case "edit":
                     $pageEditArticlesId = LBoxConfigManagerProperties::getInstance()->getPropertyByName("ref_page_xt_admin_articles")->getContent();
                     $pageEditArticles = LBoxConfigManagerStructure::getPageById($pageEditArticlesId);
                     $this->reload($pageEditArticles->url . ":" . $_POST[$this->getFormGroupName()]["xt"]["id"]);
                     break;
                 case "delete":
                     $this->deleteArticle($_POST[$this->getFormGroupName()]["xt"]["id"]);
                     $this->reload();
                     break;
             }
         }
         $TAL->xtAdmin = LBoxXT::isLoggedAdmin();
         $pageMoreId = LBoxConfigManagerProperties::getInstance()->getPropertyByName("ref_page_articles_news")->getContent();
         $pageMore = LBoxConfigManagerStructure::getPageById($pageMoreId);
         $limit = $this->getListPaging();
         $news = new ArticlesNewsRecords(false, array("time_published" => 0), array(1, $limit));
         $news->setOutputFilterItemsClass("OutputFilterArticleNews");
         $TAL->news = $news->count() > 0 ? $news : false;
         $TAL->urlMore = $pageMore->url;
     } catch (Exception $e) {
         throw $e;
     }
 }
Exemple #2
0
 protected function executePrepend(PHPTAL $TAL)
 {
     try {
         // DbControl::$debug	= true;
         $itemsLimit = LBoxConfigManagerProperties::getInstance()->getPropertyByName("box_last_news_limit")->getContent();
         $order["time_published"] = 0;
         $limit = array(0, $itemsLimit);
         $news = new ArticlesNewsRecords(false, $order, $limit);
         $news4Count = new ArticlesNewsRecords();
         $news->setOutputFilterItemsClass("OutputFilterArticleNews");
         $TAL->iteratorNews = $news;
         $TAL->pageMoreCfg = LBoxConfigManagerStructure::getInstance()->getPageById(LBoxConfigManagerProperties::getInstance()->getPropertyByName("ref_page_articles_news")->getContent());
         $TAL->atLeastOne = $news->count() > 0;
         $TAL->hasMore = $news4Count->count() > $news->count();
     } catch (Exception $e) {
         throw $e;
     }
 }