Exemple #1
0
 public function run($params = null)
 {
     $view = new \fpcm\model\view\module('nkorg/rssimport', 'acp', 'main', '');
     $userlist = new \fpcm\model\users\userList();
     $users = $userlist->getUsersNameList();
     $seluser = array_values(array_slice($users, 0, 1));
     $view->assign('userids', $users);
     $view->assign('selectedUser', $seluser[0]);
     $categorylist = new \fpcm\model\categories\categoryList();
     $categories = $categorylist->getCategoriesNameListCurrent();
     $selcategory = array_values(array_slice($categories, 0, 1));
     $view->assign('categoryids', $categories);
     $view->assign('selectedCategory', $selcategory[0]);
     $view->render();
 }
 /**
  * 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);
 }
 /**
  * Content rendern
  */
 private function renderContent()
 {
     $ownPermissions = $this->permissions->check(array('article' => 'edit'), array('comment' => 'edit'));
     $allPermissions = $this->permissions->check(array('article' => 'editall'), array('comment' => 'editall'));
     $commenList = new \fpcm\model\comments\commentList();
     $userlist = new \fpcm\model\users\userList();
     $comments = $commenList->getCommentsByLimit(10, 0);
     $users = array_flip($userlist->getUsersNameList());
     $content = array();
     $content[] = '<table class="fpcm-ui-table fpcm-ui-articles fpcm-ui-large-td">';
     foreach ($comments as $comment) {
         $createInfo = $this->language->translate('COMMMENT_LASTCHANGE', array('{{username}}' => isset($users[$comment->getChangeuser()]) ? $users[$comment->getChangeuser()] : $this->language->translate('GLOBAL_NOTFOUND'), '{{time}}' => date($this->config->system_dtmask, $comment->getChangetime())));
         if (!$comment->getChangeuser() && !$comment->getChangetime()) {
             $createInfo = '';
         }
         $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="' . $comment->getArticleLink() . '" target="_blank" title="' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '">' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '</a>';
         if ($comment->getEditPermission()) {
             $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-ui-button-edit fpcm-loader" href="' . $comment->getEditLink() . '&amp;mode=1" 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($comment->getName())) . '</strong> @ ' . date($this->config->system_dtmask, $comment->getCreatetime()) . '<br>';
         $content[] = '  <span>' . $createInfo . '</span>';
         $content[] = '  </td>';
         $content[] = '  <td class="fpcm-ui-dashboard-recentarticles-meta">';
         if ($comment->getSpammer()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('COMMMENT_SPAM') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-flag fa-stack-1x fa-inverse"></span></span>';
         }
         if ($comment->getApproved()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('COMMMENT_APPROVE') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-check-circle-o fa-rotate-90 fa-stack-1x fa-inverse"></span></span>';
         }
         if ($comment->getPrivate()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('COMMMENT_PRIVATE') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-eye-slash 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);
 }
Exemple #4
0
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     $eventResult = $this->events->runEvent('articleReplaceEditorPlugin');
     if (is_a($eventResult, '\\fpcm\\model\\abstracts\\articleEditor')) {
         $this->editorPlugin = $eventResult;
     } elseif ($this->config->system_editor) {
         $this->editorPlugin = new \fpcm\model\editor\htmlEditor();
     } else {
         $this->editorPlugin = new \fpcm\model\editor\tinymceEditor();
     }
     $this->view->setViewJsFiles($this->editorPlugin->getJsFiles());
     $this->view->setViewCssFiles($this->editorPlugin->getCssFiles());
     $viewVars = $this->editorPlugin->getViewVars();
     foreach ($viewVars as $key => $value) {
         $this->view->assign($key, $value);
     }
     $changeAuthor = $this->permissions->check(array('article' => 'authors'));
     $this->view->assign('changeAuthor', $changeAuthor);
     if ($changeAuthor) {
         $userlist = new \fpcm\model\users\userList();
         $changeuserList = array($this->lang->translate('EDITOR_CHANGEAUTHOR') => '') + $userlist->getUsersNameList();
         $this->view->assign('changeuserList', $changeuserList);
     }
     $this->view->assign('editorFile', $this->editorPlugin->getEditorTemplate());
     $this->view->assign('article', $this->article);
     $this->view->assign('categories', $this->categoryList->getCategoriesCurrentUser());
     $this->view->assign('commentEnabledGlobal', $this->config->system_comments_enabled);
     $this->view->assign('showArchiveStatus', true);
     $this->view->assign('showDraftStatus', true);
     $this->view->assign('isRevision', false);
     $this->view->assign('timesMode', false);
     $this->view->assign('userfields', $this->getUserFields());
     $twitter = new \fpcm\model\system\twitter();
     $this->view->assign('showTwitter', $twitter->checkRequirements());
     $this->jsVars = $this->editorPlugin->getJsVars();
     $this->jsVars += array('fpcmFileManagerUrl' => \fpcm\classes\baseconfig::$rootPath . 'index.php?module=files/list&mode=', 'fpcmFileManagerUrlMode' => 2);
     $jsLangVars = array('fileManagerHeadline' => $this->lang->translate('HL_FILES_MNG'));
     $this->view->addJsLangVars(array_merge($jsLangVars, $this->editorPlugin->getJsLangVars()));
     $this->view->addJsVars($this->jsVars);
     return true;
 }