Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UPDATE `#__menu` SET `link`='index.php?option=com_banners&view=banners' WHERE `id`=3;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_banners' WHERE `id`=4;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_contact' WHERE `id`=9;
UPDATE `#__menu` SET `link`='index.php?option=com_newsfeeds&view=newsfeeds' WHERE `id`=14;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_newsfeeds' WHERE `id`=15;
UPDATE `#__menu` SET `link`='index.php?option=com_redirect&view=links' WHERE `id`=16;
UPDATE `#__menu` SET `link`='index.php?option=com_search&view=searches' WHERE `id`=17;
UPDATE `#__menu` SET `link`='index.php?option=com_finder&view=index' WHERE `id`=18;
UPDATE `#__menu` SET `link`='index.php?option=com_tags&view=tags' WHERE `id`=20;
UPDATE `#__menu` SET `link`='index.php?option=com_associations&view=associations' WHERE `id`=22;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UPDATE "#__menu" SET "link"='index.php?option=com_banners&view=banners' WHERE "id"=3;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_banners' WHERE "id"=4;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_contact' WHERE "id"=9;
UPDATE "#__menu" SET "link"='index.php?option=com_newsfeeds&view=newsfeeds' WHERE "id"=14;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_newsfeeds' WHERE "id"=15;
UPDATE "#__menu" SET "link"='index.php?option=com_redirect&view=links' WHERE "id"=16;
UPDATE "#__menu" SET "link"='index.php?option=com_search&view=searches' WHERE "id"=17;
UPDATE "#__menu" SET "link"='index.php?option=com_finder&view=index' WHERE "id"=18;
UPDATE "#__menu" SET "link"='index.php?option=com_tags&view=tags' WHERE "id"=20;
UPDATE "#__menu" SET "link"='index.php?option=com_associations&view=associations' WHERE "id"=22;
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
HTMLHelper::_('draggablelist.draggable');
}
?>
<form action="<?php echo Route::_('index.php?option=com_categories&view=categories'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_categories&view=categories&extension=' . $this->state->get('filter.extension')); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="col-md-2">
Expand Down
33 changes: 33 additions & 0 deletions administrator/components/com_fields/Controller/GroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,37 @@ protected function postSaveHook(BaseDatabaseModel $model, $validData = array())

return;
}

/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 4.0.0
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$append = parent::getRedirectToItemAppend($recordId);
$append .= '&context=' . $this->input->get('context');

return $append;
}

/**
* Gets the URL arguments to append to a list redirect.
*
* @return string The arguments to append to the redirect URL.
*
* @since 4.0.0
*/
protected function getRedirectToListAppend()
{
$append = parent::getRedirectToListAppend();
$append .= '&context=' . $this->input->get('context');

return $append;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
?>

<form action="<?php echo Route::_('index.php?option=com_fields&view=fields'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_fields&view=fields&context=' . $this->state->get('filter.context')); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<?php if (!empty($this->sidebar)) { ?>
<div id="j-sidebar-container" class="col-md-2">
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_fields/tmpl/group/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

?>

<form action="<?php echo Route::_('index.php?option=com_fields&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
<form action="<?php echo Route::_('index.php?option=com_fields&context=' . $this->state->get('filter.context') . '&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate">
<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>
<div class="form-horizontal">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'general')); ?>
Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_fields/tmpl/groups/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
$saveOrderingUrl = 'index.php?option=com_fields&task=groups.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
HTMLHelper::_('draggablelist.draggable');
}

$context = $this->escape($this->state->get('filter.context'));
?>

<form action="<?php echo Route::_('index.php?option=com_fields&view=groups'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_fields&view=groups&context=' . $context); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<?php if (!empty($this->sidebar)) { ?>
<div id="j-sidebar-container" class="col-md-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;

