Ejemplo n.º 1
0
 public function display()
 {
     $editor_settings = array('height' => '150', 'theme_advanced_statusbar_location' => 'none', 'theme_advanced_buttons1' => 'bold,italic,strikethrough,underline,|,bullist,numlist,blockquote,|,link,unlink', 'theme_advanced_buttons2' => '', 'valid_elements' => 'a[href],b,blockquote,em,i,li,ol,p,span,strong,u,ul');
     $this->assign('editor_settings', $editor_settings);
     $comment = $this->getModel()->getItem();
     if (!$comment->isNew() && $comment->isAttachable()) {
         $this->assign('attachments', $comment->getAttachments());
     }
     return parent::display();
 }
Ejemplo n.º 2
0
 public function display()
 {
     $model = $this->getModel();
     $comments = $model->getList();
     $article = $this->getService('com://admin/news.model.articles')->id($model->get('row'))->getItem();
     $attachments = $this->getService('com://admin/news.model.attachments')->table('comments_comments')->row($comments->getColumn('id'))->getList();
     $this->assign('article', $article);
     $this->assign('attachments', $attachments);
     $editor_settings = array('height' => '150', 'theme_advanced_statusbar_location' => 'none', 'theme_advanced_buttons1' => implode(',', array('bold', 'italic', 'strikethrough', 'underline', '|', 'bullist', 'numlist', 'blockquote', '|', 'link', 'unlink')), 'theme_advanced_buttons2' => '', 'valid_elements' => implode(',', array('a[href]', 'b', 'blockquote', 'em', 'i', 'li', 'ol', 'p', 'span', 'strong', 'u', 'ul')));
     $this->assign('editor_settings', $editor_settings);
     return parent::display();
 }
Ejemplo n.º 3
0
 public function display()
 {
     $model = $this->getModel();
     $document = JFactory::getDocument();
     $parts = array();
     if ($model->getState()->subscribed) {
         $parts[] = JText::_('My Articles');
     }
     if ($model->getState()->category) {
         $category = $this->getService('com://site/news.model.categories')->id($model->getState()->category)->getItem();
         $parts[] = $category->title;
     }
     if (count($parts)) {
         $document->setTitle(implode(': ', $parts));
     }
     if ($model->getState()->search) {
         $document->setTitle(JText::_('Article Search') . ': ' . $model->getState()->search);
     } elseif (!$model->getState()->subscribed && !$model->getState()->category) {
         $document->setTitle(JText::_('Articles'));
     }
     return parent::display();
 }
Ejemplo n.º 4
0
 public function display()
 {
     $model = $this->getModel();
     $article = $model->getItem();
     $pathway = JFactory::getApplication()->getPathway();
     $pathway->addItem($this->escape($article->title), $this->createRoute('view=article&id=' . $article->id . '&slug=' . $article->slug));
     if ($article->id && $article->isAttachable()) {
         $this->assign('attachments', $article->getAttachments());
     }
     $document = JFactory::getDocument();
     switch ($this->getLayout()) {
         case 'form':
             if (JFactory::getUser()->gid == 18) {
                 $editor_settings = array('theme_advanced_statusbar_location' => 'none', 'theme_advanced_buttons1' => 'bold,italic,strikethrough,underline,|,bullist,numlist,blockquote,|,link,unlink', 'theme_advanced_buttons2' => '', 'valid_elements' => 'a[href],b,blockquote,em,i,li,ol,p,span,strong,u,ul');
             } else {
                 $editor_settings = array();
             }
             $this->assign('editor_settings', $editor_settings);
             $document->setTitle($article->id ? JText::_('Edit') . ' ' . $article->title : JText::_('New Article'));
             break;
         case 'default':
         default:
             $user = JFactory::getUser();
             if ($article->commentable) {
                 $subscription = $this->getService('com://admin/news.database.table.subscriptions')->select(array('news_article_id' => $article->id, 'user_id' => $user->id), KDatabase::FETCH_ROW);
                 $this->assign('subscribed', !$subscription->isNew());
             }
             $parts = array();
             $category = $this->getService('com://site/news.model.categories')->id($article->news_category_id)->getItem();
             if ($category->id) {
                 $parts[] = $category->title;
             }
             $parts[] = $article->title;
             $document->setTitle(implode(': ', $parts));
             break;
     }
     return parent::display();
 }
Ejemplo n.º 5
0
 protected function _initialize(KConfig $config)
 {
     $config->append(array('template_filters' => array('module')));
     parent::_initialize($config);
 }