Skip to content

Commit

Permalink
JRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
brianteeman committed Jun 28, 2018
1 parent cdb14a9 commit f63c6ef
Show file tree
Hide file tree
Showing 144 changed files with 487 additions and 335 deletions.
Expand Up @@ -11,6 +11,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\MVC\Controller\FormController;
use Joomla\CMS\Router\Route;

/**
* User profile controller class.
Expand Down Expand Up @@ -48,14 +49,14 @@ protected function allowEdit($data = array(), $key = 'id')
*/
public function save($key = null, $urlVar = null)
{
$this->setRedirect(\JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->app->getIdentity()->id, false));
$this->setRedirect(Route::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->app->getIdentity()->id, false));

$return = parent::save();

if ($this->getTask() != 'apply')
{
// Redirect to the main page.
$this->setRedirect(\JRoute::_('index.php', false));
$this->setRedirect(Route::_('index.php', false));
}

return $return;
Expand All @@ -75,7 +76,7 @@ public function cancel($key = null)
$return = parent::cancel($key);

// Redirect to the main page.
$this->setRedirect(\JRoute::_('index.php', false));
$this->setRedirect(Route::_('index.php', false));

return $return;
}
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_admin/View/Sysinfo/HtmlView.php
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* Sysinfo View class for the Admin component
Expand Down Expand Up @@ -100,8 +101,8 @@ public function display($tpl = null)
protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_ADMIN_SYSTEM_INFORMATION'), 'info-2 systeminfo');
ToolbarHelper::link(\JRoute::_('index.php?option=com_admin&view=sysinfo&format=text'), 'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_TEXT', 'download');
ToolbarHelper::link(\JRoute::_('index.php?option=com_admin&view=sysinfo&format=json'), 'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_JSON', 'download');
ToolbarHelper::link(Route::_('index.php?option=com_admin&view=sysinfo&format=text'), 'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_TEXT', 'download');
ToolbarHelper::link(Route::_('index.php?option=com_admin&view=sysinfo&format=json'), 'COM_ADMIN_DOWNLOAD_SYSTEM_INFORMATION_JSON', 'download');
ToolbarHelper::help('JHELP_SITE_SYSTEM_INFORMATION');
}
}
3 changes: 2 additions & 1 deletion administrator/components/com_admin/tmpl/help/default.php
Expand Up @@ -10,9 +10,10 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

?>
<form action="<?php echo JRoute::_('index.php?option=com_admin&amp;view=help'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_admin&amp;view=help'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div id="sidebar" class="col-md-3">
<div class="sidebar-nav">
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_admin/tmpl/profile/edit.php
Expand Up @@ -10,6 +10,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
Expand All @@ -20,7 +21,7 @@
$fieldsets = $this->form->getFieldsets();
?>

<form action="<?php echo JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->item->id); ?>" method="post" name="adminForm" id="profile-form" enctype="multipart/form-data" class="form-validate">
<form action="<?php echo Route::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->item->id); ?>" method="post" name="adminForm" id="profile-form" enctype="multipart/form-data" class="form-validate">
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'account')); ?>

<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'account', Text::_('COM_ADMIN_USER_ACCOUNT_DETAILS')); ?>
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_admin/tmpl/sysinfo/default.php
Expand Up @@ -10,14 +10,15 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

// Add specific helper files for html generation
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

JHtml::_('behavior.tabstate');
?>

<form action="<?php echo JRoute::_('index.php?option=com_admin&view=sysinfo'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_admin&view=sysinfo'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<?php // Begin Content ?>
<div class="col-md-12">
Expand Down
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* Association edit controller class.
Expand Down Expand Up @@ -42,7 +43,7 @@ public function edit($key = null, $urlVar = null)
if (!AssociationsHelper::allowEdit($extensionName, $typeName, $id))
{
$this->setMessage(Text::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'), 'error');
$this->setRedirect(\JRoute::_('index.php?option=com_associations&view=associations', false));
$this->setRedirect(Route::_('index.php?option=com_associations&view=associations', false));

return false;
}
Expand Down Expand Up @@ -84,6 +85,6 @@ public function cancel($key = null)
}
}

