-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
101 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage com_fields | ||
* | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
namespace Joomla\Component\Fields\Site\Controller; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Application\CMSApplication; | ||
use Joomla\CMS\Mvc\Factory\MvcFactoryInterface; | ||
|
||
/** | ||
* Base controller class for Fields Component. | ||
* | ||
* @since 3.7.0 | ||
*/ | ||
class Controller extends \Joomla\CMS\Controller\Controller | ||
{ | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @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 $factory The factory. | ||
* @param CMSApplication $app The JApplication for the dispatcher | ||
* @param \JInput $input Input | ||
* | ||
* @since 3.7.0 | ||
*/ | ||
public function __construct($config = array(), MvcFactoryInterface $factory = null, $app = null, $input = null) | ||
{ | ||
// Frontpage Editor Fields Button proxying: | ||
if ($input->get('view') === 'fields' && $input->get('layout') === 'modal') | ||
{ | ||
// Load the backend language file. | ||
$app->getLanguage()->load('com_fields', JPATH_ADMINISTRATOR); | ||
|
||
$config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; | ||
} | ||
|
||
parent::__construct($config, $factory, $app, $input); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage com_fields | ||
* | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Dispatcher\Dispatcher; | ||
|
||
/** | ||
* Dispatcher class for com_fields | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class FieldsDispatcher extends Dispatcher | ||
{ | ||
/** | ||
* The extension namespace | ||
* | ||
* @var string | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
protected $namespace = 'Joomla\\Component\\Fields'; | ||
|
||
/** | ||
* Dispatch a controller task. Redirecting the user if appropriate. | ||
* | ||
* @return void | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function dispatch() | ||
{ | ||
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); | ||
|
||
parent::dispatch(); | ||
} | ||
} |