CoreFiles by mySites.guru
WorkflowHelper.php60 lines, 1,660 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
b788ca3fdaf67e832fc58753b2b23b56
sha1
67f00d29bfabbb1aaa8e94b6d61cc100781eda60
sha256
f7a9d9df9dad4c29563f680916837934e6b696bc58acf164cd94c757c621ce43
<?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\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, \JPath::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-alpha7 to 4.0.0-alpha9. See them all, or every version of this file.