- md5
- dff6a2f18e0ad26c712ca364bb72753e
- sha1
- d2949d87412b9b026649b3791e68ab249cfd98b8
- sha256
- 57b77d8c27a68034f18ba64f72294b2d2b6bde2e9944c24703be49847c0257ec
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
<?php
/**
* @package Joomla.Administrator
* @subpackage com_workflow
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Workflow\Administrator\Controller;
\defined('_JEXEC') or die;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\Input\Input;
/**
* Workflow base controller package.
*
* @since 4.0.0
*/
class DisplayController extends BaseController
{
/**
* The default view.
*
* @var string
* @since 4.0.0
*/
protected $default_view = 'workflows';
/**
* The extension for which the workflow apply.
*
* @var string
* @since 4.0.0
*/
protected $extension;
/**
* The section of the current extension
*
* @var string
* @since 4.0.0
*/
protected $section;
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param CMSApplication $app The JApplication for the dispatcher
* @param Input $input Input
*
* @since 4.0.0
* @throws \InvalidArgumentException when no extension is set
*/
public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null)
{
parent::__construct($config, $factory, $app, $input);
// If extension is not set try to get it from input or throw an exception
if (empty($this->extension))
{
$extension = $this->input->getCmd('extension');
$parts = explode('.', $extension);
$this->extension = array_shift($parts);
if (!empty($parts))
{
$this->section = array_shift($parts);
}
if (empty($this->extension))
{
throw new \InvalidArgumentException(Text::_('COM_WORKFLOW_ERROR_EXTENSION_NOT_SET'));
}
}
}
}
No other release has this exact content. See every version of this file.