Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #70 from joomla-projects/publish_parameter
Browse files Browse the repository at this point in the history
Show workflow menu only if the parameter is activated
  • Loading branch information
bembelimen authored Sep 8, 2017
2 parents 63380cd + 30c0353 commit 53a791e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 66 deletions.
38 changes: 21 additions & 17 deletions administrator/components/com_content/Helper/ContentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,32 @@ public static function addSubmenu($vName)
'index.php?option=com_categories&extension=com_content',
$vName == 'categories'
);
\JHtmlSidebar::addEntry(
\JText::_('COM_CONTENT_SUBMENU_WORKFLOW'),
'index.php?option=com_workflow&extension=com_content',
$vName == 'workflows'
);

if ($vName == 'states' || $vName == 'transitions')
if (\JComponentHelper::isEnabled('com_workflow') && \JComponentHelper::getParams('com_content')->get('workflows_enable', 1))
{
$app = Factory::getApplication();
$workflowID = $app->getUserStateFromRequest('filter.workflow_id', 'workflow_id', 1, 'int');

\JHtmlSidebar::addEntry(
\JText::_('COM_WORKFLOW_STATE'),
'index.php?option=com_workflow&view=states&workflow_id=' . $workflowID . "&extension=com_content",
$vName == 'states`'
\JText::_('COM_CONTENT_SUBMENU_WORKFLOW'),
'index.php?option=com_workflow&extension=com_content',
$vName == 'workflows'
);

\JHtmlSidebar::addEntry(
\JText::_('COM_WORKFLOW_TRANSITION'),
'index.php?option=com_workflow&view=transitions&workflow_id=' . $workflowID . "&extension=com_content",
$vName == 'transitions'
);
if ($vName == 'states' || $vName == 'transitions')
{
$app = Factory::getApplication();
$workflowID = $app->getUserStateFromRequest('filter.workflow_id', 'workflow_id', 1, 'int');

\JHtmlSidebar::addEntry(
\JText::_('COM_WORKFLOW_STATE'),
'index.php?option=com_workflow&view=states&workflow_id=' . $workflowID . "&extension=com_content",
$vName == 'states`'
);

\JHtmlSidebar::addEntry(
\JText::_('COM_WORKFLOW_TRANSITION'),
'index.php?option=com_workflow&view=transitions&workflow_id=' . $workflowID . "&extension=com_content",
$vName == 'transitions'
);
}
}

\JHtmlSidebar::addEntry(
Expand Down
Loading

0 comments on commit 53a791e

Please sign in to comment.