- md5
- be400a25e9079f558b15ead13ed2c84b
- sha1
- 42abb255dd026991e03a4d869250cfbc1a91492e
- sha256
- e0a150d6eb3b05808fbb779d1b4ede8f42788bb1842361a3bb043291acca3bf9
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
<?php
/**
* @package FrameworkOnFramework
* @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Protect from unauthorized access
defined('_JEXEC') or die;
JLoader::import('joomla.application.component.view');
/**
* FrameworkOnFramework HTML output class. Together with PHP-based view tempalates
* it will render your data into an HTML representation.
*
* @package FrameworkOnFramework
* @since 2.1
*/
class FOFViewHtml extends FOFViewRaw
{
/**
* Class constructor
*
* @param array $config Configuration parameters
*/
public function __construct($config = array())
{
// Make sure $config is an array
if (is_object($config))
{
$config = (array) $config;
}
elseif (!is_array($config))
{
$config = array();
}
parent::__construct($config);
$this->config = $config;
// Get the input
if (array_key_exists('input', $config))
{
if ($config['input'] instanceof FOFInput)
{
$this->input = $config['input'];
}
else
{
$this->input = new FOFInput($config['input']);
}
}
else
{
$this->input = new FOFInput;
}
$this->lists = new JObject;
if (!FOFPlatform::getInstance()->isCli())
{
$platform = FOFPlatform::getInstance();
$perms = (object) array(
'create' => $platform->authorise('core.create', $this->input->getCmd('option', 'com_foobar')),
'edit' => $platform->authorise('core.edit', $this->input->getCmd('option', 'com_foobar')),
'editstate' => $platform->authorise('core.edit.state', $this->input->getCmd('option', 'com_foobar')),
'delete' => $platform->authorise('core.delete', $this->input->getCmd('option', 'com_foobar')),
);
$this->assign('aclperms', $perms);
$this->perms = $perms;
}
}
/**
* Renders the link bar (submenu) using Joomla!'s default
* JSubMenuHelper::addEntry method
*
* @return void
*/
protected function renderLinkbar()
{
// Do not render a submenu unless we are in the the admin area
if (!FOFPlatform::getInstance()->isBackend() || FOFPlatform::getInstance()->isCli())
{
return;
}
$toolbar = FOFToolbar::getAnInstance($this->input->getCmd('option', 'com_foobar'), $this->config);
$links = $toolbar->getLinks();
if (!empty($links))
{
foreach ($links as $link)
{
JSubMenuHelper::addEntry($link['name'], $link['link'], $link['active']);
}
}
}
/**
* Runs before rendering the view template, echoing HTML to put before the
* view template's generated HTML
*
* @return void
*/
protected function preRender()
{
$view = $this->input->getCmd('view', 'cpanel');
$task = $this->getModel()->getState('task', 'browse');
// Don't load the toolbar on CLI
if (!FOFPlatform::getInstance()->isCli())
{
$toolbar = FOFToolbar::getAnInstance($this->input->getCmd('option', 'com_foobar'), $this->config);
$toolbar->perms = $this->perms;
$toolbar->renderToolbar($view, $task, $this->input);
}
$renderer = $this->getRenderer();
if (!($renderer instanceof FOFRenderAbstract))
{
$this->renderLinkbar();
}
else
{
$renderer->preRender($view, $task, $this->input, $this->config);
}
}
/**
* Runs after rendering the view template, echoing HTML to put after the
* view template's generated HTML
*
* @return void
*/
protected function postRender()
{
$view = $this->input->getCmd('view', 'cpanel');
$task = $this->getModel()->getState('task', 'browse');
$renderer = $this->getRenderer();
if ($renderer instanceof FOFRenderAbstract)
{
$renderer->postRender($view, $task, $this->input, $this->config);
}
}
}
No other release has this exact content. See every version of this file.