Your IP : 216.73.216.68


Current Path : /home/jeromecohp/www/administrator/components/com_emailbeautifier/views/cp/
Upload File :
Current File : /home/jeromecohp/www/administrator/components/com_emailbeautifier/views/cp/view.html.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\MVC\View\HtmlView;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\ToolbarHelper;

jimport('joomla.application.component.view');

/**
 * View class for dashboard
 *
 * @package     EmailBeautifier
 * @subpackage  com_emailbeautifier
 * @since       1.0
 */
class EmailbeautifierViewcp extends HtmlView
{
	/**
	 * Display the view
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  void
	 */
	public function display($tpl = null)
	{
		// Get download id
		$params = ComponentHelper::getParams('com_emailbeautifier');
		$this->downloadid = $params->get('downloadid');

		// Get model
		$model = $this->getModel();

		// Get installed version from xml file
		$xml     = Factory::getXML(JPATH_COMPONENT . '/emailbeautifier.xml');
		$version = (string) $xml->version;
		$this->version = $version;

		// Refresh update site
		$model->refreshUpdateSite();

		// Get new version
		$this->latestVersion = $model->getLatestVersion();

		EmailbeautifierHelper::addSubmenu('cp');

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

		$this->addToolbar();

		parent::display($tpl);
	}

	/**
	 * Add the page title and toolbar.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function addToolbar ()
	{
		ToolbarHelper::title(Text::_('COM_EMAILBEAUTIFIER'), 'brush');

		$canDo = EmailbeautifierHelper::getActions();

		if ($canDo->get('core.admin'))
		{
			ToolbarHelper::preferences('com_emailbeautifier');
		}

		// Set sidebar action
		JHtmlSidebar::setAction('index.php?option=com_tjfields&view=cp');

		$this->extra_sidebar = '';
	}
}