/**
  * Auszuführender Cron-Code
  */
 public function run()
 {
     $articlesList = new \fpcm\model\articles\articlelist();
     $articleIds = $articlesList->getArticlesPostponedIDs();
     if (!count($articleIds)) {
         return true;
     }
     $articlesList->publishPostponedArticles($articleIds);
     return true;
 }
Example #2
0
 /**
  * Request-Handler
  * @return boolean
  */
 public function request()
 {
     parent::request();
     if (is_null($this->getRequestVar('ids'))) {
         return false;
     }
     $sparams['ids'] = array_map('intval', json_decode($this->getRequestVar('ids', array(1, 4, 7)), true));
     $articleList = new \fpcm\model\articles\articlelist();
     $this->articleItems = $articleList->getArticlesByCondition($sparams, false);
     return true;
 }
Example #3
0
 /**
  * Content rendern
  */
 private function renderContent()
 {
     $ownPermissions = $this->permissions->check(array('article' => 'edit'));
     $allPermissions = $this->permissions->check(array('article' => 'editall'));
     $articleList = new \fpcm\model\articles\articlelist();
     $userlist = new \fpcm\model\users\userList();
     $conditions = array('draft' => -1, 'approval' => -1, 'limit' => array(10, 0), 'orderby' => array('createtime DESC'));
     $articles = $articleList->getArticlesByCondition($conditions);
     $users = array_flip($userlist->getUsersNameList());
     $content = array();
     $content[] = '<table class="fpcm-ui-table fpcm-ui-articles fpcm-ui-large-td">';
     foreach ($articles as $article) {
         $createInfo = $this->language->translate('EDITOR_AUTHOREDIT', array('{{username}}' => isset($users[$article->getCreateuser()]) ? $users[$article->getCreateuser()] : $this->language->translate('GLOBAL_NOTFOUND'), '{{time}}' => date($this->config->system_dtmask, $article->getCreatetime())));
         $content[] = '<tr class="fpcm-small-text">';
         $content[] = '  <td class="fpcm-ui-articlelist-open">';
         $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-openlink-btn" href="' . $article->getArticleLink() . '" target="_blank" title="' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '">' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '</a>';
         if ($article->getEditPermission()) {
             $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-ui-button-edit fpcm-loader" href="' . $article->getEditLink() . '" title="' . $this->language->translate('GLOBAL_EDIT') . '">' . $this->language->translate('GLOBAL_EDIT') . '</a>';
         } else {
             $content[] = '  <span class="fpcm-ui-button fpcm-ui-button-blank fpcm-ui-button-edit fpcm-ui-readonly" title="' . $this->language->translate('GLOBAL_EDIT') . '">' . $this->language->translate('GLOBAL_EDIT') . '</span>';
         }
         $content[] = '  </td>';
         $content[] = '  <td>';
         $content[] = '  <strong>' . \fpcm\model\view\helper::escapeVal(strip_tags(substr(rtrim($article->getTitle(), '.!?'), 0, 64))) . '...</strong><br>';
         $content[] = '  <span>' . $createInfo . '</span>';
         $content[] = '  </td>';
         $content[] = '  <td class="fpcm-ui-dashboard-recentarticles-meta">';
         if ($article->getPinned()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_PINNED') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-thumb-tack fa-rotate-90 fa-stack-1x fa-inverse"></span></span>';
         }
         if ($article->getDraft()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_DRAFT') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-file-text-o fa-stack-1x fa-inverse"></span></span>';
         }
         if ($article->getPostponed()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_POSTPONETO') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-clock-o fa-stack-1x fa-inverse"></span></span>';
         }
         if ($article->getApproval()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_APPROVAL') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-thumbs-o-up fa-stack-1x fa-inverse"></span></span>';
         }
         $content[] = '  </td>';
         $content[] = '</tr>';
     }
     $content[] = '</table>';
     $this->content = implode(PHP_EOL, $content);
     $this->cache->write($this->content, $this->config->system_cache_timeout);
 }
Example #4
0
 /**
  * Artikel-Statistiken berechnen
  */
 protected function getArticleStats()
 {
     $articleList = new \fpcm\model\articles\articlelist();
     $this->tableContent[] = '<tr><td><strong>' . $this->language->translate('SYSTEM_STATS_ARTICLES_ALL') . ':</strong></td><td class="fpcm-ui-center">' . $articleList->countArticlesByCondition() . '</td></tr>';
     $this->tableContent[] = '<tr><td><strong>' . $this->language->translate('SYSTEM_STATS_ARTICLES_ACTIVE') . ':</strong></td><td class="fpcm-ui-center">' . $articleList->countArticlesByCondition(array('active' => true)) . '</td></tr>';
     $this->tableContent[] = '<tr><td><strong>' . $this->language->translate('SYSTEM_STATS_ARTICLES_ARCHIVE') . ':</strong></td><td class="fpcm-ui-center">' . $articleList->countArticlesByCondition(array('archived' => true)) . '</td></tr>';
     $this->tableContent[] = '<tr><td><strong>' . $this->language->translate('SYSTEM_STATS_ARTICLES_DRAFT') . ':</strong></td><td class="fpcm-ui-center">' . $articleList->countArticlesByCondition(array('drafts' => true)) . '</td></tr>';
     $this->tableContent[] = '<tr><td><strong>' . $this->language->translate('SYSTEM_STATS_ARTICLES_TRASH') . ':</strong></td><td class="fpcm-ui-center">' . $articleList->countArticlesByCondition(array('deleted' => true)) . '</td></tr>';
     $count = $articleList->countArticlesByCondition(array('approval' => true));
     $this->tableContent[] = '<tr class="' . ($count > 0 ? 'fpcm-ui-important-text' : 'fpcm-ui-text') . '"><td><strong>' . $this->language->translate('SYSTEM_STATS_ARTICLES_APPROVAL') . ':</strong></td><td class="fpcm-ui-center">' . $count . '</td></tr>';
 }