- md5
- 1f23d5b4a4657a8eb86f7c4ab94eb85a
- sha1
- e663cc51b4cc7f427a283fe0b930e6c70e6c8b0d
- sha256
- 1c3779664673d0aa8fb24188b43d6631f598e7cb3bb4f6face8b4ecc84bba36b
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
<?php
/**
* @package Joomla.Administrator
* @subpackage com_workflow
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Workflow\Administrator\View\Transitions;
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Workflow\Administrator\Helper\WorkflowHelper;
/**
* Workflows view class for the Workflow package.
*
* @since 4.0.0
*/
class HtmlView extends BaseHtmlView
{
/**
* An array of transitions
*
* @var array
* @since 4.0.0
*/
protected $transitions;
/**
* The model state
*
* @var object
* @since 4.0.0
*/
protected $state;
/**
* The HTML for displaying sidebar
*
* @var string
* @since 4.0.0
*/
protected $sidebar;
/**
* The pagination object
*
* @var \JPagination
* @since 4.0.0
*/
protected $pagination;
/**
* Form object for search filters
*
* @var \JForm
* @since 4.0.0
*/
public $filterForm;
/**
* The active search filters
*
* @var array
* @since 4.0.0
*/
public $activeFilters;
/**
* The ID of current workflow
*
* @var integer
* @since 4.0.0
*/
protected $workflowID;
/**
* The name of current extension
*
* @var string
* @since 4.0.0
*/
protected $extension;
/**
* Display the view
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 4.0.0
*/
public function display($tpl = null)
{
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new \JViewGenericdataexception(implode("\n", $errors), 500);
}
$this->state = $this->get('State');
$this->transitions = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->workflowID = $this->state->get('filter.workflow_id');
$this->extension = $this->state->get('filter.extension');
WorkflowHelper::addSubmenu('transitions');
$this->sidebar = \JHtmlSidebar::render();
$this->addToolbar();
return parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 4.0.0
*/
protected function addToolbar()
{
$canDo = ContentHelper::getActions($this->extension, 'workflow', $this->workflowID);
$workflow = !empty($this->state->get('active_workflow', '')) ? Text::_($this->state->get('active_workflow', '')) . ': ' : '';
ToolbarHelper::title(Text::sprintf('COM_WORKFLOW_TRANSITIONS_LIST', $this->escape($workflow)), 'address contact');
if ($canDo->get('core.create'))
{
ToolbarHelper::addNew('transition.add');
}
if ($canDo->get('core.edit.state'))
{
ToolbarHelper::publishList('transitions.publish');
ToolbarHelper::unpublishList('transitions.unpublish');
}
if ($this->state->get('filter.published') === '-2' && $canDo->get('core.delete'))
{
ToolbarHelper::deleteList(Text::_('COM_WORKFLOW_ARE_YOU_SURE'), 'transitions.delete');
}
elseif ($canDo->get('core.edit.state'))
{
ToolbarHelper::trash('transitions.trash');
}
ToolbarHelper::help('JHELP_WORKFLOW_TRANSITIONS_LIST');
}
}
No other release has this exact content. See every version of this file.