Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/com_redirect.tar
Назад
layouts/toolbar/batch.php 0000604 00000001051 15245570553 0011504 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage Layout * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.core'); $title = $displayData['title']; ?> <button type="button" data-toggle="modal" onclick="{jQuery( '#collapseModal' ).modal('show'); return true;}" class="btn btn-small"> <span class="icon-checkbox-partial" aria-hidden="true"></span> <?php echo $title; ?> </button> tables/link.php 0000604 00000005407 15245570553 0007501 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Link Table for Redirect. * * @since 1.6 */ class RedirectTableLink extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database object. * * @since 1.6 */ public function __construct($db) { parent::__construct('#__redirect_links', 'id', $db); } /** * Overloaded check function * * @return boolean * * @since 1.6 */ public function check() { $this->old_url = trim(rawurldecode($this->old_url)); $this->new_url = trim(rawurldecode($this->new_url)); // Check for valid name. if (empty($this->old_url)) { $this->setError(JText::_('COM_REDIRECT_ERROR_SOURCE_URL_REQUIRED')); return false; } // Check for NOT NULL. if (empty($this->referer)) { $this->referer = ''; } // Check for valid name if not in advanced mode. if (empty($this->new_url) && JComponentHelper::getParams('com_redirect')->get('mode', 0) == false) { $this->setError(JText::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED')); return false; } elseif (empty($this->new_url) && JComponentHelper::getParams('com_redirect')->get('mode', 0) == true) { // Else if an empty URL and in redirect mode only throw the same error if the code is a 3xx status code if ($this->header < 400 && $this->header >= 300) { $this->setError(JText::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED')); return false; } } // Check for duplicates if ($this->old_url == $this->new_url) { $this->setError(JText::_('COM_REDIRECT_ERROR_DUPLICATE_URLS')); return false; } $db = $this->getDbo(); // Check for existing name $query = $db->getQuery(true) ->select($db->quoteName('id')) ->select($db->quoteName('old_url')) ->from('#__redirect_links') ->where($db->quoteName('old_url') . ' = ' . $db->quote($this->old_url)); $db->setQuery($query); $urls = $db->loadAssocList(); foreach ($urls as $url) { if ($url['old_url'] === $this->old_url && (int) $url['id'] != (int) $this->id) { $this->setError(JText::_('COM_REDIRECT_ERROR_DUPLICATE_OLD_URL')); return false; } } return true; } /** * Overriden store method to set dates. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 1.6 */ public function store($updateNulls = false) { $date = JFactory::getDate()->toSql(); $this->modified_date = $date; if (!$this->id) { // New record. $this->created_date = $date; } return parent::store($updateNulls); } } helpers/html/redirect.php 0000604 00000003477 15245570553 0011506 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Utilities\ArrayHelper; /** * Utility class for creating HTML Grids. * * @since 1.6 */ class JHtmlRedirect { /** * Display the published or unpublished state of an item. * * @param int $value The state value. * @param int $i The ID of the item. * @param boolean $canChange An optional prefix for the task. * * @return string * * @since 1.6 * * @throws InvalidArgumentException */ public static function published($value = 0, $i = null, $canChange = true) { // Note: $i is required but has to be an optional argument in the function call due to argument order if (null === $i) { throw new InvalidArgumentException('$i is a required argument in JHtmlRedirect::published'); } // Array of image, task, title, action $states = array( 1 => array('publish', 'links.unpublish', 'JENABLED', 'COM_REDIRECT_DISABLE_LINK'), 0 => array('unpublish', 'links.publish', 'JDISABLED', 'COM_REDIRECT_ENABLE_LINK'), 2 => array('archive', 'links.unpublish', 'JARCHIVED', 'JUNARCHIVE'), -2 => array('trash', 'links.publish', 'JTRASHED', 'COM_REDIRECT_ENABLE_LINK'), ); $state = ArrayHelper::getValue($states, (int) $value, $states[0]); $icon = $state[0]; if ($canChange) { $html = '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" class="btn btn-micro hasTooltip' . ($value == 1 ? ' active' : '') . '" title="' . JHtml::_('tooltipText', $state[3]) . '"><span class="icon-' . $icon . '" aria-hidden="true"></span></a>'; } return $html; } } helpers/redirect.php 0000604 00000005566 15245570553 0010543 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Registry\Registry; /** * Redirect component helper. * * @since 1.6 */ class RedirectHelper { public static $extension = 'com_redirect'; /** * Configure the Linkbar. * * @param string $vName The name of the active view. * * @return void * * @since 1.6 */ public static function addSubmenu($vName) { // No submenu for this component. } /** * Gets a list of the actions that can be performed. * * @return JObject * * @deprecated 3.2 Use JHelperContent::getActions() instead */ public static function getActions() { // Log usage of deprecated function try { JLog::add( sprintf('%s() is deprecated. Use JHelperContent::getActions() with new arguments order instead.', __METHOD__), JLog::WARNING, 'deprecated' ); } catch (RuntimeException $exception) { // Informational log only } // Get list of actions return JHelperContent::getActions('com_redirect'); } /** * Returns an array of standard published state filter options. * * @return array An array containing the options * * @since 1.6 */ public static function publishedOptions() { // Build the active state filter options. $options = array(); $options[] = JHtml::_('select.option', '*', 'JALL'); $options[] = JHtml::_('select.option', '1', 'JENABLED'); $options[] = JHtml::_('select.option', '0', 'JDISABLED'); $options[] = JHtml::_('select.option', '2', 'JARCHIVED'); $options[] = JHtml::_('select.option', '-2', 'JTRASHED'); return $options; } /** * Gets the redirect system plugin extension id. * * @return integer The redirect system plugin extension id. * * @since 3.6.0 */ public static function getRedirectPluginId() { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('extension_id')) ->from($db->quoteName('#__extensions')) ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) ->where($db->quoteName('element') . ' = ' . $db->quote('redirect')); $db->setQuery($query); try { $result = (int) $db->loadResult(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); } return $result; } /** * Checks whether the option "Collect URLs" is enabled for the output message * * @return boolean * * @since 3.4 */ public static function collectUrlsEnabled() { $collect_urls = false; if (JPluginHelper::isEnabled('system', 'redirect')) { $params = new Registry(JPluginHelper::getPlugin('system', 'redirect')->params); $collect_urls = (bool) $params->get('collect_urls', 1); } return $collect_urls; } } models/link.php 0000604 00000014042 15245570553 0007505 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Utilities\ArrayHelper; /** * Redirect link model. * * @since 1.6 */ class RedirectModelLink extends JModelAdmin { /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_REDIRECT'; /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. * * @since 1.6 */ protected function canDelete($record) { if ($record->published != -2) { return false; } return parent::canDelete($record); } /** * Returns a reference to the a Table object, always creating it. * * @param string $type The table type to instantiate * @param string $prefix A prefix for the table class name. Optional. * @param array $config Configuration array for model. Optional. * * @return JTable A database object * * @since 1.6 */ public function getTable($type = 'Link', $prefix = 'RedirectTable', $config = array()) { return JTable::getInstance($type, $prefix, $config); } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return JForm A JForm object on success, false on failure * * @since 1.6 */ public function getForm($data = array(), $loadData = true) { // Get the form. $form = $this->loadForm('com_redirect.link', 'link', array('control' => 'jform', 'load_data' => $loadData)); if (empty($form)) { return false; } // Modify the form based on access controls. if ($this->canEditState((object) $data) != true) { // Disable fields for display. $form->setFieldAttribute('published', 'disabled', 'true'); // Disable fields while saving. // The controller has already verified this is a record you can edit. $form->setFieldAttribute('published', 'filter', 'unset'); } // If in advanced mode then we make sure the new URL field is not compulsory and the header // field compulsory in case people select non-3xx redirects if (JComponentHelper::getParams('com_redirect')->get('mode', 0) == true) { $form->setFieldAttribute('new_url', 'required', 'false'); $form->setFieldAttribute('header', 'required', 'true'); } return $form; } /** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * * @since 1.6 */ protected function loadFormData() { // Check the session for previously entered form data. $data = JFactory::getApplication()->getUserState('com_redirect.edit.link.data', array()); if (empty($data)) { $data = $this->getItem(); } $this->preprocessData('com_redirect.link', $data); return $data; } /** * Method to activate links. * * @param array &$pks An array of link ids. * @param string $url The new URL to set for the redirect. * @param string $comment A comment for the redirect links. * * @return boolean Returns true on success, false on failure. * * @since 1.6 */ public function activate(&$pks, $url, $comment = null) { $user = JFactory::getUser(); $db = $this->getDbo(); // Sanitize the ids. $pks = (array) $pks; $pks = ArrayHelper::toInteger($pks); // Populate default comment if necessary. $comment = (!empty($comment)) ? $comment : JText::sprintf('COM_REDIRECT_REDIRECTED_ON', JHtml::_('date', time())); // Access checks. if (!$user->authorise('core.edit', 'com_redirect')) { $pks = array(); $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); return false; } if (!empty($pks)) { // Update the link rows. $query = $db->getQuery(true) ->update($db->quoteName('#__redirect_links')) ->set($db->quoteName('new_url') . ' = ' . $db->quote($url)) ->set($db->quoteName('published') . ' = ' . (int) 1) ->set($db->quoteName('comment') . ' = ' . $db->quote($comment)) ->where($db->quoteName('id') . ' IN (' . implode(',', $pks) . ')'); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } } return true; } /** * Method to batch update URLs to have new redirect urls and comments. Note will publish any unpublished URLs. * * @param array &$pks An array of link ids. * @param string $url The new URL to set for the redirect. * @param string $comment A comment for the redirect links. * * @return boolean Returns true on success, false on failure. * * @since 3.6.0 */ public function duplicateUrls(&$pks, $url, $comment = null) { $user = JFactory::getUser(); $db = $this->getDbo(); // Sanitize the ids. $pks = (array) $pks; $pks = ArrayHelper::toInteger($pks); // Access checks. if (!$user->authorise('core.edit', 'com_redirect')) { $pks = array(); $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); return false; } if (!empty($pks)) { $date = JFactory::getDate()->toSql(); // Update the link rows. $query = $db->getQuery(true) ->update($db->quoteName('#__redirect_links')) ->set($db->quoteName('new_url') . ' = ' . $db->quote($url)) ->set($db->quoteName('modified_date') . ' = ' . $db->quote($date)) ->set($db->quoteName('published') . ' = ' . 1) ->where($db->quoteName('id') . ' IN (' . implode(',', $pks) . ')'); if (!empty($comment)) { $query->set($db->quoteName('comment') . ' = ' . $db->quote($comment)); } $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } } return true; } } models/forms/link.xml 0000604 00000004021 15245570553 0010640 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <form> <fieldset> <field name="id" type="number" label="JGLOBAL_FIELD_ID_LABEL" description="JGLOBAL_FIELD_ID_DESC" id="id" default="0" readonly="true" class="readonly" /> <field name="old_url" type="text" label="COM_REDIRECT_FIELD_OLD_URL_LABEL" description="COM_REDIRECT_FIELD_OLD_URL_DESC" class="input-xxlarge" size="50" required="true" /> <field name="new_url" type="text" label="COM_REDIRECT_FIELD_NEW_URL_LABEL" description="COM_REDIRECT_FIELD_NEW_URL_DESC" class="input-xxlarge" size="50" required="true" /> <field name="comment" type="text" label="COM_REDIRECT_FIELD_COMMENT_LABEL" description="COM_REDIRECT_FIELD_COMMENT_DESC" size="40" /> <field name="published" type="list" label="JSTATUS" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" size="1" default="1" > <option value="1">JENABLED</option> <option value="0">JDISABLED</option> <option value="2">JARCHIVED</option> <option value="-2">JTRASHED</option> </field> <field name="referer" type="text" label="COM_REDIRECT_FIELD_REFERRER_LABEL" id="referer" size="50" readonly="true" /> <field name="created_date" type="text" label="COM_REDIRECT_FIELD_CREATED_DATE_LABEL" id="created_date" class="readonly" size="20" readonly="true" /> <field name="modified_date" type="text" label="COM_REDIRECT_FIELD_UPDATED_DATE_LABEL" id="modified_date" class="readonly" size="20" readonly="true" /> <field name="hits" type="number" label="JGLOBAL_HITS" id="hits" class="readonly" size="20" readonly="true" filter="unset" /> </fieldset> <fieldset name="advanced"> <field name="header" type="redirect" label="COM_REDIRECT_FIELD_REDIRECT_STATUS_CODE_LABEL" description="COM_REDIRECT_FIELD_REDIRECT_STATUS_CODE_DESC" default="301" validate="options" class="input-xlarge" /> </fieldset> </form> models/forms/filter_links.xml 0000604 00000004565 15245570553 0012405 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <form> <fields name="filter"> <field name="search" type="text" inputmode="search" label="COM_REDIRECT_FILTER_SEARCH_LABEL" description="COM_REDIRECT_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> <field name="state" type="redirect_status" label="COM_REDIRECT_FILTER_PUBLISHED" description="COM_REDIRECT_FILTER_PUBLISHED_DESC" onchange="this.form.submit();" > <option value="">JOPTION_SELECT_PUBLISHED</option> </field> <field name="http_status" type="Redirect" label="COM_REDIRECT_FILTER_HTTP_HEADER_LABEL" description="COM_REDIRECT_FILTER_HTTP_HEADER_DESC" onchange="this.form.submit();" > <option value="">COM_REDIRECT_FILTER_SELECT_OPTION_HTTP_HEADER</option> </field> </fields> <fields name="list"> <field name="fullordering" type="list" label="JGLOBAL_SORT_BY" description="JGLOBAL_SORT_BY" onchange="this.form.submit();" default="a.old_url ASC" validate="options" > <option value="">JGLOBAL_SORT_BY</option> <option value="a.published ASC">JSTATUS_ASC</option> <option value="a.published DESC">JSTATUS_DESC</option> <option value="a.old_url ASC">COM_REDIRECT_HEADING_OLD_URL_ASC</option> <option value="a.old_url DESC">COM_REDIRECT_HEADING_OLD_URL_DESC</option> <option value="a.new_url ASC">COM_REDIRECT_HEADING_NEW_URL_ASC</option> <option value="a.new_url DESC">COM_REDIRECT_HEADING_NEW_URL_DESC</option> <option value="a.referer ASC">COM_REDIRECT_HEADING_REFERRER_ASC</option> <option value="a.referer DESC">COM_REDIRECT_HEADING_REFERRER_DESC</option> <option value="a.created_date ASC">COM_REDIRECT_HEADING_CREATED_DATE_ASC</option> <option value="a.created_date DESC">COM_REDIRECT_HEADING_CREATED_DATE_DESC</option> <option value="a.hits ASC">COM_REDIRECT_HEADING_HITS_ASC</option> <option value="a.hits DESC">COM_REDIRECT_HEADING_HITS_DESC</option> <option value="a.header ASC">COM_REDIRECT_HEADING_STATUS_CODE_ASC</option> <option value="a.header DESC">COM_REDIRECT_HEADING_STATUS_CODE_DESC</option> <option value="a.id ASC">JGRID_HEADING_ID_ASC</option> <option value="a.id DESC">JGRID_HEADING_ID_DESC</option> </field> <field name="limit" type="limitbox" label="JGLOBAL_LIMIT" description="JGLOBAL_LIMIT" class="input-mini" default="5" onchange="this.form.submit();" /> </fields> </form> models/links.php 0000604 00000013556 15245570553 0007701 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Methods supporting a list of redirect links. * * @since 1.6 */ class RedirectModelLinks extends JModelList { /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @since 1.6 */ public function __construct($config = array()) { if (empty($config['filter_fields'])) { $config['filter_fields'] = array( 'id', 'a.id', 'state', 'a.state', 'old_url', 'a.old_url', 'new_url', 'a.new_url', 'referer', 'a.referer', 'hits', 'a.hits', 'created_date', 'a.created_date', 'published', 'a.published', 'header', 'a.header', 'http_status', ); } parent::__construct($config); } /** * Removes all of the unpublished redirects from the table. * * @return boolean result of operation * * @since 3.5 */ public function purge() { $db = $this->getDbo(); $query = $db->getQuery(true); $query->delete('#__redirect_links')->where($db->qn('published') . '= 0'); $db->setQuery($query); try { $db->execute(); } catch (Exception $e) { return false; } return true; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 1.6 */ protected function populateState($ordering = 'a.old_url', $direction = 'asc') { // Load the filter state. $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string')); $this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string')); $this->setState('filter.http_status', $this->getUserStateFromRequest($this->context . '.filter.http_status', 'filter_http_status', '', 'cmd')); // Load the parameters. $params = JComponentHelper::getParams('com_redirect'); $this->setState('params', $params); // List state information. parent::populateState($ordering, $direction); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. * * @since 1.6 */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.state'); $id .= ':' . $this->getState('filter.http_status'); return parent::getStoreId($id); } /** * Build an SQL query to load the list data. * * @return JDatabaseQuery * * @since 1.6 */ protected function getListQuery() { // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.*' ) ); $query->from($db->quoteName('#__redirect_links', 'a')); // Filter by published state $state = $this->getState('filter.state'); if (is_numeric($state)) { $query->where($db->quoteName('a.published') . ' = ' . (int) $state); } elseif ($state === '') { $query->where($db->quoteName('a.published') . ' IN (0,1)'); } // Filter the items over the HTTP status code header. if ($httpStatusCode = $this->getState('filter.http_status')) { $query->where($db->quoteName('a.header') . ' = ' . (int) $httpStatusCode); } // Filter the items over the search string if set. $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where($db->quoteName('a.id') . ' = ' . (int) substr($search, 3)); } else { $search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%')); $query->where( '(' . $db->quoteName('old_url') . ' LIKE ' . $search . ' OR ' . $db->quoteName('new_url') . ' LIKE ' . $search . ' OR ' . $db->quoteName('comment') . ' LIKE ' . $search . ' OR ' . $db->quoteName('referer') . ' LIKE ' . $search . ')' ); } } // Add the list ordering clause. $query->order($db->escape($this->getState('list.ordering', 'a.old_url')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); return $query; } /** * Add the entered URLs into the database * * @param array $batchUrls Array of URLs to enter into the database * * @return boolean */ public function batchProcess($batchUrls) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $params = JComponentHelper::getParams('com_redirect'); $state = (int) $params->get('defaultImportState', 0); $columns = array( $db->quoteName('old_url'), $db->quoteName('new_url'), $db->quoteName('referer'), $db->quoteName('comment'), $db->quoteName('hits'), $db->quoteName('published'), $db->quoteName('created_date') ); $query->columns($columns); foreach ($batchUrls as $batch_url) { $old_url = $batch_url[0]; // Destination URL can also be an external URL if (!empty($batch_url[1])) { $new_url = $batch_url[1]; } else { $new_url = ''; } $query->insert($db->quoteName('#__redirect_links'), false) ->values( $db->quote($old_url) . ', ' . $db->quote($new_url) . ' ,' . $db->quote('') . ', ' . $db->quote('') . ', 0, ' . $state . ', ' . $db->quote(JFactory::getDate()->toSql()) ); } $db->setQuery($query); $db->execute(); return true; } } models/fields/redirect.php 0000604 00000007435 15245570553 0011627 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JFormHelper::loadFieldClass('list'); /** * A dropdown containing all valid HTTP 1.1 response codes. * * @package Joomla.Administrator * @subpackage com_redirect * @since 3.4 */ class JFormFieldRedirect extends JFormFieldList { /** * The form field type. * * @var string * @since 3.4 */ protected $type = 'Redirect'; /** * A map of integer HTTP 1.1 response codes to the full HTTP Status for the headers. * * @var object * @since 3.4 * @link http://www.iana.org/assignments/http-status-codes/ */ protected $responseMap = array( 100 => 'HTTP/1.1 100 Continue', 101 => 'HTTP/1.1 101 Switching Protocols', 102 => 'HTTP/1.1 102 Processing', 200 => 'HTTP/1.1 200 OK', 201 => 'HTTP/1.1 201 Created', 202 => 'HTTP/1.1 202 Accepted', 203 => 'HTTP/1.1 203 Non-Authoritative Information', 204 => 'HTTP/1.1 204 No Content', 205 => 'HTTP/1.1 205 Reset Content', 206 => 'HTTP/1.1 206 Partial Content', 207 => 'HTTP/1.1 207 Multi-Status', 208 => 'HTTP/1.1 208 Already Reported', 226 => 'HTTP/1.1 226 IM Used', 300 => 'HTTP/1.1 300 Multiple Choices', 301 => 'HTTP/1.1 301 Moved Permanently', 302 => 'HTTP/1.1 302 Found', 303 => 'HTTP/1.1 303 See other', 304 => 'HTTP/1.1 304 Not Modified', 305 => 'HTTP/1.1 305 Use Proxy', 306 => 'HTTP/1.1 306 (Unused)', 307 => 'HTTP/1.1 307 Temporary Redirect', 308 => 'HTTP/1.1 308 Permanent Redirect', 400 => 'HTTP/1.1 400 Bad Request', 401 => 'HTTP/1.1 401 Unauthorized', 402 => 'HTTP/1.1 402 Payment Required', 403 => 'HTTP/1.1 403 Forbidden', 404 => 'HTTP/1.1 404 Not Found', 405 => 'HTTP/1.1 405 Method Not Allowed', 406 => 'HTTP/1.1 406 Not Acceptable', 407 => 'HTTP/1.1 407 Proxy Authentication Required', 408 => 'HTTP/1.1 408 Request Timeout', 409 => 'HTTP/1.1 409 Conflict', 410 => 'HTTP/1.1 410 Gone', 411 => 'HTTP/1.1 411 Length Required', 412 => 'HTTP/1.1 412 Precondition Failed', 413 => 'HTTP/1.1 413 Payload Too Large', 414 => 'HTTP/1.1 414 URI Too Long', 415 => 'HTTP/1.1 415 Unsupported Media Type', 416 => 'HTTP/1.1 416 Requested Range Not Satisfiable', 417 => 'HTTP/1.1 417 Expectation Failed', 418 => 'HTTP/1.1 418 I\'m a teapot', 422 => 'HTTP/1.1 422 Unprocessable Entity', 423 => 'HTTP/1.1 423 Locked', 424 => 'HTTP/1.1 424 Failed Dependency', 425 => 'HTTP/1.1 425 Reserved for WebDAV advanced collections expired proposal', 426 => 'HTTP/1.1 426 Upgrade Required', 428 => 'HTTP/1.1 428 Precondition Required', 429 => 'HTTP/1.1 429 Too Many Requests', 431 => 'HTTP/1.1 431 Request Header Fields Too Large', 451 => 'HTTP/1.1 451 Unavailable For Legal Reasons', 500 => 'HTTP/1.1 500 Internal Server Error', 501 => 'HTTP/1.1 501 Not Implemented', 502 => 'HTTP/1.1 502 Bad Gateway', 503 => 'HTTP/1.1 503 Service Unavailable', 504 => 'HTTP/1.1 504 Gateway Timeout', 505 => 'HTTP/1.1 505 HTTP Version Not Supported', 506 => 'HTTP/1.1 506 Variant Also Negotiates (Experimental)', 507 => 'HTTP/1.1 507 Insufficient Storage', 508 => 'HTTP/1.1 508 Loop Detected', 510 => 'HTTP/1.1 510 Not Extended', 511 => 'HTTP/1.1 511 Network Authentication Required', ); /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.4 */ protected function getOptions() { $options = array(); foreach ($this->responseMap as $key => $value) { $options[] = JHtml::_('select.option', $key, $value); } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } controller.php 0000604 00000003242 15245570553 0007450 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Redirect master display controller. * * @since 1.6 */ class RedirectController extends JControllerLegacy { /** * @var string The default view. * @since 1.6 */ protected $default_view = 'links'; /** * 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 JController 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->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(); } } redirect.xml 0000604 00000002120 15245570553 0007071 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension type="component" version="3.1" method="upgrade"> <name>com_redirect</name> <author>Joomla! Project</author> <creationDate>April 2006</creationDate> <copyright>(C) 2006 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>COM_REDIRECT_XML_DESCRIPTION</description> <administration> <menu link="option=com_redirect" img="class:redirect">Redirect</menu> <files folder="admin"> <filename>config.xml</filename> <filename>controller.php</filename> <filename>redirect.php</filename> <folder>controllers</folder> <folder>helpers</folder> <folder>models</folder> <folder>tables</folder> <folder>views</folder> </files> <languages folder="admin"> <language tag="en-GB">language/en-GB.com_redirect.ini</language> <language tag="en-GB">language/en-GB.com_redirect.sys.ini</language> </languages> </administration> </extension> redirect.php 0000604 00000001072 15245570553 0007065 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if (!JFactory::getUser()->authorise('core.manage', 'com_redirect')) { throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Redirect'); $controller->execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); config.xml 0000604 00000002214 15245570553 0006541 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <config> <fieldset name="redirect" label="COM_REDIRECT_ADVANCED_OPTIONS" > <field name="mode" type="radio" label="COM_REDIRECT_MODE_LABEL" description="COM_REDIRECT_MODE_DESC" class="btn-group btn-group-yesno" default="0" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="separator" type="text" label="COM_REDIRECT_BULK_SEPARATOR_LABEL" description="COM_REDIRECT_BULK_SEPARATOR_DESC" default="|" /> <field name="defaultImportState" type="radio" label="COM_REDIRECT_DEFAULT_IMPORT_STATE_LABEL" description="COM_REDIRECT_DEFAULT_IMPORT_STATE_DESC" class="btn-group btn-group-yesno" default="0" > <option value="1">JENABLED</option> <option value="0">JDISABLED</option> </field> </fieldset> <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" description="JCONFIG_PERMISSIONS_DESC" > <field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" filter="rules" validate="rules" component="com_redirect" section="component" /> </fieldset> </config> access.xml 0000604 00000001465 15245570553 0006544 0 ustar 00 <?xml version="1.0" encoding="utf-8" ?> <access component="com_redirect"> <section name="component"> <action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" /> <action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" /> <action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" /> <action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" /> <action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" /> <action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" /> <action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" /> </section> </access> views/link/tmpl/edit.php 0000604 00000003661 15245570553 0011265 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', 'select'); JFactory::getDocument()->addScriptDeclaration(" Joomla.submitbutton = function(task) { if (task == 'link.cancel' || document.formvalidator.isValid(document.getElementById('link-form'))) { Joomla.submitform(task, document.getElementById('link-form')); } }; "); ?> <form action="<?php echo JRoute::_('index.php?option=com_redirect&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="link-form" class="form-validate form-horizontal"> <fieldset> <?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'basic')); ?> <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'basic', empty($this->item->id) ? JText::_('COM_REDIRECT_NEW_LINK') : JText::sprintf('COM_REDIRECT_EDIT_LINK', $this->item->id)); ?> <?php echo $this->form->renderField('old_url'); ?> <?php echo $this->form->renderField('new_url'); ?> <?php echo $this->form->renderField('published'); ?> <?php echo $this->form->renderField('comment'); ?> <?php echo $this->form->renderField('id'); ?> <?php echo $this->form->renderField('created_date'); ?> <?php echo $this->form->renderField('modified_date'); ?> <?php if (JComponentHelper::getParams('com_redirect')->get('mode')) : ?> <?php echo $this->form->renderFieldset('advanced'); ?> <?php endif; ?> <?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.endTabSet'); ?> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </fieldset> </form> views/link/view.html.php 0000604 00000004113 15245570553 0011272 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * View to edit a redirect link. * * @since 1.6 */ class RedirectViewLink extends JViewLegacy { protected $item; protected $form; protected $state; /** * 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->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $isNew = ($this->item->id == 0); $canDo = JHelperContent::getActions('com_redirect'); JToolbarHelper::title($isNew ? JText::_('COM_REDIRECT_MANAGER_LINK_NEW') : JText::_('COM_REDIRECT_MANAGER_LINK_EDIT'), 'refresh 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'); } } views/links/tmpl/default.xml 0000604 00000000254 15245570553 0012153 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <metadata> <layout title="COM_REDIRECT"> <message> <![CDATA[COM_REDIRECT_XML_DESCRIPTION]]> </message> </layout> </metadata>