$this->setRedirect(\JRoute::_('index.php?option=com_associations&view=associations', false));
$this->setRedirect(Route::_('index.php?option=com_associations&view=associations', false));
}
}
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* Associations controller class.
Expand Down Expand Up @@ -56,7 +57,7 @@ public function getModel($name = 'Associations', $prefix = 'Administrator', $con
public function purge()
{
$this->getModel('associations')->purge();
$this->setRedirect(\JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
}

/**
Expand All @@ -69,7 +70,7 @@ public function purge()
public function clean()
{
$this->getModel('associations')->clean();
$this->setRedirect(\JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
}

/**
Expand All @@ -82,7 +83,7 @@ public function clean()
public function checkin()
{
// Set the redirect so we can just stop processing when we find a condition we can't process
$this->setRedirect(\JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));

// Figure out if the item supports checking and check it in
$type = null;
Expand Down Expand Up @@ -124,7 +125,7 @@ public function checkin()
}

$this->setRedirect(
\JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list),
Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list),
Text::_('COM_ASSOCIATIONS_YOU_ARE_NOT_ALLOWED_TO_CHECKIN_THIS_ITEM')
);

Expand Down
Expand Up @@ -18,6 +18,7 @@
use Joomla\Registry\Registry;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* Associations component helper.
Expand Down Expand Up @@ -316,7 +317,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId
'target' => $target,
);

$url = \JRoute::_('index.php?' . http_build_query($options));
$url = Route::_('index.php?' . http_build_query($options));
$url = $allow && $addLink ? $url : '';
$text = strtoupper($language->sef);

Expand Down
Expand Up @@ -16,6 +16,7 @@
use Joomla\Utilities\ArrayHelper;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* View class for a list of articles.
Expand Down Expand Up @@ -161,7 +162,7 @@ public function display($tpl = null)
$this->targetId = $matches[1];
$this->targetLanguage = $matches[0];
$task = $this->typeName . '.' . $this->targetAction;
$this->defaultTargetSrc = \JRoute::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId);
$this->defaultTargetSrc = Route::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId);
$this->form->setValue('itemlanguage', '', $this->targetLanguage . ':' . $this->targetId . ':' . $this->targetAction);
}

Expand Down
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Language\Associations;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* View class for a list of articles.
Expand Down Expand Up @@ -76,7 +77,7 @@ public function display($tpl = null)

if (!Associations::isEnabled())
{
$link = \JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . AssociationsHelper::getLanguagefilterPluginId());
$link = Route::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . AssociationsHelper::getLanguagefilterPluginId());
\JFactory::getApplication()->enqueueMessage(Text::sprintf('COM_ASSOCIATIONS_ERROR_NO_ASSOC', $link), 'warning');
}
elseif ($this->state->get('itemtype') == '' || $this->state->get('language') == '')
Expand Down
Expand Up @@ -10,6 +10,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
Expand All @@ -29,19 +30,19 @@
data-hide-reference="<?php echo Text::_('COM_ASSOCIATIONS_EDIT_HIDE_REFERENCE'); ?>"><?php echo Text::_('COM_ASSOCIATIONS_EDIT_HIDE_REFERENCE'); ?>
</button>

<form action="<?php echo JRoute::_('index.php?option=com_associations&view=association&' . http_build_query($options)); ?>" method="post" name="adminForm" id="adminForm" data-associatedview="<?php echo $this->typeName; ?>">
<form action="<?php echo Route::_('index.php?option=com_associations&view=association&' . http_build_query($options)); ?>" method="post" name="adminForm" id="adminForm" data-associatedview="<?php echo $this->typeName; ?>">
<div class="sidebyside">
<div class="outer-panel" id="left-panel">
<div class="inner-panel">
<h3><?php echo Text::_('COM_ASSOCIATIONS_REFERENCE_ITEM'); ?></h3>
<iframe id="reference-association" name="reference-association" title="reference-association"
src="<?php echo JRoute::_($this->editUri . '&task=' . $this->typeName . '.edit&id=' . (int) $this->referenceId); ?>"
src="<?php echo Route::_($this->editUri . '&task=' . $this->typeName . '.edit&id=' . (int) $this->referenceId); ?>"
height="400" width="400"
data-action="edit"
data-item="<?php echo $this->typeName; ?>"
data-id="<?php echo $this->referenceId; ?>"
data-language="<?php echo $this->referenceLanguage; ?>"
data-editurl="<?php echo JRoute::_($this->editUri); ?>">
data-editurl="<?php echo Route::_($this->editUri); ?>">
</iframe>
</div>
</div>
Expand All @@ -59,7 +60,7 @@
data-item="<?php echo $this->typeName; ?>"
data-id="<?php echo $this->targetId; ?>"
data-language="<?php echo $this->targetLanguage; ?>"
data-editurl="<?php echo JRoute::_($this->editUri); ?>">
data-editurl="<?php echo Route::_($this->editUri); ?>">
</iframe>
</div>
</div>
Expand Down
Expand Up @@ -11,6 +11,7 @@

use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

JHtml::_('jquery.framework');
JHtml::_('behavior.multiselect');
Expand All @@ -30,7 +31,7 @@
Text::script('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT', true);
JHtml::_('script', 'com_associations/admin-associations-default.min.js', false, true);
?>
<form action="<?php echo JRoute::_('index.php?option=com_associations&view=associations'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_associations&view=associations'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
Expand Down Expand Up @@ -102,7 +103,7 @@
<?php endif; ?>
<?php if ($canEdit) : ?>
<?php $editIcon = $isCheckout ? '' : '<span class="fa fa-pencil-square mr-2" aria-hidden="true"></span>'; ?>
<a class="hasTooltip" href="<?php echo JRoute::_($this->editUri . '&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes($item->title)); ?>">
<a class="hasTooltip" href="<?php echo Route::_($this->editUri . '&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes($item->title)); ?>">
<?php echo $editIcon; ?><?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>"><?php echo $this->escape($item->title); ?></span>
Expand Down
Expand Up @@ -11,6 +11,7 @@

use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

$app = JFactory::getApplication();

Expand Down Expand Up @@ -39,7 +40,7 @@
JFactory::getDocument()->addScriptOptions('assosiations-modal', ['func' => $function]);
JHtml::_('script', 'com_associations/admin-associations-modal.min.js', false, true);
?>
<form action="<?php echo JRoute::_('index.php?option=com_associations&view=associations&layout=modal&tmpl=component&function='
<form action="<?php echo Route::_('index.php?option=com_associations&view=associations&layout=modal&tmpl=component&function='
. $function . '&' . JSession::getFormToken() . '=1'); ?>" method="post" name="adminForm" id="adminForm">

<?php if (!empty( $this->sidebar)) : ?>
Expand Down
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* Banner controller class.
Expand Down Expand Up @@ -106,7 +107,7 @@ public function batch($model = null)
$model = $this->getModel('Banner', '', array());

// Preset the redirect
$this->setRedirect(\JRoute::_('index.php?option=com_banners&view=banners' . $this->getRedirectToListAppend(), false));
$this->setRedirect(Route::_('index.php?option=com_banners&view=banners' . $this->getRedirectToListAppend(), false));

return parent::batch($model);
}
Expand Down
Expand Up @@ -13,6 +13,7 @@
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Component\Banners\Administrator\Helper\BannersHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/**
* Banners master display controller.
Expand Down Expand Up @@ -52,15 +53,15 @@ public function display($cachable = false, $urlparams = array())
{
// Somehow the person just went to the form - we don't allow that.
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');
$this->setRedirect(\JRoute::_('index.php?option=com_banners&view=banners', false));
$this->setRedirect(Route::_('index.php?option=com_banners&view=banners', false));

return false;
}
elseif ($view == 'client' && $layout == 'edit' && !$this->checkEditId('com_banners.edit.client', $id))
{
// Somehow the person just went to the form - we don't allow that.
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');
$this->setRedirect(\JRoute::_('index.php?option=com_banners&view=clients', false));
$this->setRedirect(Route::_('index.php?option=com_banners&view=clients', false));

return false;
}
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_banners/View/Tracks/HtmlView.php
Expand Up @@ -13,7 +13,7 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\Component\Banners\Administrator\Helper\BannersHelper;
use Joomla\CMS\Language\Text;

use Joomla\CMS\Router\Route;

/**
* View class for a list of tracks.
Expand Down Expand Up @@ -96,7 +96,7 @@ protected function addToolbar()
'selector' => 'downloadModal',
'icon' => 'download',
'text' => Text::_('JTOOLBAR_EXPORT'),
'doTask' => \JRoute::_('index.php?option=com_banners&view=download&tmpl=component'),
'doTask' => Route::_('index.php?option=com_banners&view=download&tmpl=component'),
)
);

Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_banners/tmpl/banner/edit.php
Expand Up @@ -10,6 +10,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

Expand All @@ -20,7 +21,7 @@
JHtml::_('script', 'com_banners/admin-banner-edit.min.js', array('version' => 'auto', 'relative' => true));
?>

<form action="<?php echo JRoute::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="banner-form" class="form-validate">
<form action="<?php echo Route::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="banner-form" class="form-validate">

<?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?>

Expand Down

0 comments on commit f63c6ef

Please sign in to comment.