/** * display method of Portfolio view * @return void */ public function display($tpl = null) { // get the Data $form = $this->get('Form'); $item = $this->get('Item'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Assign the Data $this->form = $form; $this->item = $item; $this->images = $this->get("Images"); $this->params = JComponentHelper::getParams("com_bt_portfolio"); $this->session = JFactory::getSession(); // Set the toolbar $this->addToolBar(); // Display the template parent::display($tpl); if ($this->getLayout() == 'edit_extrafields') { exit; } // Set the document $this->setDocument(); }
/** * Categories view display method * @return void */ function display($tpl = null) { Bt_portfolioLegacyHelper::getCSS(); $this->legacy = Bt_portfolioLegacyHelper::isLegacy(); // Set the toolbar $this->addToolBar(); $buttons = $this->getButtons(); $this->assign('buttons', $buttons); // Display the template parent::display($tpl); // Set the document $this->setDocument(); }
function display($tpl = null) { // Initialise variables $app = JFactory::getApplication(); $user = JFactory::getUser(); $items = $this->get('items'); $pagination = $this->get('pagination'); $category = $this->get('category'); $listCategories = $this->get('listCategories'); $gridCategories = $this->get('gridChildCategories'); $params = $this->get('params'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Content plugin content foreach ($items as $item) { $item->description = JHTML::_('content.prepare', $item->description); $item->extra_fields = Bt_portfolioTablePortfolio::loadExtraFields($item->extra_fields, $item->catids); } $category_layout = $params->get('layout', 'default'); $show_voting = $params->get('show_voting'); $this->assignRef('params', $params); $this->assignRef('pagination', $pagination); $this->assignRef('gridCategories', $gridCategories); $this->assignRef('items', $items); $this->assignRef('show_voting', $show_voting); $this->assignRef('user', $user); $this->assignRef('listCategories', $listCategories); $this->assignRef('category', $category); $theme = $params->get('theme', 'default'); $this->_addPath('template', JPATH_COMPONENT . '/themes/default/layout/list'); $this->_addPath('template', JPATH_COMPONENT . '/themes/' . $theme . '/layout/list'); $this->_addPath('template', JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_bt_portfolio/default/layout/list'); $this->_addPath('template', JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_bt_portfolio/' . $theme . '/layout/list'); $this->setLayout($category_layout); if (JRequest::getVar('task') == 'filter') { $this->params->set('show_childcat', 0); } $this->_prepareDocument(); parent::display($tpl); }
/** * display method of Comment view * @return void */ public function display($tpl = null) { // get the Data $form = $this->get('Form'); $item = $this->get('Item'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Assign the Data $this->form = $form; $this->item = $item; // Set the toolbar $this->addToolBar(); // Display the template parent::display($tpl); // Set the document $this->setDocument(); }
/** * Extrafield view display method * @return void */ function display($tpl = null) { // Get data from the model $items = $this->get('Items'); $pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->legacy = Bt_portfolioLegacyHelper::isLegacy(); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } // Assign data to the view $this->items = $items; $this->pagination = $pagination; // Set the toolbar $this->addToolBar(); // Display the template parent::display($tpl); // Set the document $this->setDocument(); }
function display($tpl = null) { $app = JFactory::getApplication(); $user = JFactory::getUser(); $params = $app->getParams(); $model = $this->getModel(); $uri = JFactory::getURI(); $lang = JFactory::getLanguage(); // Get some data from the models $state = $this->get('State'); $item = $this->get('Item'); $groups = $user->getAuthorisedViewLevels(); if (!in_array($item->access, $groups)) { return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); } $model->hit(); $registry = new JRegistry(); $registry->loadString($item->params); $item->params = $registry; $params->merge($registry); $images = array(); $images = $this->get("Images"); $category = JTable::getInstance('Category', 'Bt_portfolioTable'); $catids = explode(',', $item->catids); $catid_rel = JRequest::getInt('catid_rel'); $mainCategoryID = 0; if (in_array($catid_rel, $catids) && $catid_rel != 0) { $mainCategoryID = $catid_rel; } else { foreach ($catids as $catid) { if ($catid) { $mainCategoryID = $catid; break; } } } $category->load($mainCategoryID); if ($params->get("allow_comment", 1) && $params->get('comment_system') == 'none') { $modelComment = JModelLegacy::getInstance('Comment', 'Bt_portfolioModel', array('ignore_request' => true)); $formComment = $modelComment->getForm(); $limitstart = (int) JRequest::getVar("limitstart", 0); $orderDir = $params->get("comment_displayorder", 'desc'); $skitervideo = $params->get("enable-slideshow", 'skiterslide'); $commentList = $modelComment->getListComment($item->id, $params->get('number_comments', 0), $limitstart, $orderDir); $pageComment = new JPagination($modelComment->getCommentTotal($item->id), $limitstart, $params->get('number_comments', 0)); $comment = array(); $comment['data'] = $commentList; $comment['nav'] = $pageComment; $comment['form'] = $formComment; $this->assignRef('comment', $comment); } // Content plugin $item->full_description = JHTML::_('content.prepare', $item->full_description); $this->assignRef('params', $params); $this->assignRef('item', $item); $this->assignRef('uri', $uri); $this->assignRef('lang', $lang); $this->assignRef('images', $images); $this->assignRef('user', $user); $this->assignRef('category', $category); $this->assignRef('skitervideo', $skitervideo); $theme = $params->get('theme', 'default'); $this->_addPath('template', JPATH_COMPONENT . '/themes/default/layout/detail'); $this->_addPath('template', JPATH_COMPONENT . '/themes/' . $theme . '/layout/detail'); $this->_addPath('template', JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_bt_portfolio/default/layout/detail'); $this->_addPath('template', JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_bt_portfolio/' . $theme . '/layout/detail'); $this->_prepareDocument(); $this->_loadSlideshow(); parent::display($tpl); }