Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/administrator/components/com_moojla/views/healthcheck/ |
| [Home] [System Details] [Kill Me] |
<?php
/*----------------------------------------------------------------------------------|
www.vdm.io |----/
Lmskaran
/-------------------------------------------------------------------------------------------------------/
@version 1.0.77
@build 6th April, 2022
@created 22nd July, 2020
@package Moojla
@subpackage view.html.php
@author Lmskaran <http://Lmskaran.com>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
____ _____ _____ __ __ __ __ ___ _____ __ __ ____
_____ _ _ ____ _ _ ____
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \(
_ )( \( )( ___)( \( )(_ _)
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/
)(_)( ) ( )__) ) ( )(
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__)
(_____)(_)\_)(____)(_)\_) (__)
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Moojla View class for the Healthcheck
*/
class MoojlaViewHealthcheck extends JViewLegacy
{
// Overwriting JView display method
function display($tpl = null)
{
// get component params
$this->params = JComponentHelper::getParams('com_moojla');
// get the application
$this->app = JFactory::getApplication();
// get the user object
$this->user = JFactory::getUser();
// get global action permissions
$this->canDo = MoojlaHelper::getActions('healthcheck');
// Initialise variables.
$this->item = $this->get('Item');
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
{
// add the tool bar
$this->addToolBar();
}
// set the document
$this->setDocument();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode(PHP_EOL, $errors), 500);
}
parent::display($tpl);
}
/**
* Prepares the document
*/
protected function setDocument()
{
// always make sure jquery is loaded.
JHtml::_('jquery.framework');
// Load the header checker class.
require_once(
JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );
// Initialize the header checker.
$HeaderCheck = new moojlaHeaderCheck;
// Add View JavaScript File
$this->document->addScript(JURI::root(true) .
"/administrator/components/com_moojla/assets/js/healthcheck.js",
(MoojlaHelper::jVersion()->isCompatible("3.8.0")) ?
array("version" => "auto") :
"text/javascript");
// add the document default css file
$this->document->addStyleSheet(JURI::root(true)
.'/administrator/components/com_moojla/assets/css/healthcheck.css',
(MoojlaHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
}
/**
* Setting the toolbar
*/
protected function addToolBar()
{
// hide the main menu
$this->app->input->set('hidemainmenu', true);
// set the title
if (isset($this->item->name) && $this->item->name)
{
$title = $this->item->name;
}
// Check for empty title and add view name if param is set
if (empty($title))
{
$title = JText::_('COM_MOOJLA_HEALTHCHECK');
}
// add title to the page
JToolbarHelper::title($title,'health');
// add cpanel button
JToolBarHelper::custom('healthcheck.dashboard',
'grid-2', '', 'COM_MOOJLA_DASH', false);
// set help url for this view if found
$help_url = MoojlaHelper::getHelpUrl('healthcheck');
if (MoojlaHelper::checkString($help_url))
{
JToolbarHelper::help('COM_MOOJLA_HELP_MANAGER', false,
$help_url);
}
// add the options comp button
if ($this->canDo->get('core.admin') ||
$this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_moojla');
}
}
/**
* Escapes a value for output in a view script.
*
* @param mixed $var The output to escape.
*
* @return mixed The escaped value.
*/
public function escape($var)
{
// use the helper htmlEscape method instead.
return MoojlaHelper::htmlEscape($var, $this->_charset);
}
}
?>