Current Path :
/
home
/
develito
/
www
/
components
/
com_abook
/
models
/
fields
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/www/components/com_abook/models/fields/authors_no.php
<?php /** * @package Joomla * @subpackage Abook * @copyright (C) 2010-2019 Federica Ugolotti * @license GNU/GPL, see LICENSE.php * Abook is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License 3 * as published by the Free Software Foundation. * Abook is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with Abook; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // no direct access defined('_JEXEC') or die; jimport('joomla.html.html'); jimport('joomla.form.formfield'); jimport('joomla.form.helper'); JFormHelper::loadFieldClass('list'); class JFormFieldAbauthorslist extends JFormFieldList { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'abauthorslist'; /** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ public function getOptions() { // Initialize variables. $options = array(); $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('CONCAT(a.lastname, " ", a.name) AS text, a.id AS value'); $query->from('#__abauthor AS a'); $query->join('#__abbookauth AS ba ON ba.idauth=b.id'); $query->join('#__abbook AS b ON b.id=ba.idbook'); $query->join('#__abcategories AS c ON c.id=b.catid'); $query->where(); $query->order('weather_name'); // Get the options. $db->setQuery($query); try { $options = $db->loadObjectList(); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); } array_unshift($options, JHtml::_('select.option', '0', JText::_('COM_PHPMYSPORT_SELECT'))); return $options; } }