Your IP : 216.73.216.229


Current Path : /home/jeromecohp/www/administrator/components/com_emailbeautifier/helpers/
Upload File :
Current File : /home/jeromecohp/www/administrator/components/com_emailbeautifier/helpers/emailbeautifier.php

<?php
/**
 * @package     EmailBeautifier
 * @subpackage  com_emailbeautifier
 *
 * @author      Techjoomla <extensions@techjoomla.com>
 * @copyright   Copyright (C) 2009 - 2022 Techjoomla. All rights reserved.
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */

// No direct access.
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Language\Text;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Factory;

/**
 * EmailBeautifier component helper.
 *
 * @package     EmailBeautifier
 * @subpackage  com_emailbeautifier
 * @since       1.6
 */
class EmailbeautifierHelper
{
	/**
	 * Configure the Linkbar.
	 *
	 * @param   string  $vName  The name of the active view.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	public static function addSubmenu($vName)
	{
		$cp        = 'index.php?option=com_emailbeautifier&view=cp';
		$templates = 'index.php?option=com_emailbeautifier&view=templates';

		if ($vName !== 'template')
		{
			JHtmlSidebar::addEntry(Text::_('COM_EMAILBEAUTIFIER_CP'), $cp, $vName == 'cp');
			JHtmlSidebar::addEntry(Text::_('COM_EMAILBEAUTIFIER_MANAGE_TEMPLATE'), $templates, $vName == 'templates');
		}
		else
		{
			if ($vName !== 'template')
			{
				JSubMenuHelper::addEntry(Text::_('COM_EMAILBEAUTIFIER_CP'), $cp, $vName == 'cp');
				JSubMenuHelper::addEntry(Text::_('COM_EMAILBEAUTIFIER_MANAGE_TEMPLATE'), $templates, $vName == 'templates');
			}
		}
	}

	/**
	 * Gets a list of the actions that can be performed.
	 *
	 * @return  CMSObject
	 *
	 * @since  1.6
	 */
	public static function getActions()
	{
		$user       = Factory::getUser();
		$result     = new CMSObject;

		$assetName  = 'com_emailbeautifier';

		$actions    = array(
			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.edit.state', 'core.delete'
		);

		foreach ($actions as $action)
		{
			$result->set($action, $user->authorise($action, $assetName));
		}

		return $result;
	}
}