/** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed False if unsuccessful, otherwise void. * * @since 1.6 */ public function display($tpl = null) { // Set variables $app = JFactory::getApplication(); $this->enabled = RedirectHelper::isEnabled(); $this->collect_urls_enabled = RedirectHelper::collectUrlsEnabled(); $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; } // Show messages about the enabled plugin and if the plugin should collect URLs if ($this->enabled && $this->collect_urls_enabled) { $app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . ' ' . JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'), 'notice'); } elseif ($this->enabled && !$this->collect_urls_enabled) { $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); $app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . JText::sprintf('COM_REDIRECT_COLLECT_URLS_DISABLED', $link), 'notice'); } else { $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); $app->enqueueMessage(JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', $link), 'error'); } $this->addToolbar(); parent::display($tpl); }
/** * Setup the Toolbar */ protected function _setToolbar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $canDo = RedirectHelper::getActions(); JToolBarHelper::title(JText::_('Redir_Manager_Link')); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolBarHelper::apply('link.apply', 'JToolbar_Apply'); JToolBarHelper::save('link.save', 'JToolbar_Save'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::custom('link.save2copy§', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false); } if ($canDo->get('core.edit') && $canDo->get('core.create')) { JToolBarHelper::addNew('link.save2new', 'JToolbar_Save_and_new'); } if (empty($this->item->id)) { JToolBarHelper::cancel('link.cancel', 'JToolbar_Cancel'); } else { JToolBarHelper::cancel('link.cancel', 'JToolbar_Close'); } JToolBarHelper::help('screen.redirect.link'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $canDo = RedirectHelper::getActions(); JToolBarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINK'), 'redirect'); // If not checked out, can save the item. if ($canDo->get('core.edit')) { JToolBarHelper::apply('link.apply'); JToolBarHelper::save('link.save'); } // This component does not support Save as Copy due to uniqueness checks. // While it can be done, it causes too much confusion if the user does // not change the Old URL. if ($canDo->get('core.edit') && $canDo->get('core.create')) { JToolBarHelper::save2new('link.save2new'); } if (empty($this->item->id)) { JToolBarHelper::cancel('link.cancel'); } else { JToolBarHelper::cancel('link.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER_EDIT'); }
/** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed False if unsuccessful, otherwise void. * * @since 1.6 */ public function display($tpl = null) { $this->enabled = RedirectHelper::isEnabled(); $this->collect_urls_enabled = RedirectHelper::collectUrlsEnabled(); $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; } if ($this->enabled) { if ($this->collect_urls_enabled) { JFactory::getApplication()->enqueueMessage(JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'), 'notice'); } else { JFactory::getApplication()->enqueueMessage(JText::_('COM_REDIRECT_COLLECT_URLS_DISABLED'), 'warning'); } } else { JFactory::getApplication()->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_DISABLED'), 'error'); } $this->addToolbar(); parent::display($tpl); }
/** * Gera url atual * @return string retorna a url até a parte da pagina */ public function getUrl() { $redir = new RedirectHelper(); $url = URL . $redir->getCurrentController() . "/" . $redir->getCurrentAction() . "/" . $redir->getUrlParams(true); // RETIRA A ULTIMA BARRA CASO EXISTA if ($url[strlen($url) - 1] == "/") { $url = substr($url, 0, -1); } // DIVIDE A URL $paramns2 = explode("/", $url); //RETIRA A PAGINA DA URL if (substr(end($paramns2), 0, 3) == "pag") { array_pop($paramns2); } //JUNTA O ARRAY EM UMA STRING E RETORNA O RESULTADO return implode("/", $paramns2); }
public function render() { if (!$this->flash) { RedirectHelper::to($this->next); } else { RedirectHelper::flash($this->next, $this->flash['key'], $this->flash['value']); } }
/** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached. * @param mixed $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JControllerLegacy This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { JLoader::register('RedirectHelper', JPATH_ADMINISTRATOR . '/components/com_redirect/helpers/redirect.php'); // Load the submenu. RedirectHelper::addSubmenu($this->input->get('view', 'links')); $view = $this->input->get('view', 'links'); $layout = $this->input->get('layout', 'default'); $id = $this->input->getInt('id'); // Check for edit form. if ($view == 'link' && $layout == 'edit' && !$this->checkEditId('com_redirect.edit.link', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false)); return false; } parent::display(); }
/** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed False if unsuccessful, otherwise void. * * @since 1.6 */ public function display($tpl = null) { $this->enabled = RedirectHelper::isEnabled(); $this->collect_urls_enabled = RedirectHelper::collectUrlsEnabled(); $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; } $this->addToolbar(); parent::display($tpl); }
/** * 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/redirect.php'; // Load the submenu. RedirectHelper::addSubmenu(JRequest::getCmd('view', 'links')); $view = JRequest::getCmd('view', 'links'); $layout = JRequest::getCmd('layout', 'default'); $id = JRequest::getInt('id'); // Check for edit form. if ($view == 'link' && $layout == 'edit' && !$this->checkEditId('com_redirect.edit.link', $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_redirect&view=links', false)); return false; } parent::display(); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = RedirectHelper::getActions(); JToolBarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'redirect'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('link.add'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('link.edit'); } if ($canDo->get('core.edit.state')) { if ($state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true); JToolBarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true); } if ($state->get('filter.state') != -1) { JToolBarHelper::divider(); if ($state->get('filter.state') != 2) { JToolBarHelper::archiveList('links.archive'); } else { if ($state->get('filter.state') == 2) { JToolBarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE'); } } } } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH'); } else { if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('links.trash'); JToolBarHelper::divider(); } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_redirect'); JToolBarHelper::divider(); } JToolBarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER'); }
/** * Method to display a view. */ public function display() { require_once JPATH_COMPONENT . '/helpers/redirect.php'; // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = JRequest::getWord('view', 'links'); $vFormat = $document->getType(); $lName = JRequest::getWord('layout', 'default'); // Get and render the view. if ($view =& $this->getView($vName, $vFormat)) { // Get the model for the view. $model =& $this->getModel($vName); // 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(); // Load the submenu. RedirectHelper::addSubmenu($vName); } }
$value = stripslashes($value); } $gpc = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); array_walk_recursive($gpc, 'undo_magic_quotes'); } $plugin_manager = PluginManager::getInstance(); $url_mapper = new UrlMapper(); $context = $url_mapper->map($_SERVER['REQUEST_URI']); if (!$context) { header("HTTP/1.1 400 Bad Request"); @(include PHAXSI_ERROR_400); exit; } if (AppConfig::$language_redirect && !Lang::wasSet()) { $lang = Lang::autoDetect(); RedirectHelper::to(UrlHelper::current($lang)); } if (AppConfig::CUSTOM_ROUTER) { $router_name = Loader::includeApplicationClass(new Context('router', AppConfig::CUSTOM_ROUTER)); if ($router_name) { $router = new $router_name(); } else { trigger_error('Custom router "' . AppConfig::CUSTOM_ROUTER . '" was not found', E_USER_ERROR); } } else { $router = new Router(); } $controller = $router->getController($context); if (!$controller) { header("HTTP/1.1 404 Not Found"); @(include PHAXSI_ERROR_404);
echo JText::_('JSEARCH_FILTER_SUBMIT'); ?> </button> <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?> </button> </div> <div class="filter-select fltrt"> <select name="filter_state" class="inputbox" onchange="this.form.submit()"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?> </option> <?php echo JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true); ?> </select> </div> </fieldset> <div class="clr"> </div> <table class="adminlist"> <thead> <tr> <th width="20"> <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?> " onclick="Joomla.checkAll(this)" /> </th>
/** *@OdinAuth */ public function gtfo() { AuthHelper::logout(); SessionHelper::setSystemSession('msg', 'You are not logged anymore.'); RedirectHelper::goToController("TestAuthentication"); }
/** * Calls controller for page not found(404 error) * * @access public * @author Renie Siqueira da Silva * @since 1.0 * @return void */ public function dispatch404($throwError) { if (!$throwError) { RedirectHelper::goToController(DEFAULT404ERRORCONTROLLER); } else { header(':', true, 404); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = RedirectHelper::getActions(); JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'redirect'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('link.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('link.edit'); } if ($canDo->get('core.edit.state')) { if ($state->get('filter.state') != 2) { JToolbarHelper::divider(); JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true); JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true); } if ($state->get('filter.state') != -1) { JToolbarHelper::divider(); if ($state->get('filter.state') != 2) { JToolbarHelper::archiveList('links.archive'); } elseif ($state->get('filter.state') == 2) { JToolbarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE'); } } } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolbarHelper::divider(); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('links.trash'); JToolbarHelper::divider(); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_redirect'); JToolbarHelper::divider(); } JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER'); JHtmlSidebar::setAction('index.php?option=com_redirect&view=links'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true)); }
/** * Add the page title and toolbar. * * @return void. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = JHelperContent::getActions('com_redirect'); JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'refresh redirect'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('link.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('link.edit'); } if ($canDo->get('core.edit.state')) { if ($state->get('filter.state') != 2) { JToolbarHelper::divider(); JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true); JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true); } if ($state->get('filter.state') != -1) { JToolbarHelper::divider(); if ($state->get('filter.state') != 2) { JToolbarHelper::archiveList('links.archive'); } elseif ($state->get('filter.state') == 2) { JToolbarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE'); } } } if ($canDo->get('core.create')) { // Get the toolbar object instance $bar = JToolbar::getInstance('toolbar'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolbarHelper::divider(); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('links.trash'); JToolbarHelper::divider(); } if ($canDo->get('core.admin') || $canDo->get('core.options')) { JToolbarHelper::preferences('com_redirect'); JToolbarHelper::divider(); } JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER'); JHtmlSidebar::setAction('index.php?option=com_redirect&view=links'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true)); }
private function loginRedirect() { if ($this->requested_module != $this->config['module_name']) { RedirectHelper::flash($this->config['module_name'] . '/' . $this->config['login_action'], 'next', UrlHelper::current('', false)); } else { RedirectHelper::to('/'); } }
public static function goToIndex() { RedirectHelper::goToController(DEFAULTCONTROLLER); }
/** * Calls controller for page not found(404 error) * * @access public * @author Renie Siqueira da Silva * @since 1.0 * @return void */ public function dispatch404() { RedirectHelper::goToController(DEFAULT404ERRORCONTROLLER); }
private function handleParserError($message, $file, $line) { if (AppConfig::DEBUG_MODE) { $this->show("{$message} ({$file} on line {$line})"); } else { $this->log("{$message} ({$file} on line {$line})", E_ERROR); RedirectHelper::force('/phaxsi/error/500'); } exit; }
public static function controllerAction($controller, $action) { $redir = new RedirectHelper(); $redir->goToControllerAction($controller, $action); }
public function goToGoogle() { RedirectHelper::goToUrl("http://www.google.com.br"); }
final function validateOrRedirect($url = null) { if (!$url) { $url = UrlHelper::referer(); } if (!$url) { $url = '/'; } if (!$this->validate()) { RedirectHelper::flash($url, $this->getId(), $this->getFlashParams()); } }