/** * Generates a list of JSON items. * * @return void */ public function display($tpl = null) { $model = $this->getModel(); $this->item = $this->get('Item'); $this->component = $model->getState($model->getName() . '.component'); $this->section = $model->getState($model->getName() . '.section'); $this->asset_id = $model->getState($model->getName() . '.asset_id'); $this->project_id = $model->getState($model->getName() . '.project_id'); $this->inherit = $model->getState($model->getName() . '.inherit'); if (!$this->asset_id && $this->inherit) { $this->asset_id = $this->getComponentProjectAssetId($this->component, $this->project_id); } $this->rules = $this->getAssetRules(); $this->public_groups = array('1', JComponentHelper::getParams('com_users')->get('guest_usergroup', 1)); $user = JFactory::getUser(); if (!$user->authorise('core.admin', $this->component) && !$user->authorise('core.manage', $this->component)) { JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); return false; } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Preprocess the list of items to find ordering divisions. foreach ($this->items as &$item) { $this->ordering[$item->parent_id][] = $item->id; } // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') { $this->addToolbar(); } parent::display($tpl); }
/** * swap the ordering of a record in the Xref tables * @param $direction , 1/-1 The increment to reorder by */ function move($direction, $where = '', $orderingkey = 0) { if (empty($this->_skey)) { vmError('No secondary keys defined in VmTableXarray ' . $this->_tbl); return false; } $skeyId = vRequest::getInt($this->_skey, 0); // Initialize variables $db = JFactory::getDBO(); $cid = vRequest::getInt($this->_pkey); $order = vRequest::getInt('order'); //I found now two times "order" instead of ordering. //This sql is broken $query = 'SELECT `id` FROM `' . $this->_tbl . '` WHERE ' . $this->_pkey . ' = ' . (int) $cid[0] . ' AND `tsmart_category_id` = ' . (int) $skeyId; $db->setQuery($query); $id = $db->loadResult(); $keys = array_keys($order); // TODO next 2 lines not used ???? if ($direction > 0) { $idToSwap = $order[$keys[array_search($id, $keys)] + 1]; } else { $idToSwap = $order[$keys[array_search($id, $keys)] - 1]; } if (isset($cid[0])) { $query = 'UPDATE `' . $this->_tbl . '` ' . ' SET `' . $this->_orderingKey . '` = `' . $this->_orderingKey . '` + ' . $direction . ' WHERE `' . $this->_pkey . '` = ' . (int) $cid[0] . ' AND `' . $this->_skey . '` = ' . (int) $skeyId; $db->setQuery($query); if (!$db->execute()) { $err = $db->getErrorMsg(); JError::raiseError(500, get_class($this) . ':: move ' . $err); } } }
function display($tpl = null) { global $mainframe; // Check if registration is allowed $usersConfig =& JComponentHelper::getParams('com_users'); if (!$usersConfig->get('allowUserRegistration')) { JError::raiseError(403, JText::_('Access Forbidden')); return; } $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $params =& $mainframe->getParams(); // Page Title $menus =& JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object($menu)) { $menu_params = new JParameter($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('Registration')); } } else { $params->set('page_title', JText::_('Registration')); } $document->setTitle($params->get('page_title')); $pathway->addItem(JText::_('New')); // Load the form validation behavior JHTML::_('behavior.formvalidation'); $user =& JFactory::getUser(); $this->assignRef('user', $user); $this->assignRef('params', $params); parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { JFactory::getLanguage()->load('com_categories'); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Preprocess the list of items to find ordering divisions. foreach ($this->items as &$item) { $this->ordering[$item->parent_id][] = $item->id; } // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->assign('f_levels', $options); $this->assign('listsGroup', $this->get('Groups')); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
function display($tpl = null) { $this->categories = $this->get('Categories'); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->countItems = $this->get('CountItems'); $this->pagination = $this->get('Pagination'); /* jimport('joomla.html.pagination'); $limit = JRequest::getVar('limit', '25', '', 'int'); $limitstart = JRequest::getVar('limitstart', '0', '', 'int'); $pagination = new JPagination($this->countItems, $limitstart, $limit); $this->pagination = $pagination;*/ // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); $version = new JVersion(); if (version_compare($version->getShortVersion(), '3.0.0', '<')) { $tpl = 'legacy'; } else { /*JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category', JHtml::_('select.options', DJClassifiedsCategory::getCatSelect(), 'value', 'text', $this->state->get('filter.category'), true) );*/ JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', array(JHtml::_('select.option', '1', 'JPUBLISHED'), JHtml::_('select.option', '0', 'JUNPUBLISHED')), 'value', 'text', $this->state->get('filter.published'), true)); JHtmlSidebar::addFilter(JText::_('COM_DJCLASSIFIEDS_SELECT_ACTIVE'), 'filter_active', JHtml::_('select.options', array(JHtml::_('select.option', '1', 'COM_DJCLASSIFIEDS_ACTIVE'), JHtml::_('select.option', '0', 'COM_DJCLASSIFIEDS_HIDE')), 'value', 'text', $this->state->get('filter.active'), true)); $this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); }
public function save() { $app = JFactory::getApplication (); if (! JRequest::checkToken ()) { $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' ); $this->redirectBack (); } // perform security checks $this->user = JFactory::getUser(); if ($this->user->id == 0) { JError::raiseError( 403, JText::_('Access Forbidden') ); return; } $this->config = KunenaFactory::getConfig(); $this->saveUser(); $this->me = KunenaFactory::getUser(); $this->saveProfile(); $this->saveAvatar(); $this->saveSettings(); if (!$this->me->save()) { $app = JFactory::getApplication(); $app->enqueueMessage($this->me->getError(), 'notice'); } $msg = JText::_( 'COM_KUNENA_PROFILE_SAVED' ); $this->setRedirect ( CKunenaLink::GetMyProfileURL($this->user->get('id'), '', false), $msg ); }
/** * Method to display the view. * * @param string The template file to include * @since 1.5 */ public function display($tpl = null) { // This name will be used to get the model $name = $this->getLayout(); // Check that the name is valid - has an associated model. if (!in_array($name, array('confirm', 'complete'))) { $name = 'default'; } if ('default' == $name) { $formname = 'Form'; } else { $formname = ucfirst($this->_name) . ucfirst($name) . 'Form'; } // Get the view data. $this->form = $this->get($formname); $this->state = $this->get('State'); $this->params = $this->state->params; // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); $this->prepareDocument(); parent::display($tpl); }
function display($tpl = null) { $this->form = $this->get('Form'); // Get data from the model $this->item = $this->get('Item'); $this->taxrules = $this->get('TaxRules'); // inturn calls getState in parent class and populateState() in model $this->state = $this->get('State'); $this->model = $this->getModel('taxprofile'); $lists['taxrate'] = $this->get('TaxRateList'); $lists['address'] = $this->get('AddressList'); $this->lists = $lists; // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } //add toolbar $this->addToolBar(); $toolbar = new K2StoreToolBar(); $toolbar->renderLinkbar(); // Display the template parent::display($tpl); // Set the document $this->setDocument(); }
public function save() { // Check for request forgeries JRequest::checkToken() or die('RESTRICTED'); $row = WFExtensionHelper::getPlugin(null, 'jcemediabox', 'system'); $task = $this->getTask(); // remove id for Joomla! 2.5+ if ($row->extension_id) { unset($row->id); } if (!$row->bind(JRequest::get('post'))) { JError::raiseError(500, $row->getError()); } if (!$row->check()) { JError::raiseError(500, $row->getError()); } if (!$row->store()) { JError::raiseError(500, $row->getError()); } $row->checkin(); $msg = JText::sprintf('WF_MEDIABOX_SAVED'); switch ($task) { case 'apply': $this->setRedirect('index.php?option=com_jce&view=mediabox', $msg); break; case 'save': default: $this->setRedirect('index.php?option=com_jce&view=cpanel', $msg); break; } }
/** * display method of playjoom view * @return void */ public function display($tpl = null) { //Get User Objects $user = JFactory::getUser(); $canDo = PlayJoomHelper::getActions(); // get the Data $form = $this->get('Form'); $item = $this->get('Item'); $script = $this->get('Script'); // 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->script = $script; if ($canDo->get('core.edit') || $canDo->get('core.create') && !JRequest::getVar('id') || JAccess::check($user->get('id'), 'core.admin') == 1) { // Set the toolbar $this->addToolBar(); // Display the template parent::display($tpl); } else { JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } // Set the document $this->setDocument(); }
public function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->categories = Djc2Categories::getInstance(); $user = JFactory::getUser(); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->ordering = array(); foreach ($this->items as &$item) { if (!isset($this->ordering[$item->parent_id])) { $this->ordering[$item->parent_id] = array(); } $this->ordering[$item->parent_id][] = $item->id; } $this->addToolbar(); if (class_exists('JHtmlSidebar') && $user->authorise('core.admin')) { $this->sidebar = JHtmlSidebar::render(); } $version = new JVersion(); if (version_compare($version->getShortVersion(), '3.0.0', '<')) { $tpl = 'legacy'; } parent::display($tpl); }
public function display($tpl = null) { $user = JFactory::getUser(); // Get model data. $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->return_page = $this->get('ReturnPage'); if (empty($this->item->id)) { $authorised = $user->authorise('core.create', 'com_weblinks') || count($user->getAuthorisedCategories('com_weblinks', 'core.create')); } else { $authorised = $user->authorise('core.edit', 'com_weblinks.category.' . $this->item->catid); } if ($authorised !== true) { JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); return false; } if (!empty($this->item)) { $this->form->bind($this->item); } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Create a shortcut to the parameters. $params =& $this->state->params; //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->params = $params; $this->user = $user; $this->_prepareDocument(); parent::display($tpl); }
/** * Display the view * * @return void */ public function display($tpl = null) { if ($this->getLayout() !== 'modal') { ContentHelper::addSubmenu('articles'); } $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->authors = $this->get('Authors'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { $params = JComponentHelper::getParams('com_tz_pinboard'); $img_size = $params->get('portfolio_image_size'); $this->assign('img_size', $img_size); if (JRequest::getCmd('task') != 'lists') { JFactory::getLanguage()->load('com_content'); if ($this->getLayout() == 'pagebreak') { // TODO: This is really dogy - should change this one day. $eName = JRequest::getVar('e_name'); $eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE')); $this->assignRef('eName', $eName); parent::display($tpl); return; } // Initialiase variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $this->canDo = TZ_PinboardHelper::getActions($this->state->get('filter.category_id')); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->assign('listsGroup', $this->get('FieldsGroup')); $this->assign('listsTags', $this->get('Tags')); $this->assign('listAttach', $this->get('Attachment')); $this->assign('listEdit', $this->get('FieldsContent')); $this->addToolbar(); } parent::display($tpl); }
/** * Method to display the view. * * @param string $tpl A template file to load. [optional] * * @return mixed A string if successful, otherwise a JError object. * * @since 2.5 */ public function display($tpl = null) { // Load plug-in language files. FinderHelperLanguage::loadPluginLanguage(); $this->items = $this->get('Items'); $this->total = $this->get('Total'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->pluginState = $this->get('pluginState'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); FinderHelper::addSubmenu('index'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } if (!$this->pluginState['plg_content_finder']->enabled) { JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning'); } elseif ($this->get('TotalIndexed') === 0) { JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_NO_DATA') . ' ' . JText::_('COM_FINDER_INDEX_TIP'), 'notice'); } JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); // Configure the toolbar. $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
/** * Get a list of logged users. * * @param JObject The module parameters. * @return mixed An array of articles, or false on error. */ public static function getList($params) { $db = JFactory::getDbo(); $user = JFactory::getUser(); $query = $db->getQuery(true); $query->select('s.time, s.client_id, u.id, u.name, u.username'); $query->from('#__session AS s'); $query->leftJoin('#__users AS u ON s.userid = u.id'); $query->where('s.guest = 0'); $db->setQuery($query, 0, $params->get('count', 5)); try { $results = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseError(500, $e->getMessage()); return false; } foreach ($results as $k => $result) { $results[$k]->logoutLink = ''; if ($user->authorise('core.manage', 'com_users')) { $results[$k]->editLink = JRoute::_('index.php?option=com_users&task=user.edit&id=' . $result->id); $results[$k]->logoutLink = JRoute::_('index.php?option=com_login&task=logout&uid=' . $result->id . '&' . JSession::getFormToken() . '=1'); } if ($params->get('name', 1) == 0) { $results[$k]->name = $results[$k]->username; } } return $results; }
/** * Display the view * * @return mixed False on error, null otherwise. */ function display($tpl = null) { // Initialise variables $state = $this->get('State'); $items = $this->get('Items'); $parent = $this->get('Parent'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } if ($items === false) { JError::raiseError(404, JText::_('COM_CONTENT_ERROR_CATEGORY_NOT_FOUND')); return false; } if ($parent == false) { JError::raiseError(404, JText::_('COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND')); return false; } $params =& $state->params; $items = array($parent->id => $items); //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->maxLevelcat = $params->get('maxLevelcat', -1); $this->assignRef('params', $params); $this->assignRef('parent', $parent); $this->assignRef('items', $items); $this->_prepareDocument(); parent::display($tpl); }
public function execute($task) { $session = JFactory::getSession(); switch ($task) { case 'add': case 'default': case 'browse': $session->set('buadmin.task', 'default', 'akeeba'); $this->task = 'browse'; break; case 'restorepoint': if (!AKEEBA_PRO) { JError::raiseError('403', JText::_('AKEEBA_POSTSETUP_NOTAVAILABLEINCORE')); return false; } $session->set('buadmin.task', 'restorepoint', 'akeeba'); $this->task = 'browse'; break; case 'showcomment': $this->layout = 'comment'; $this->task = 'edit'; break; default: $this->task = $task; break; } $this->input->set('task', $this->task); $this->getThisView()->setLayout($this->layout); parent::execute($this->task); }
/** * Display the Hello World view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ function display($tpl = null) { $app = JFactory::getApplication(); $context = "business.list.admin.business"; // Get data from the model $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'businessName', 'cmd'); $this->filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', 'asc', 'cmd'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } BusinessHelper::addSubmenu('logstamps'); // Set the toolbar $this->addToolBar(); // Display the template parent::display($tpl); // Set the document $this->setDocument(); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. */ public function display($tpl = null) { $state = $this->get('State'); $items = $this->get('Items'); $parent = $this->get('Parent'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } if ($items === false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } if ($parent == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } $params =& $state->params; $items = array($parent->id => $items); // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->maxLevelcat = $params->get('maxLevelcat', -1); $this->params =& $params; $this->parent =& $parent; $this->items =& $items; return parent::display($tpl); }
/** * Constructor * * @access protected * @param array $options optional parameters */ function __construct($options = array()) { if (!$this->test()) { return JError::raiseError(404, "The apc extension is not available"); } parent::__construct($options); }
public function importArticles($filename, $dry_run = false) { // Open the file $open_ok = $self->open($filename); if ($open_ok !== true) { return JError::raiseError(500, $open_ok); } // Read the data and import the articles $num_records = 0; while ($self->readNextRecord()) { // Create the raw record $record = object(); // Copy in the fields from the CSV data $this->bind($record); // Verify the category $cat_ok = $this->_verifyCategory((int) $record->catid, $record->category_title); if ($cat_ok !== true) { return JError::raiseError(500, $cat_ok); } // Verify the creator $creator_ok = $this->_verifyUser((int) $record->created_by, $record->created_by_name); if ($creator_ok !== true) { return JError::raiseError(500, $creator_ok); } // Save the record if (!$dry_run) { // ??? } $num_records += 1; } $this->close(); }
/** * Display the view */ public function display($tpl = null) { if ($this->getLayout() == 'pagebreak') { // TODO: This is really dogy - should change this one day. $eName = JRequest::getVar('e_name'); $eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE')); $this->assignRef('eName', $eName); parent::display($tpl); return; } // Initialiase variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $this->canDo = ContentHelper::getActions($this->state->get('filter.category_id')); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); }
/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { ContentHelper::addSubmenu('featured'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->authors = $this->get('Authors'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // Levels filter. $options = array(); $options[] = JHtml::_('select.option', '1', JText::_('J1')); $options[] = JHtml::_('select.option', '2', JText::_('J2')); $options[] = JHtml::_('select.option', '3', JText::_('J3')); $options[] = JHtml::_('select.option', '4', JText::_('J4')); $options[] = JHtml::_('select.option', '5', JText::_('J5')); $options[] = JHtml::_('select.option', '6', JText::_('J6')); $options[] = JHtml::_('select.option', '7', JText::_('J7')); $options[] = JHtml::_('select.option', '8', JText::_('J8')); $options[] = JHtml::_('select.option', '9', JText::_('J9')); $options[] = JHtml::_('select.option', '10', JText::_('J10')); $this->f_levels = $options; $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
function publish() { // global $option; $cid = JRequest::getVar('cid', array()); $row = JTable::getInstance('twines', 'Table'); $publish = 1; if ($this->getTask() == 'unpublish') { $publish = 0; } if (!$row->publish($cid, $publish)) { JError::raiseError(500, $row->getError()); } $s = ''; if (count($cid) > 1) { $s = 's'; } $msg = 'Page' . $s; if ($this->getTask() == 'unpublish') { $msg .= ' unpublished'; } else { $msg .= ' published'; } // $this->setRedirect('index.php?option=' . $option, $msg); $this->setRedirect('index.php?option=com_battle&view=twines', $msg); }
/** * Method to get article data. * * @param integer $pk The id of the article. * * @return mixed Menu item data object on success, false on failure. */ public function getItem($pk = null) { $user = JFactory::getUser(); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($this->getState('item.select', 'a.*')); $pk = !empty($pk) ? $pk : (int) $this->getState('page.id'); $query->from($db->quoteName('#__azurapagebuilder_pages') . ' AS a'); // Join on user table. $query->select('u.name AS author')->join('LEFT', '#__users AS u on u.id = a.created_by'); $query->where('a.id = ' . (int) $pk); $db->setQuery($query); // convert page params to JRegistry object $result = $db->loadObject(); if ($result) { $params = new JRegistry(); $params->loadString($result->params); $result->params = $params; $metadata = new JRegistry(); $metadata->loadString($result->metadata); $result->metadata = $metadata; return $result; } else { return JError::raiseError(404, JText::_('COM_AZURAPAGEBUILDER_ERROR_PAGE_NOT_FOUND')); } }
/** * Displays the list view * @param string $tpl */ public function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } TagnyilvantartasHelper::addSubmenu('cimkeks'); $this->addToolbar(); if(!version_compare(JVERSION,'3','<')){ $this->sidebar = JHtmlSidebar::render(); } if(version_compare(JVERSION,'3','<')){ $tpl = "25"; } parent::display($tpl); }
/** * Constructor * * @param array $options Optional parameters. * * @since 11.1 */ public function __construct($options = array()) { if (!$this->test()) { return JError::raiseError(404, JText::_('JLIB_SESSION_EACCELERATOR_EXTENSION_NOT_AVAILABLE')); } parent::__construct($options); }
/** * Displays the form * * @param string $tpl - The tmpl * * @return mixed|void */ public function display($tpl = null) { if (MatukioHelperSettings::getSettings('rss_feed', 1) == 0) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); } $database = JFactory::getDBO(); $neudatum = MatukioHelperUtilsDate::getCurrentDate(); $where = array(); $database->setQuery("SELECT id, access FROM #__categories WHERE extension='" . JFactory::getApplication()->input->get('option') . "'"); $cats = $database->loadObjectList(); $allowedcat = array(); foreach ($cats as $cat) { if ($cat->access < 1) { $allowedcat[] = $cat->id; } } if (count($allowedcat) > 0) { $allowedcat = implode(',', $allowedcat); $where[] = "a.catid IN ({$allowedcat})"; } $where[] = "a.published = '1'"; $where[] = "a.end > '{$neudatum}'"; $where[] = "a.booked > '{$neudatum}'"; $database->setQuery("SELECT a.*, r.*, cat.title AS category FROM #__matukio_recurring AS r\r\n\t\t LEFT JOIN #__matukio AS a ON r.event_id = a.id\r\n\t\t LEFT JOIN #__categories AS cat ON cat.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nORDER BY r.begin ASC" . "\nLIMIT 0, 1000"); $rows = $database->loadObjectList(); $this->rows = $rows; parent::display($tpl); }