function save() { $mainframe =& JFactory::getApplication(); $row =& JTable::getInstance('K2UserGroup', 'Table'); if (!$row->bind(JRequest::get('post'))) { $mainframe->redirect('index.php?option=com_k2&view=userGroups', $row->getError(), 'error'); } if (!$row->check()) { $mainframe->redirect('index.php?option=com_k2&view=userGroup&cid=' . $row->id, $row->getError(), 'error'); } if (!$row->store()) { $mainframe->redirect('index.php?option=com_k2&view=userGroups', $row->getError(), 'error'); } $cache =& JFactory::getCache('com_k2'); $cache->clean(); switch (JRequest::getCmd('task')) { case 'apply': $msg = JText::_('Changes to User Group saved'); $link = 'index.php?option=com_k2&view=userGroup&cid=' . $row->id; break; case 'save': default: $msg = JText::_('User Group Saved'); $link = 'index.php?option=com_k2&view=userGroups'; break; } $mainframe->redirect($link, $msg); }
/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/users.php'; // Load the submenu. UsersHelper::addSubmenu(JRequest::getCmd('view', 'users')); $view = JRequest::getCmd('view', 'users'); $layout = JRequest::getCmd('layout', 'default'); $id = JRequest::getInt('id'); if (!$this->canView($view)) { JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); return; } // Check for edit form. if ($view == 'user' && $layout == 'edit' && !$this->checkEditId('com_users.edit.user', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=users', false)); return false; } elseif ($view == 'group' && $layout == 'edit' && !$this->checkEditId('com_users.edit.group', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=groups', false)); return false; } elseif ($view == 'level' && $layout == 'edit' && !$this->checkEditId('com_users.edit.level', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_users&view=levels', false)); return false; } return parent::display(); }
function __construct() { $app = JFactory::getApplication(); parent::__construct(); $config = JFactory::getConfig(); $paramsC = JComponentHelper::getParams('com_phocadownload') ; $defaultPagination = $paramsC->get( 'default_pagination', '20' ); $file_ordering = $paramsC->get( 'file_ordering', 1 ); $context = $this->_context.'.'; // Get the pagination request variables $this->setState('limit', $app->getUserStateFromRequest($context.'limit', 'limit', $defaultPagination, 'int')); $this->setState('limitstart', $app->input->get('limitstart', 0, 'int')); // In case limit has been changed, adjust limitstart accordingly $this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0)); $this->setState('filter.language',$app->getLanguageFilter()); $this->setState('fileordering', $app->getUserStateFromRequest($context .'fileordering', 'fileordering', $file_ordering, 'int')); // Get the filter request variables $this->setState('filter_order', JRequest::getCmd('filter_order', 'ordering')); $this->setState('filter_order_dir', JRequest::getCmd('filter_order_Dir', 'ASC')); }
/** * Image Manager Popup * * @param string $listFolder The image directory to display * @since 1.5 */ function getFolderList($base = null) { global $mainframe; // Get some paths from the request if (empty($base)) { $base = JA_WORKING_DATA_FOLDER; } // Get the list of folders jimport('joomla.filesystem.folder'); $folders = JFolder::folders($base, '.', 4, true); // Load appropriate language files $lang =& JFactory::getLanguage(); $lang->load(JRequest::getCmd('option'), JPATH_ADMINISTRATOR); $document =& JFactory::getDocument(); $document->setTitle(JText::_('Insert Image')); // Build the array of select options for the folder list $options[] = JHTML::_('select.option', "", "/"); foreach ($folders as $folder) { $folder = str_replace(JA_WORKING_DATA_FOLDER, "", $folder); $value = substr($folder, 1); $text = str_replace(DS, "/", $folder); $options[] = JHTML::_('select.option', $value, $text); } // Sort the folder list array if (is_array($options)) { sort($options); } // Create the drop-down folder select list $list = JHTML::_('select.genericlist', $options, 'folderlist', "class=\"inputbox\" size=\"1\" onchange=\"ImageManager.setFolder(this.options[this.selectedIndex].value)\" ", 'value', 'text', $base); return $list; }
/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/menus.php'; // Load the submenu. MenusHelper::addSubmenu(JRequest::getCmd('view')); $view = JRequest::getCmd('view', 'menus'); $layout = JRequest::getCmd('layout', 'default'); $id = JRequest::getInt('id'); // Check for edit form. if ($view == 'menu' && $layout == 'edit' && !$this->checkEditId('com_menus.edit.menu', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menus', false)); return false; } elseif ($view == 'item' && $layout == 'edit' && !$this->checkEditId('com_menus.edit.item', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_menus&view=items', false)); return false; } parent::display(); return $this; }
public function display($cachable = false, $urlparams = false) { // Redirect profile to integrated component if profile integration is turned on $redirect = 1; $active = $this->app->getMenu()->getActive(); if (!empty($active)) { $params = $active->params; $redirect = $params->get('integration', 1); } if ($redirect && JRequest::getCmd('format', 'html') == 'html') { $profileIntegration = KunenaFactory::getProfile(); $layout = JRequest::getCmd('layout', 'default'); if ($profileIntegration instanceof KunenaProfileKunena) { // Continue } elseif ($layout == 'default') { $url = $this->me->getUrl(false); } elseif ($layout == 'list') { $url = $profileIntegration->getUserListURL('', false); } if (!empty($url)) { $this->setRedirect($url); return; } } $layout = JRequest::getCmd('layout', 'default'); if ($layout == 'list') { if (KunenaFactory::getConfig()->userlist_allowed && JFactory::getUser()->guest) { $this->redirectBack(); } } parent::display(); }
function submissionsViewFile() { $lang = JFactory::getLanguage(); $lang->load('com_rsform', JPATH_ADMINISTRATOR); $hash = JRequest::getCmd('hash'); if (strlen($hash) != 32) { return $this->setRedirect('index.php'); } $config = JFactory::getConfig(); $secret = $config->getValue('config.secret'); $this->_db->setQuery("SELECT * FROM #__rsform_submission_values WHERE MD5(CONCAT(SubmissionId,'" . $this->_db->getEscaped($secret) . "',FieldName)) = '" . $hash . "'"); $result = $this->_db->loadObject(); // Not found if (empty($result)) { return $this->setRedirect('index.php'); } // Not an upload field $this->_db->setQuery("SELECT c.ComponentTypeId FROM #__rsform_properties p LEFT JOIN #__rsform_components c ON (p.ComponentId=c.ComponentId) WHERE p.PropertyName='NAME' AND p.PropertyValue='" . $this->_db->getEscaped($result->FieldName) . "'"); $type = $this->_db->loadResult(); if ($type != 9) { return $this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_UPLOAD')); } jimport('joomla.filesystem.file'); if (JFile::exists($result->FieldValue)) { RSFormProHelper::readFile($result->FieldValue); } $this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_FOUND')); }
/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/search.php'; // Load the submenu. SearchHelper::addSubmenu(JRequest::getCmd('view', 'searches')); parent::display(); }
/** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @return void * @since 1.6 */ protected function populateState($ordering = 'ordering', $direction = 'ASC') { $app = JFactory::getApplication(); // List state information //$value = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit')); $value = JRequest::getUInt('limit', $app->getCfg('list_limit', 0)); $this->setState('list.limit', $value); //$value = $app->getUserStateFromRequest($this->context.'.limitstart', 'limitstart', 0); $value = JRequest::getUInt('limitstart', 0); $this->setState('list.start', $value); $orderCol = JRequest::getCmd('filter_order', 'a.ordering'); if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'a.ordering'; } $this->setState('list.ordering', $orderCol); $listOrder = JRequest::getCmd('filter_order_Dir', 'ASC'); if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $params = $app->getParams(); $this->setState('params', $params); $user = JFactory::getUser(); $this->setState('layout', JRequest::getCmd('layout')); }
/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { JPluginHelper::importPlugin('content'); $vName = JRequest::getCmd('view', 'images'); switch ($vName) { case 'imagesList': $mName = 'list'; $vLayout = JRequest::getCmd('layout', 'default'); break; case 'images': default: $vLayout = JRequest::getCmd('layout', 'default'); $mName = 'manager'; $vName = 'images'; break; } $document = JFactory::getDocument(); $vType = $document->getType(); // Get/Create the view $view = $this->getView($vName, $vType); $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR . '/views/' . strtolower($vName) . '/tmpl'); // Get/Create the model if ($model = $this->getModel($mName)) { // Push the model into the view (as default) $view->setModel($model, true); } // Set the layout $view->setLayout($vLayout); // Display the view $view->display(); return $this; }
public function onContentPrepare($context, &$article, &$params, $limitstart) { $app = JFactory::getApplication(); /* @var $app JApplication */ // Do not render the buttons in administration area if ($app->isAdmin()) { return; } $doc = JFactory::getDocument(); /* @var $doc JDocumentHtml */ $docType = $doc->getType(); // Joomla! must render content of this plugin only in HTML document if (strcmp("html", $docType) != 0) { return; } $currentOption = JRequest::getCmd("option"); if ($currentOption != "com_content" or !isset($article) or empty($article->id) or !isset($this->params)) { return; } JPlugin::loadLanguage('plg_mvsocialbuttons'); $buttons = $this->getButtons($article); $position = $this->params->get('position'); switch ($position) { case 1: $article->text = $buttons . $article->text; break; case 2: $article->text = $article->text . $buttons; break; default: $article->text = $buttons . $article->text . $buttons; break; } return true; }
/** * Setting the toolbar */ protected function addToolBar() { JToolBarHelper::addNew('portfolio.add'); JToolBarHelper::editList('portfolio.edit'); JToolBarHelper::custom('portfolios.rebuild', 'refresh.png', 'refresh_f2.png', 'COM_BT_PORTFOLIO_PORTFOLIOS_REBUILD_IMAGES', false); JToolBarHelper::divider(); JToolBarHelper::title(JText::_('COM_BT_PORTFOLIO_PORTFOLIOS_MANAGER'), 'portfolio.png'); JToolBarHelper::publish('portfolios.publish', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::unpublish('portfolios.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolBarHelper::custom('portfolios.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true); JToolBarHelper::divider(); JToolBarHelper::checkin('portfolios.checkin'); JToolBarHelper::deleteList('', 'portfolios.delete'); JToolBarHelper::preferences('com_bt_portfolio'); $this->sidebar = ''; Bt_portfolioHelper::addSubmenu(JRequest::getCmd('view', 'cpanel')); //added since 2.0 for j3.0 if (!$this->legacy) { JHtmlSidebar::setAction('index.php?option=com_bt_portfolio&view=portfolios'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', Bt_portfolioHelper::getPublishedOptions(), 'value', 'text', $this->state->get('filter.published'), true)); JHtmlSidebar::addFilter(JText::_('COM_BT_PORTFOLIO_SELECT_FEATURED'), 'filter_featured', JHtml::_('select.options', Bt_portfolioHelper::getFeaturedOptions(), 'value', 'text', $this->state->get('filter.featured'), true)); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_catid', JHtml::_('select.options', Bt_portfolioHelper::getCategoryOptions(), 'value', 'text', $this->state->get('filter.catid'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))); $this->sidebar = JHtmlSidebar::render(); } }
function _displayForm($tpl) { $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $user = JFactory::getUser(); $model = $this->getModel(); //get the project $object =& $this->get('data'); $isNew = $object->id < 1; // fail if checked out not by 'me' if ($model->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_LEAGUE'), $object->name); $mainframe->redirect('index.php?option=' . $option, $msg); } // Edit or Create? if (!$isNew) { $model->checkout($user->get('id')); } else { // initialise new record $object->order = 0; } $extended = $this->getExtended($object->extended, 'league'); $this->assignRef('extended', $extended); $this->assignRef('object', $object); $this->assignRef('form', $this->get('form')); $this->assign('cfg_which_media_tool', JComponentHelper::getParams($option)->get('cfg_which_media_tool', 0)); $this->addToolbar(); parent::display($tpl); }
function _displayDefault($tpl) { $option = JRequest::getCmd('option'); $mainframe =& JFactory::getApplication(); $uri =& JFactory::getURI(); $cid = JRequest::getCmd('cid'); $match_id = $cid[0]; $model =& $this->getModel(); /* $filter_state = $mainframe->getUserStateFromRequest($option.'mc_filter_state', 'filter_state', '', 'word'); $filter_order = $mainframe->getUserStateFromRequest($option.'mc_filter_order', 'filter_order', 'mc.match_number', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option.'mc_filter_order_Dir','filter_order_Dir', '', 'word'); $search = $mainframe->getUserStateFromRequest($option.'mc_search', 'search', '', 'string'); $search_mode = $mainframe->getUserStateFromRequest($option.'mc_search_mode', 'search_mode', '', 'string'); $division = $mainframe->getUserStateFromRequest($option.'mc_division', 'division', '', 'string'); $project_id = $mainframe->getUserState( $option . 'project' ); $search = JString::strtolower($search); */ $matches =& $this->get('Data'); $total =& $this->get('Total'); $pagination =& $this->get('Pagination'); $match = $model->getMatchData($match_id); echo 'getModel<pre>' . print_r($model, true) . '</pre><br>'; $this->assignRef('homeplayer', $model->HomeTeamPlayer()); $this->assignRef('awayplayer', $model->AwayTeamPlayer()); $this->assignRef('matches', $matches); $this->assignRef('match', $match); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); $this->assignRef('request_url', $uri->toString()); parent::display($tpl); }
/** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @return void * @since 1.6 */ protected function populateState($ordering = 'ordering', $direction = 'ASC') { $app = JFactory::getApplication(); // List state information $value = JRequest::getUInt('limit', $app->getCfg('list_limit', 0)); $this->setState('list.limit', $value); $value = JRequest::getUInt('limitstart', 0); $this->setState('list.start', $value); $orderCol = JRequest::getCmd('filter_order', 'a.ordering'); if (!in_array($orderCol, $this->filter_fields)) { $orderCol = 'a.ordering'; } $this->setState('list.ordering', $orderCol); $listOrder = JRequest::getCmd('filter_order_Dir', 'ASC'); if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) { $listOrder = 'ASC'; } $this->setState('list.direction', $listOrder); $params = $app->getParams(); $this->setState('params', $params); $user = JFactory::getUser(); if (!$user->authorise('core.edit.state', 'com_content') && !$user->authorise('core.edit', 'com_content')) { // filter on published for those who do not have edit or edit.state rights. $this->setState('filter.published', 1); } $this->setState('filter.language', $app->getLanguageFilter()); // process show_noauth parameter if (!$params->get('show_noauth')) { $this->setState('filter.access', true); } else { $this->setState('filter.access', false); } $this->setState('layout', JRequest::getCmd('layout')); }
/** * display task * * @return void */ function display($cachable = false, $urlparams = array()) { // set default view if not set JRequest::setVar('view', JRequest::getCmd('view', 'websockets')); // call parent behavior parent::display($cachable, $urlparams); }
function display($tpl = null) { $mainframe = JFactory::getApplication(); $user = JFactory::getUser(); $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option . $view . '.limitstart', 'limitstart', 0, 'int'); $filter_order = $mainframe->getUserStateFromRequest($option . $view . 'filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . $view . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $model = $this->getModel(); $total = $model->getTotalGroups(); if ($limitstart > $total - $limit) { $limitstart = max(0, (int) (ceil($total / $limit) - 1) * $limit); JRequest::setVar('limitstart', $limitstart); } $extraFieldGroups = $model->getGroups(); $this->assignRef('rows', $extraFieldGroups); jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $this->assignRef('page', $pageNav); JToolBarHelper::title(JText::_('K2_EXTRA_FIELD_GROUPS'), 'k2.png'); JToolBarHelper::deleteList('', 'remove', 'K2_DELETE'); JToolBarHelper::editList(); JToolBarHelper::addNew(); if (K2_JVERSION != '15') { JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS'); } else { $toolbar = JToolBar::getInstance('toolbar'); $toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings'); } $this->loadHelper('html'); K2HelperHTML::subMenu(); parent::display($tpl); }
/** * Gets the URL arguments to append to an item redirect. * * @param integer $id The primary key id for the item. * @param string $url_var The name of the URL variable for the id. * * @return string The arguments to append to the redirect URL. */ protected function getRedirectToItemAppend($id = null, $url_var = 'id') { $tmpl = JRequest::getCmd('tmpl'); $layout = JRequest::getCmd('layout', 'edit'); $project = JRequest::getUint('filter_project', 0); $context = JRequest::getCmd('filter_context'); $item_id = JRequest::getUint('filter_item_id'); $append = ''; // Setup redirect info. if ($tmpl) { $append .= '&tmpl=' . $tmpl; } if ($layout) { $append .= '&layout=' . $layout; } if ($id) { $append .= '&' . $url_var . '=' . $id; } if ($project) { $append .= '&filter_project=' . $project; } if ($context) { $append .= '&filter_context=' . $context; } if ($item_id) { $append .= '&filter_item_id=' . $item_id; } return $append; }
/** * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/cache.php'; // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = JRequest::getCmd('view', 'cache'); $vFormat = $document->getType(); $lName = JRequest::getCmd('layout', 'default'); // Get and render the view. if ($view = $this->getView($vName, $vFormat)) { switch ($vName) { case 'purge': break; case 'cache': default: $model = $this->getModel($vName); $view->setModel($model, true); break; } $view->setLayout($lName); // Push document object into the view. $view->assignRef('document', $document); // Load the submenu. CacheHelper::addSubmenu(JRequest::getCmd('view', 'cache')); $view->display(); } }
function display() { if (!JRequest::getCmd('view')) { JRequest::setVar('view', 'comment'); } parent::display(); }
public function display($cachable = false, $urlparams = false) { JRequest::setVar('view', JRequest::getCmd('view', 'Orphans')); if (isset($_POST['_orphanaction']) && $_POST['_orphanaction'] == "zipIt") { $file = tempnam("tmp", "zip"); $zip = new ZipArchive(); $zip->open($file, ZipArchive::OVERWRITE); foreach ($_POST['tozip'] as $_file) { $zip->addFile(JPATH_ROOT . "/" . $_file, $_file); } $zip->close(); header('Content-Type: application/zip'); header('Content-Length: ' . filesize($file)); header('Content-Disposition: attachment; filename="orphans.zip"'); readfile($file); unlink($file); die; } else { if (isset($_POST['_orphanaction']) && $_POST['_orphanaction'] == "delete" && isset($_POST['_confirmAction'])) { foreach ($_POST['tozip'] as $_file) { unlink(JPATH_ROOT . "/" . $_file); } } } // call parent behavior parent::display($cachable); }
/** * 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); }
function save() { $mainframe = JFactory::getApplication(); $row = JTable::getInstance('K2Tag', 'Table'); if (!$row->bind(JRequest::get('post'))) { $mainframe->enqueueMessage($row->getError(), 'error'); $mainframe->redirect('index.php?option=com_k2&view=tags'); } if (!$row->check()) { $mainframe->enqueueMessage($row->getError(), 'error'); $mainframe->redirect('index.php?option=com_k2&view=tag&cid=' . $row->id); } if (!$row->store()) { $mainframe->enqueueMessage($row->getError(), 'error'); $mainframe->redirect('index.php?option=com_k2&view=tags'); } $cache = JFactory::getCache('com_k2'); $cache->clean(); switch (JRequest::getCmd('task')) { case 'apply': $msg = JText::_('K2_CHANGES_TO_TAG_SAVED'); $link = 'index.php?option=com_k2&view=tag&cid=' . $row->id; break; case 'save': default: $msg = JText::_('K2_TAG_SAVED'); $link = 'index.php?option=com_k2&view=tags'; break; } $mainframe->enqueueMessage($msg); $mainframe->redirect($link); }
function display($tmpl = 'default') { require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php'; $model = $this->getModel(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))); $model->setId($id); $this->assign('id', $id); $this->assignRef('row', $this->get('Visualization')); $this->assign('rows', $this->get('Rows')); $this->assign('containerId', $this->get('ContainerId')); $this->calName = $this->get('VizName'); $this->assignRef('params', $this->get('PluginParams')); $tmpl = $this->params->get('approvals_layout', $tmpl); $tmplpath = JPATH_SITE . DS . 'plugins' . DS . 'fabrik_visualization' . DS . 'approvals' . DS . 'views' . DS . 'approvals' . DS . 'tmpl' . DS . $tmpl; $this->_setPath('template', $tmplpath); $ab_css_file = $tmplpath . DS . "template.css"; if (file_exists($ab_css_file)) { JHTML::stylesheet('/plugins/fabrik_visualization/approvals/views/approvals/tmpl/' . $tmpl . '/template.css'); } FabrikHelperHTML::script('plugins/fabrik_visualization/approvals/approvals.js', true, "var approvals = new fbVisApprovals('approvals_" . $id . "');"); $text = $this->loadTemplate(); $opt = JRequest::getVar('option'); $view = JRequest::getCmd('view'); JRequest::setVar('view', 'article'); JRequest::setVar('option', 'com_content'); jimport('joomla.html.html.content'); $text .= '{emailcloak=off}'; $text = JHTML::_('content.prepare', $text); $text = preg_replace('/\\{emailcloak\\=off\\}/', '', $text); JRequest::setVar('option', $opt); echo $text; }
/** * Method to display the view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = JRequest::getCmd('view', 'application'); $vFormat = $document->getType(); $lName = JRequest::getCmd('layout', 'default'); // Get and render the view. if ($view = $this->getView($vName, $vFormat)) { if ($vName != 'close') { // Get the model for the view. $model = $this->getModel($vName); // Access check. if (!JFactory::getUser()->authorise('core.admin', $model->getState('component.option'))) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } // Push the model into the view (as default). $view->setModel($model, true); } $view->setLayout($lName); // Push document object into the view. $view->assignRef('document', $document); $view->display(); } }
function getRequestParams() { $params = new stdClass(); $params->option = JRequest::getCmd('option'); $params->view = JRequest::getCmd('view'); $params->task = JRequest::getCmd('task'); $params->id = JRequest::getInt('id'); $params->Itemid = JRequest::getInt('Itemid'); switch ($params->option) { case 'com_categories': $params->option = 'com_content'; $params->view = 'category'; break; case 'com_sections': $params->option = 'com_content'; $params->view = 'section'; break; case 'com_mr': $params->item_id = JRequest::getInt('article'); $params->category_id = JRequest::getInt('category_id'); $params->id = $params->item_id ? $params->item_id : $params->category_id; break; case 'com_zoo': $params->item_id = JRequest::getInt('item_id'); $params->category_id = JRequest::getInt('category_id'); $params->id = $params->item_id ? $params->item_id : $params->category_id; break; } if (!$params->id) { $cid = JRequest::getVar('cid', array(0), 'method', 'array'); $cid = array((int) $cid['0']); $params->id = $cid['0']; } return $params; }
function process() { if (!$this->isAllowed('lists', 'filter')) { return; } JRequest::checkToken() or die('Invalid Token'); $filid = JRequest::getInt('filid'); if (!empty($filid)) { $this->store(); } $filterClass = acymailing_get('class.filter'); $filterClass->subid = JRequest::getString('subid'); $filterClass->execute(JRequest::getVar('filter'), JRequest::getVar('action')); if (!empty($filterClass->report)) { if (JRequest::getCmd('tmpl') == 'component') { echo acymailing_display($filterClass->report, 'info'); $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = 'index.php?option=com_acymailing&ctrl=subscriber'; }"; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); return; } else { $app = JFactory::getApplication(); foreach ($filterClass->report as $oneReport) { $app->enqueueMessage($oneReport); } } } return $this->edit(); }
protected function getInput() { $document = JFactory::getDocument(); $option = JRequest::getCmd('option'); $globalValue = $this->_getPhocaParams($this->element['name']); // Initialize some field attributes. $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : ''; $readonly = (string) $this->element['readonly'] == 'true' ? ' readonly="readonly"' : ''; $disabled = (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : ''; // Initialize JavaScript field attributes. $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; $value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'); // TODO 1.6 // MENU - Set Default value to "" because of saving "" value into the menu link ( use global = "") if ($option == "com_menus") { $DefaultValue = (string) $this->element['default']; if ($value == $DefaultValue) { $value = ''; } } $html = '<input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . $value . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . '/>'; // MENU - Display the global value if ($option == "com_menus") { $html .= '<span style="margin-left:10px;">[</span><span style="background:#fff;"> ' . $globalValue . ' </span><span>]</span>'; } return $html; }
function load() { $this->values = array(); if (JRequest::getCmd('from_display', false) == false) { $this->values[] = JHTML::_('select.option', '', JText::_('HIKA_INHERIT')); } $this->values[] = JHTML::_('select.optgroup', '-- ' . JText::_('FROM_HIKASHOP') . ' --'); foreach ($this->default as $d) { $this->values[] = JHTML::_('select.option', $d, JText::_(strtoupper($d))); } if (version_compare(JVERSION, '1.6.0', '>=')) { $this->values[] = JHTML::_('select.optgroup', '-- ' . JText::_('FROM_HIKASHOP') . ' --'); } $closeOpt = ''; $values = $this->getLayout(); foreach ($values as $value) { if (substr($value, 0, 1) == '#') { if (version_compare(JVERSION, '1.6.0', '>=') && !empty($closeOpt)) { $this->values[] = JHTML::_('select.optgroup', $closeOpt); } $value = substr($value, 1); $closeOpt = '-- ' . JText::sprintf('FROM_TEMPLATE', basename($value)) . ' --'; $this->values[] = JHTML::_('select.optgroup', $closeOpt); } else { $this->values[] = JHTML::_('select.option', $value, $value); } } if (version_compare(JVERSION, '1.6.0', '>=') && !empty($closeOpt)) { $this->values[] = JHTML::_('select.optgroup', $closeOpt); } }
/** * Gets the URL arguments to append to an item redirect. * * @param int $id The primary key id for the item. * @param string $url_var The name of the URL variable for the id. * * @return string The arguments to append to the redirect URL. */ protected function getRedirectToItemAppend($id = null, $url_var = 'id') { // Need to override the parent method completely. $tmpl = JRequest::getCmd('tmpl'); $layout = JRequest::getCmd('layout'); $item_id = JRequest::getInt('Itemid'); $return = $this->getReturnPage(); $append = ''; // Setup redirect info. if ($tmpl) { $append .= '&tmpl=' . $tmpl; } if ($layout) { $append .= '&layout=' . $layout; } if ($id) { $append .= '&' . $id . '=' . $id; } if ($item_id) { $append .= '&Itemid=' . $item_id; } if ($return) { $append .= '&return=' . base64_encode($return); } return $append; }