CoreFiles by mySites.guru
WorkflowHelper.php61 lines, 1,690 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
72ed55dc33cfe34fa77e70dea106ca08
sha1
5286ea927d55e5322789686a4489f572757b1159
sha256
b40ec496c7471d911d6361dd5e468b1686c09e007b743dc51077808a44215b6e
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_workflow
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Workflow\Administrator\Helper;

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
 *
 * @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);
		}
	}
}

The same content is in 3 releases, Joomla 4.0.0-alpha10 to 4.0.0-alpha12. See them all, or every version of this file.