Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
home/lmsyaran/public_html/libraries/osl/View/AbstractView.php000064400000004412151160316400020414
0ustar00<?php
/**
* @package OSL
* @subpackage View
*
* @copyright Copyright (C) 2016 Ossolution Team, Inc. All rights
reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace OSL\View;
use Exception, JText;
use OSL\Container\Container;
use OSL\Model\Model;
/**
* Class AbstractView
*
* Joomla CMS Base View Class
*/
abstract class AbstractView
{
/**
* Name of the view
*
* @var string
*/
protected $name;
/**
* The model object.
*
* @var Model
*/
protected $model;
/**
* Determine the view has a model associated with it or not.
* If set to No, no model will be created and assigned to the view method
when the view is being created
*
* @var boolean
*/
public $hasModel = true;
/**
* Constructor
*
* @param Container $container
* @param array $config
*
* @throws Exception
*/
public function __construct(Container $container, $config = array())
{
$this->container = $container;
// Set the view name
if (isset($config['name']))
{
$this->name = $config['name'];
}
else
{
$className = get_class($this);
$r = null;
if (!preg_match('/(.*)\\\\View\\\\(.*)\\\\(.*)/i', $className,
$r))
{
throw new Exception(JText::_('Could not detect the name from
class' . $className), 500);
}
$this->name = $r[2];
}
if (isset($config['has_model']))
{
$this->hasModel = $config['has_model'];
}
$this->initialize();
}
/**
* Get name of the current view
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set the model object
*
* @param Model $model
*/
public function setModel(Model $model)
{
$this->model = $model;
}
/**
* Get the model object
*
* @return Model
*/
public function getModel()
{
return $this->model;
}
/**
* Method to escape output.
*
* @param string $output The output to escape.
*
* @return string The escaped output.
*
*/
public function escape($output)
{
return $output;
}
/**
* This blank method give child class a chance to init the class further
after being constructed
*/
protected function initialize()
{
}
}home/lmsyaran/public_html/j3/htaccess.back/osl/View/AbstractView.php000064400000004412151162210260021447
0ustar00<?php
/**
* @package OSL
* @subpackage View
*
* @copyright Copyright (C) 2016 Ossolution Team, Inc. All rights
reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace OSL\View;
use Exception, JText;
use OSL\Container\Container;
use OSL\Model\Model;
/**
* Class AbstractView
*
* Joomla CMS Base View Class
*/
abstract class AbstractView
{
/**
* Name of the view
*
* @var string
*/
protected $name;
/**
* The model object.
*
* @var Model
*/
protected $model;
/**
* Determine the view has a model associated with it or not.
* If set to No, no model will be created and assigned to the view method
when the view is being created
*
* @var boolean
*/
public $hasModel = true;
/**
* Constructor
*
* @param Container $container
* @param array $config
*
* @throws Exception
*/
public function __construct(Container $container, $config = array())
{
$this->container = $container;
// Set the view name
if (isset($config['name']))
{
$this->name = $config['name'];
}
else
{
$className = get_class($this);
$r = null;
if (!preg_match('/(.*)\\\\View\\\\(.*)\\\\(.*)/i', $className,
$r))
{
throw new Exception(JText::_('Could not detect the name from
class' . $className), 500);
}
$this->name = $r[2];
}
if (isset($config['has_model']))
{
$this->hasModel = $config['has_model'];
}
$this->initialize();
}
/**
* Get name of the current view
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set the model object
*
* @param Model $model
*/
public function setModel(Model $model)
{
$this->model = $model;
}
/**
* Get the model object
*
* @return Model
*/
public function getModel()
{
return $this->model;
}
/**
* Method to escape output.
*
* @param string $output The output to escape.
*
* @return string The escaped output.
*
*/
public function escape($output)
{
return $output;
}
/**
* This blank method give child class a chance to init the class further
after being constructed
*/
protected function initialize()
{
}
}