Current Path :
/
home
/
develito
/
httpdocs
/
modules
/
mod_jptabs
/
elements
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/httpdocs/modules/mod_jptabs/elements/articles.php
<?php /** * @package JP Extensions * @subpackage mod_jptabs * * @copyright Copyright (C) 2005 - 2015 JoomPortal.Com. All rights reserved. * @license GNU General Public License version 2 or later. */ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.html.html'); jimport('joomla.form.formfield'); class JFormFieldArticles extends JFormField { protected $type = 'Articles'; //the form field type protected function getInput() { // Initialize variables. $html = array(); $attr = ''; $options = array(); $db = JFactory::getDbo(); $db->setQuery( 'SELECT `id` as value, `title` as text FROM #__content;' ); try { $articles = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); } if (empty($articles)) $articles = array(); $attr .= $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : ''; $attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : ''; $attr .= $this->multiple ? ' multiple="multiple"' : ''; // Create a regular list. $html[] = JHtml::_('select.genericlist', $articles, $this->name, $attr, 'value', 'text', $this->value, $this->id); return implode("\n", $html); } }