first commit
This commit is contained in:
81
components/com_modules/forms/filter_modules.xml
Normal file
81
components/com_modules/forms/filter_modules.xml
Normal file
@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form addfieldprefix="Joomla\Component\Modules\Administrator\Field">
|
||||
<fields name="filter">
|
||||
<field
|
||||
name="search"
|
||||
type="text"
|
||||
inputmode="search"
|
||||
label="COM_MODULES_MODULES_FILTER_SEARCH_LABEL"
|
||||
description="COM_MODULES_MODULES_FILTER_SEARCH_DESC"
|
||||
hint="JSEARCH_FILTER"
|
||||
noresults="COM_MODULES_MSG_MANAGE_NO_MODULES"
|
||||
/>
|
||||
<field
|
||||
name="position"
|
||||
type="ModulesPosition"
|
||||
label="COM_MODULES_FIELD_POSITION_LABEL"
|
||||
client="site"
|
||||
onchange="this.form.submit();"
|
||||
>
|
||||
<option value="">COM_MODULES_OPTION_SELECT_POSITION</option>
|
||||
</field>
|
||||
<field
|
||||
name="module"
|
||||
type="ModulesModule"
|
||||
label="COM_MODULES_OPTION_SELECT_MODULE"
|
||||
client="site"
|
||||
onchange="this.form.submit();"
|
||||
>
|
||||
<option value="">COM_MODULES_OPTION_SELECT_MODULE</option>
|
||||
</field>
|
||||
<field
|
||||
name="access"
|
||||
type="accesslevel"
|
||||
label="JOPTION_FILTER_ACCESS"
|
||||
description="JOPTION_FILTER_ACCESS_DESC"
|
||||
onchange="this.form.submit();"
|
||||
>
|
||||
<option value="">JOPTION_SELECT_ACCESS</option>
|
||||
</field>
|
||||
</fields>
|
||||
<fields name="list">
|
||||
<field
|
||||
name="fullordering"
|
||||
type="list"
|
||||
label="JGLOBAL_SORT_BY"
|
||||
description="JGLOBAL_SORT_BY"
|
||||
statuses="*,0,1,-2"
|
||||
onchange="this.form.submit();"
|
||||
default="a.position ASC"
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
|
||||
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
|
||||
<option value="a.published ASC">JSTATUS_ASC</option>
|
||||
<option value="a.published DESC">JSTATUS_DESC</option>
|
||||
<option value="a.title ASC">JGLOBAL_TITLE_ASC</option>
|
||||
<option value="a.title DESC">JGLOBAL_TITLE_DESC</option>
|
||||
<option value="a.position ASC">COM_MODULES_HEADING_POSITION_ASC</option>
|
||||
<option value="a.position DESC">COM_MODULES_HEADING_POSITION_DESC</option>
|
||||
<option value="name ASC">COM_MODULES_HEADING_MODULE_ASC</option>
|
||||
<option value="name DESC">COM_MODULES_HEADING_MODULE_DESC</option>
|
||||
<option value="pages ASC">COM_MODULES_HEADING_PAGES_ASC</option>
|
||||
<option value="pages DESC">COM_MODULES_HEADING_PAGES_DESC</option>
|
||||
<option value="ag.title ASC">JGRID_HEADING_ACCESS_ASC</option>
|
||||
<option value="ag.title DESC">JGRID_HEADING_ACCESS_DESC</option>
|
||||
<option value="l.title ASC" requires="multilanguage">JGRID_HEADING_LANGUAGE_ASC</option>
|
||||
<option value="l.title DESC" requires="multilanguage">JGRID_HEADING_LANGUAGE_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="COM_MODULES_LIST_LIMIT"
|
||||
description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC"
|
||||
default="25"
|
||||
onchange="this.form.submit();"
|
||||
/>
|
||||
</fields>
|
||||
</form>
|
||||
51
components/com_modules/src/Controller/DisplayController.php
Normal file
51
components/com_modules/src/Controller/DisplayController.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_modules
|
||||
*
|
||||
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\Modules\Site\Controller;
|
||||
|
||||
use Joomla\CMS\Application\CMSApplication;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Input\Input;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Modules manager display controller.
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
class DisplayController extends BaseController
|
||||
{
|
||||
/**
|
||||
* @param array $config An optional associative array of configuration settings.
|
||||
* Recognized key values include 'name', 'default_task', 'model_path', and
|
||||
* 'view_path' (this list is not meant to be comprehensive).
|
||||
* @param MVCFactoryInterface|null $factory The factory.
|
||||
* @param CMSApplication|null $app The Application for the dispatcher
|
||||
* @param Input|null $input The Input object for the request
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null)
|
||||
{
|
||||
$this->input = Factory::getApplication()->getInput();
|
||||
|
||||
// Modules frontpage Editor Module proxying.
|
||||
if ($this->input->get('view') === 'modules' && $this->input->get('layout') === 'modal') {
|
||||
$config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
|
||||
}
|
||||
|
||||
parent::__construct($config, $factory, $app, $input);
|
||||
}
|
||||
}
|
||||
80
components/com_modules/src/Dispatcher/Dispatcher.php
Normal file
80
components/com_modules/src/Dispatcher/Dispatcher.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_modules
|
||||
*
|
||||
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\Modules\Site\Dispatcher;
|
||||
|
||||
use Joomla\CMS\Access\Exception\NotAllowed;
|
||||
use Joomla\CMS\Dispatcher\ComponentDispatcher;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* ComponentDispatcher class for com_modules
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
class Dispatcher extends ComponentDispatcher
|
||||
{
|
||||
/**
|
||||
* Load the language
|
||||
*
|
||||
* @since 4.0.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function loadLanguage()
|
||||
{
|
||||
$this->app->getLanguage()->load('com_modules', JPATH_ADMINISTRATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch a controller task. Redirecting the user if appropriate.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function checkAccess()
|
||||
{
|
||||
parent::checkAccess();
|
||||
|
||||
if (
|
||||
$this->input->get('view') === 'modules'
|
||||
&& $this->input->get('layout') === 'modal'
|
||||
&& !$this->app->getIdentity()->authorise('core.create', 'com_modules')
|
||||
) {
|
||||
throw new NotAllowed();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a controller from the component
|
||||
*
|
||||
* @param string $name Controller name
|
||||
* @param string $client Optional client (like Administrator, Site etc.)
|
||||
* @param array $config Optional controller config
|
||||
*
|
||||
* @return \Joomla\CMS\MVC\Controller\BaseController
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public function getController(string $name, string $client = '', array $config = []): BaseController
|
||||
{
|
||||
if ($this->input->get('task') === 'orderPosition') {
|
||||
$config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
|
||||
$client = 'Administrator';
|
||||
}
|
||||
|
||||
return parent::getController($name, $client, $config);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user