/**
* Base controller class for Menu Manager.
Expand Down Expand Up @@ -44,6 +46,21 @@ class DisplayController extends BaseController
*/
public function display($cachable = false, $urlparams = false)
{
// Verify menu
$menuType = $this->input->post->getCmd('menutype', '');

if ($menuType !== '')
{
$uri = Uri::getInstance();

if ($uri->getVar('menutype') !== $menuType)
{
$this->setRedirect(Route::_('index.php?option=com_menus&view=items&menutype=' . $menuType, false));

return false;
}
}

// Check custom administrator menu modules
if (ModuleHelper::isAdminMultilang())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function rebuild()
{
$this->checkToken();

$this->setRedirect('index.php?option=com_menus&view=items');
$this->setRedirect('index.php?option=com_menus&view=items&menutype=' . $this->input->getCmd('menutype'));

/* @var \Joomla\Component\Menus\Administrator\Model\ItemModel $model */
$model = $this->getModel();
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_menus/Model/ItemModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,10 @@ protected function populateState()
// Forced client id will override/clear menuType if conflicted
$forcedClientId = $app->input->get('client_id', null, 'string');

// Set the menu type and client id on the list view state, so we return to this menu after saving.
$app->setUserState('com_menus.items.menutype', $menuType);
$app->setUserState('com_menus.items.client_id', $clientId);

// Current item if not new, we don't allow changing client id at all
if ($pk)
{
Expand All @@ -999,10 +1003,6 @@ protected function populateState()
$menuTypeId = 0;
}

// Set the menu type and client id on the list view state, so we return to this menu after saving.
$app->setUserState('com_menus.items.menutype', $menuType);
$app->setUserState('com_menus.items.client_id', $clientId);

$this->setState('item.menutype', $menuType);
$this->setState('item.client_id', $clientId);
$this->setState('item.menutypeid', $menuTypeId);
Expand Down
18 changes: 9 additions & 9 deletions administrator/components/com_menus/presets/joomla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
title="MOD_MENU_COM_CONTENT_ARTICLE_MANAGER"
type="component"
element="com_content"
link="index.php?option=com_content"
link="index.php?option=com_content&amp;view=articles"
quicktask="index.php?option=com_content&amp;task=article.add"
quicktask-title="MOD_MENU_COM_CONTENT_ARTICLE_ADD"
>
Expand All @@ -29,7 +29,7 @@
title="MOD_MENU_COM_CONTENT_CATEGORY_MANAGER"
type="component"
element="com_categories"
link="index.php?option=com_categories&amp;extension=com_content"
link="index.php?option=com_categories&amp;view=categories&amp;extension=com_content"
quicktask="index.php?option=com_categories&amp;extension=com_content&amp;task=category.add"
>
</menuitem>
Expand All @@ -44,7 +44,7 @@
title="MOD_MENU_COM_CONTENT_WORKFLOW"
type="component"
element="com_workflow"
link="index.php?option=com_workflow&amp;extension=com_content">
link="index.php?option=com_workflow&amp;view=workflows&amp;extension=com_content">
</menuitem>
<menuitem
type="separator"
Expand All @@ -53,7 +53,7 @@
title="MOD_MENU_FIELDS"
type="component"
element="com_fields"
link="index.php?option=com_fields&amp;context=com_content.article"
link="index.php?option=com_fields&amp;view=fields&amp;context=com_content.article"
/>
<menuitem
title="MOD_MENU_FIELDS_GROUP"
Expand All @@ -75,13 +75,13 @@
title="MOD_MENU_EXTENSIONS_MODULE_MANAGER_SITE"
type="component"
element="com_modules"
link="index.php?option=com_modules&amp;client_id=0"
link="index.php?option=com_modules&amp;view=modules&amp;client_id=0"
/>
<menuitem
title="MOD_MENU_EXTENSIONS_MODULE_MANAGER_ADMINISTRATOR"
type="component"
element="com_modules"
link="index.php?option=com_modules&amp;client_id=1"
link="index.php?option=com_modules&amp;view=modules&amp;client_id=1"
/>
</menuitem>

Expand Down Expand Up @@ -187,7 +187,7 @@
title="MOD_MENU_FIELDS"
type="component"
element="com_fields"
link="index.php?option=com_fields&amp;context=com_users.user"
link="index.php?option=com_fields&amp;view=fields&amp;context=com_users.user"
/>
<menuitem
title="MOD_MENU_FIELDS_GROUP"
Expand Down Expand Up @@ -217,14 +217,14 @@
title="MOD_MENU_COM_PRIVACY"
type="component"
element="com_privacy"
link="index.php?option=com_privacy"
link="index.php?option=com_privacy&amp;view=dashboard"
class="class:privacy"
/>
<menuitem
title="MOD_MENU_COM_ACTIONLOGS"
type="component"
element="com_actionlogs"
link="index.php?option=com_actionlogs"
link="index.php?option=com_actionlogs&amp;view=actionlogs"
class="class:userlogs"
/>
<menuitem
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_menus/tmpl/item/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@

<input type="hidden" name="task" value="">
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>">
<input type="hidden" name="menutype" value="<?php echo $input->get('menutype', '', 'cmd'); ?>">
<?php echo $this->form->getInput('component_id'); ?>
<?php echo HTMLHelper::_('form.token'); ?>
<input type="hidden" id="fieldtype" name="fieldtype" value="">
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/tmpl/items/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

?>
<?php // Set up the filter bar. ?>
<form action="<?php echo Route::_('index.php?option=com_menus&view=items'); ?>" method="post" name="adminForm"
<form action="<?php echo Route::_('index.php?option=com_menus&view=items&menutype='); ?>" method="post" name="adminForm"
id="adminForm">
<div class="row">
<?php if (!empty($this->sidebar)) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;

/**
* Modules manager master display controller.
Expand Down Expand Up @@ -48,12 +49,27 @@ public function display($cachable = false, $urlparams = false)
$layout = $this->input->get('layout', 'edit');
$id = $this->input->getInt('id');

// Verify client
$clientId = $this->input->post->getInt('client_id');

if (!is_null($clientId))
{
$uri = Uri::getInstance();

if ((int) $uri->getVar('client_id') !== (int) $clientId)
{
$this->setRedirect(Route::_('index.php?option=com_modules&view=modules&client_id=' . $clientId, false));

return false;
}
}

// Check for edit form.
if ($layout == 'edit' && !$this->checkEditId('com_modules.edit.module', $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(Route::_('index.php?option=com_modules&view=modules', false));
$this->setRedirect(Route::_('index.php?option=com_modules&view=modules&client_id=' . $this->input->getInt('client_id'), false));

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,37 @@ public function orderPosition()
echo new JsonResponse($html);
$app->close();
}

/**
* Gets the URL arguments to append to an item redirect.
*
* @param integer $recordId The primary key id for the item.
* @param string $urlVar The name of the URL variable for the id.
*
* @return string The arguments to append to the redirect URL.
*
* @since 4.0.0
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
$append = parent::getRedirectToItemAppend($recordId);
$append .= '&client_id=' . $this->input->getInt('client_id');

return $append;
}

/**
* Gets the URL arguments to append to a list redirect.
*
* @return string The arguments to append to the redirect URL.
*
* @since 4.0.0
*/
protected function getRedirectToListAppend()
{
$append = parent::getRedirectToListAppend();
$append .= '&client_id=' . $this->input->getInt('client_id');

return $append;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected function addToolbar()
if ($canDo->get('core.create'))
{
$toolbar->standardButton('new', 'JTOOLBAR_NEW')
->onclick("location.href='index.php?option=com_modules&amp;view=select'");
->onclick("location.href='index.php?option=com_modules&amp;view=select&amp;client_id=" . $this->state->get('client_id', 0) . "'");
}

if ($canDo->get('core.edit.state') || Factory::getUser()->authorise('core.admin'))
Expand Down
13 changes: 6 additions & 7 deletions administrator/components/com_modules/View/Select/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,23 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
$state = $this->get('State');
$state = $this->get('State');
$clientId = (int) $state->get('client_id', 0);

// Add page title
if ($state->get('client_id') == 1)
ToolbarHelper::title(Text::_('COM_MODULES_MANAGER_MODULES_SITE'), 'cube module');

if ($clientId === 1)
{
ToolbarHelper::title(Text::_('COM_MODULES_MANAGER_MODULES_ADMIN'), 'cube module');
}
else
{
ToolbarHelper::title(Text::_('COM_MODULES_MANAGER_MODULES_SITE'), 'cube module');
}

// Get the toolbar object instance
$bar = Toolbar::getInstance('toolbar');

// Instantiate a new FileLayout instance and render the layout
$layout = new FileLayout('toolbar.cancelselect');

$bar->appendButton('Custom', $layout->render(array()), 'new');
$bar->appendButton('Custom', $layout->render(array('client_id' => $clientId)), 'new');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

$text = Text::_('JTOOLBAR_CANCEL');
?>
<button onclick="location.href='index.php?option=com_modules'" class="btn btn-sm btn-danger">
<button onclick="location.href='index.php?option=com_modules&view=modules&client_id=<?php echo $displayData['client_id']; ?>'" class="btn btn-sm btn-danger">
<span class="icon-cancel" aria-hidden="true"></span> <?php echo $text; ?>
</button>
2 changes: 1 addition & 1 deletion administrator/components/com_modules/tmpl/module/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

?>

<form action="<?php echo Route::_('index.php?option=com_modules&layout=' . $layout . $tmpl . '&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="module-form" class="form-validate">
<form action="<?php echo Route::_('index.php?option=com_modules&layout=' . $layout . $tmpl . '&client_id=' . $this->form->getValue('client_id') . '&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="module-form" class="form-validate">

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
HTMLHelper::_('draggablelist.draggable');
}
?>
<form action="<?php echo Route::_('index.php?option=com_modules'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_modules&view=modules&client_id=' . $clientId); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if ($this->total > 0) : ?>
Expand Down
Loading