Source for file fieldsql.php
Documentation is available at fieldsql.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
* Generic field header, with drop down filters based on a SQL query
* @package FrameworkOnFramework
* Create objects for the options
* @return array The array of option objects
// Initialize some field attributes.
$key =
$this->element['key_field'] ? (string)
$this->element['key_field'] :
'value';
$value =
$this->element['value_field'] ? (string)
$this->element['value_field'] : (string)
$this->element['name'];
$translate =
$this->element['translate'] ? (string)
$this->element['translate'] :
false;
$query = (string)
$this->element['query'];
// Get the database object.
// Set the query and get the result list.
$items =
$db->loadObjectlist();
// Build the field options.
foreach ($items as $item)
$options[] =
JHtml::_('select.option', $item->$key, JText::_($item->$value));
$options[] =
JHtml::_('select.option', $item->$key, $item->$value);
// Merge any additional options in the XML definition.
Documentation generated on Tue, 19 Nov 2013 15:03:00 +0100 by phpDocumentor 1.4.3