Source for file raw.php
Documentation is available at raw.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
* FrameworkOnFramework raw output class. It works like an HTML view, but the
* @package FrameworkOnFramework
/** @var array Data lists */
/** @var array Permissions map */
* @param array $config Configuration parameters
// Make sure $config is an array
$config = (array)
$config;
if ($config['input'] instanceof
FOFInput)
$this->input =
$config['input'];
'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);
* @param string $tpl The template to use
* @return boolean|nullFalse if we can't render anything
public function display($tpl =
null)
// Get the task set in the model
$task =
$model->getState('task', 'browse');
// Call the relevant method
$method_name =
'on' .
ucfirst($task);
$result =
$this->$method_name($tpl);
* Last chance to output something before rendering the view template
* Last chance to output something after rendering the view template and
* before returning to the caller
* Executes before rendering the page for the Browse task.
* @param string $tpl Subtemplate to use
* @return boolean Return true to allow rendering of the page
protected function onBrowse($tpl =
null)
// When in interactive browsing mode, save the state to the session
* Executes before rendering a generic page, default to actions necessary
* @param string $tpl Subtemplate to use
* @return boolean Return true to allow rendering of the page
$view =
$this->input->getCmd('view', 'cpanel');
if (in_array($view, array('cpanel', 'cpanels')))
$this->lists->set('order', $model->getState('filter_order', 'id', 'cmd'));
$this->lists->set('order_Dir', $model->getState('filter_order_Dir', 'DESC', 'cmd'));
// Assign data to the view
$this->assign('items', $model->getItemList());
$this->assign('pagination', $model->getPagination());
// Pass page params on frontend only
* Executes before rendering the page for the Add task.
* @param string $tpl Subtemplate to use
* @return boolean Return true to allow rendering of the page
protected function onAdd($tpl =
null)
$this->assign('item', $model->getItem());
* Executes before rendering the page for the Edit task.
* @param string $tpl Subtemplate to use
* @return boolean Return true to allow rendering of the page
protected function onEdit($tpl =
null)
// An editor is an editor, no matter if the record is new or old :p
* Executes before rendering the page for the Read task.
* @param string $tpl Subtemplate to use
* @return boolean Return true to allow rendering of the page
protected function onRead($tpl =
null)
// All I need is to read the record
* Determines if the current Joomla! version and your current table support
* AJAX-powered drag and drop reordering. If they do, it will set up the
* drag & drop reordering feature.
* @return boolean|array False if not suported, a table with necessary
* information (saveOrder: should you enabled DnD
* reordering; orderingColumn: which column has the
$orderingColumn =
$table->getColumnAlias('ordering');
$fields =
$table->getTableFields();
$listOrder =
$this->escape($model->getState('filter_order', null, 'cmd'));
$listDirn =
$this->escape($model->getState('filter_order_Dir', 'ASC', 'cmd'));
$saveOrder =
$listOrder ==
$orderingColumn;
$saveOrderingUrl =
'index.php?option=' .
$this->config['option'] .
'&view=' .
$this->config['view'] .
'&task=saveorder&format=json';
JHtml::_('sortablelist.sortable', 'itemsList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
'saveOrder' =>
$saveOrder,
'orderingColumn' =>
$orderingColumn
* Returns the internal list of useful variables to the benefit of
* Returns a reference to the permissions object of this view
Documentation generated on Tue, 19 Nov 2013 15:11:35 +0100 by phpDocumentor 1.4.3