Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions administrator/components/com_fields/Helper/FieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Language\Multilanguage;
Expand Down Expand Up @@ -678,56 +677,6 @@ public static function getFieldsPluginId()
return $result;
}

/**
* Configure the Linkbar.
*
* @param string $context The context the fields are used for
* @param string $vName The view currently active
*
* @return void
*
* @since 3.7.0
*/
public static function addSubmenu($context, $vName)
{
$parts = self::extract($context);

if (!$parts)
{
return;
}

$component = $parts[0];

// Avoid nonsense situation.
if ($component == 'com_fields')
{
return;
}

// Try to find the component helper.
$eName = str_replace('com_', '', $component);
$file = Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php');

if (!file_exists($file))
{
return;
}

require_once $file;

$cName = ucfirst($eName) . 'Helper';

if (class_exists($cName) && is_callable(array($cName, 'addSubmenu')))
{
$lang = Factory::getLanguage();
$lang->load($component, JPATH_ADMINISTRATOR)
|| $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component);

$cName::addSubmenu('fields.' . $vName);
}
}

/**
* Loads the fields plugins and returns an array of field types from the plugins.
*
Expand Down
7 changes: 0 additions & 7 deletions administrator/components/com_menus/View/Items/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;

/**
* The HTML Menus Menu Items View.
Expand Down Expand Up @@ -101,12 +100,6 @@ public function display($tpl = null)
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
{
MenusHelper::addSubmenu('items');
}

// Check for errors.
if (count($errors = $this->get('Errors')))
{
Expand Down
3 changes: 0 additions & 3 deletions administrator/components/com_menus/View/Menus/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;

/**
* The HTML Menus Menu Menus View.
Expand Down Expand Up @@ -91,8 +90,6 @@ public function display($tpl = null)
$this->activeFilters = $this->get('ActiveFilters');
}

MenusHelper::addSubmenu('menus');

// Check for errors.
if (count($errors = $this->get('Errors')))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Newsfeeds\Administrator\Helper\NewsfeedsHelper;

/**
* View class for a list of newsfeeds.
Expand Down Expand Up @@ -69,12 +68,6 @@ public function display($tpl = null)
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

// Modal layout doesn't need the submenu.
if ($this->getLayout() !== 'modal')
{
NewsfeedsHelper::addSubmenu('newsfeeds');
}

// Check for errors.
if (count($errors = $this->get('Errors')))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Joomla\CMS\Response\JsonResponse;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\Component\Privacy\Administrator\Helper\PrivacyHelper;
use Joomla\Component\Privacy\Administrator\Model\RequestsModel;

/**
Expand Down Expand Up @@ -94,9 +93,6 @@ public function display($cachable = false, $urlparams = [])
// Push document object into the view.
$view->document = $document;

// Load the submenu.
PrivacyHelper::addSubmenu($this->input->get('view', $this->default_view));

$view->display();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class DisplayController extends BaseController
*/
public function display($cachable = false, $urlparams = false)
{
// Load the submenu.
RedirectHelper::addSubmenu($this->input->get('view', 'links'));

$view = $this->input->get('view', 'links');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');
Expand Down
14 changes: 0 additions & 14 deletions administrator/components/com_redirect/Helper/RedirectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ class RedirectHelper
*/
public static $extension = 'com_redirect';

/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*
* @since 1.6
*/
public static function addSubmenu($vName)
{
// No submenu for this component.
}

/**
* Returns an array of standard published state filter options.
*
Expand Down
40 changes: 1 addition & 39 deletions administrator/components/com_workflow/Helper/WorkflowHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,13 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Helper\ContentHelper;

/**
* The first example class, this is in the same
* package as declared at the start of file but
* this example has a defined subpackage
*
* Workflows component helper
* @since 4.0.0
*/
class WorkflowHelper extends ContentHelper
{
/**
* Configure the Linkbar. Must be implemented by each extension.
*
* @param string $vName The name of the active view.
*
* @return void
*
* @since 3.1
*/
public static function addSubmenu($vName)
{
$extension = Factory::getApplication()->input->getCmd('extension');

$parts = explode('.', $extension);

$component = reset($parts);

$eName = ucfirst(str_replace('com_', '', $component));
$cName = $eName . 'Helper';

$class = '\\Joomla\\Component\\' . $eName . '\\Administrator\\Helper\\' . $cName;

if (class_exists($class) && is_callable([$class, 'addSubmenu']))
{
$lang = Factory::getLanguage();

// Loading language file from the administrator/language directory then
// loading language file from the administrator/components/*extension*/language directory
$lang->load($component, JPATH_BASE, null, false, true)
|| $lang->load($component, Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, true);

call_user_func([$class, 'addSubmenu'], $vName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Workflow\Workflow;
use Joomla\Component\Workflow\Administrator\Helper\WorkflowHelper;

/**
* Stages view class for the Workflow package.
Expand Down Expand Up @@ -127,10 +126,6 @@ public function display($tpl = null)
$this->workflowID = $this->workflow->id;
$this->extension = $this->workflow->extension;

WorkflowHelper::addSubmenu('stages');

$this->sidebar = \JHtmlSidebar::render();

if (!empty($this->stages))
{
$extension = Factory::getApplication()->input->getCmd('extension');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Workflow\Administrator\Helper\WorkflowHelper;

/**
* Workflows view class for the Workflow package.
Expand Down Expand Up @@ -126,10 +125,6 @@ public function display($tpl = null)
$this->workflowID = $this->workflow->id;
$this->extension = $this->workflow->extension;

WorkflowHelper::addSubmenu('transitions');

$this->sidebar = \JHtmlSidebar::render();

$this->addToolbar();

return parent::display($tpl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Workflow\Administrator\Helper\WorkflowHelper;

/**
* Workflows view class for the Workflow package.
Expand Down Expand Up @@ -106,9 +105,6 @@ public function display($tpl = null)

$this->extension = $this->state->get('filter.extension');

WorkflowHelper::addSubmenu($this->state->get('filter.extension'));
$this->sidebar = \JHtmlSidebar::render();

$this->addToolbar();

return parent::display($tpl);
Expand Down