Esempio n. 1
0
 public function display($cachable = false, $urlparams = array())
 {
     $model = $this->getModel('item');
     $format = JRequest::getWord('format', 'html');
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $view = $this->getView('itemlist', $viewType);
     $view->setModel($model);
     $user = JFactory::getUser();
     if ($user->guest) {
         $cache = true;
     } else {
         $cache = false;
     }
     if (K2_JVERSION != '15') {
         $urlparams['limit'] = 'UINT';
         $urlparams['limitstart'] = 'UINT';
         $urlparams['id'] = 'INT';
         $urlparams['tag'] = 'STRING';
         $urlparams['searchword'] = 'STRING';
         $urlparams['day'] = 'INT';
         $urlparams['year'] = 'INT';
         $urlparams['month'] = 'INT';
         $urlparams['print'] = 'INT';
         $urlparams['lang'] = 'CMD';
         $urlparams['Itemid'] = 'INT';
     }
     parent::display($cache, $urlparams);
 }
Esempio n. 2
0
 public function display($cachable = false, $urlparams = array())
 {
     JRequest::setVar('view', 'extrafieldsgroups');
     $model = $this->getModel('extraFields');
     $view = $this->getView('extrafieldsgroups', 'html');
     $view->setModel($model, true);
     parent::display();
 }
Esempio n. 3
0
 public function display($cachable = false, $urlparams = array())
 {
     if (K2_JVERSION != '15') {
         $mainframe = JFactory::getApplication();
         $mainframe->redirect('index.php?option=com_config&view=component&component=com_k2&path=&tmpl=component');
     } else {
         JRequest::setVar('tmpl', 'component');
         parent::display();
     }
 }
Esempio n. 4
0
 /**
  * Read function.
  * Handles all the read requests ( lists and forms ) and triggers the appropriate view method.
  *
  * @param string $mode		The mode of the read function. Pass 'row' for retrieving a single row or 'list' to retrieve a collection of rows.
  * @param mixed $id			The id of the row to load when we are retrieving a single row.
  *
  * @return void
  */
 protected function read($mode = 'row', $id = null)
 {
     $application = JFactory::getApplication();
     $itemId = $application->input->get('itemId', 0, 'int');
     if ($itemId) {
         $this->embed($id);
     } else {
         parent::read($mode, $id);
     }
 }
Esempio n. 5
0
 protected function getInputData()
 {
     $data = parent::getInputData();
     $params = JComponentHelper::getParams('com_k2');
     if ($params->get('mergeEditors')) {
         $data['text'] = JComponentHelper::filterText($this->input->get('text', '', 'raw'));
     } else {
         $data['introtext'] = JComponentHelper::filterText($this->input->get('introtext', '', 'raw'));
         $data['fulltext'] = JComponentHelper::filterText($this->input->get('fulltext', '', 'raw'));
     }
     $data['media'] = JComponentHelper::filterText($this->input->get('media', '', 'raw'));
     return $data;
 }
Esempio n. 6
0
 public function display($cachable = false, $urlparams = array())
 {
     $model = $this->getModel('itemlist');
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $view = $this->getView('item', $viewType);
     $view->setModel($model);
     JRequest::setVar('view', 'item');
     $user = JFactory::getUser();
     if ($user->guest) {
         $cache = true;
     } else {
         $cache = true;
         JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'tables');
         $row = JTable::getInstance('K2Item', 'Table');
         $row->load(JRequest::getInt('id'));
         if (K2HelperPermissions::canEditItem($row->created_by, $row->catid)) {
             $cache = false;
         }
         $params = K2HelperUtilities::getParams('com_k2');
         if ($row->created_by == $user->id && $params->get('inlineCommentsModeration')) {
             $cache = false;
         }
         if ($row->access > 0) {
             $cache = false;
         }
         $category = JTable::getInstance('K2Category', 'Table');
         $category->load($row->catid);
         if ($category->access > 0) {
             $cache = false;
         }
         if ($params->get('comments') && $document->getType() == 'html') {
             $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
             $profile = $itemListModel->getUserProfile($user->id);
             $script = "\n\$K2(document).ready(function() {\n\$K2('#userName').val('" . $view->escape($user->name) . "').attr('disabled', 'disabled');\n\$K2('#commentEmail').val('" . $user->email . "').attr('disabled', 'disabled');";
             if (is_object($profile) && $profile->url) {
                 $script .= " \$K2('#commentURL').val('" . htmlspecialchars($profile->url, ENT_QUOTES, 'UTF-8') . "').attr('disabled', 'disabled');";
             }
             $script .= " });";
             $document->addScriptDeclaration($script);
         }
     }
     if (K2_JVERSION != '15') {
         $urlparams['id'] = 'INT';
         $urlparams['print'] = 'INT';
         $urlparams['lang'] = 'CMD';
         $urlparams['Itemid'] = 'INT';
     }
     parent::display($cache, $urlparams);
 }
Esempio n. 7
0
 public function display($cachable = false, $urlparams = array())
 {
     $view = $this->getView('latest', 'html');
     $model = $this->getModel('itemlist');
     $view->setModel($model);
     $itemModel = $this->getModel('item');
     $view->setModel($itemModel);
     $user = JFactory::getUser();
     if ($user->guest) {
         $cache = true;
     } else {
         $cache = false;
     }
     parent::display($cache);
 }
Esempio n. 8
0
 public function display($cachable = false, $urlparams = array())
 {
     $model = $this->getModel('item');
     $format = JRequest::getWord('format', 'html');
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $view = $this->getView('itemlist', $viewType);
     $view->setModel($model);
     $user = JFactory::getUser();
     if ($user->guest) {
         $cache = true;
     } else {
         $cache = false;
     }
     parent::display($cache);
 }
Esempio n. 9
0
 public function display($cachable = false, $urlparams = array())
 {
     JRequest::setVar('view', 'usergroups');
     parent::display();
 }
Esempio n. 10
0
 public function display($cachable = false, $urlparams = array())
 {
     JRequest::setVar('view', 'extrafield');
     parent::display();
 }
Esempio n. 11
0
 public function display($cachable = false, $urlparams = array())
 {
     require_once JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'route.php';
     JRequest::setVar('view', 'comments');
     parent::display();
 }
Esempio n. 12
0
 function element()
 {
     JRequest::setVar('view', 'users');
     JRequest::setVar('layout', 'element');
     parent::display();
 }
Esempio n. 13
0
 protected function getInputData()
 {
     $data = parent::getInputData();
     $data['description'] = JComponentHelper::filterText($this->input->get('description', '', 'raw'));
     return $data;
 }