Current Path :
/
home
/
develito
/
httpdocs
/
modules
/
mod_otminitabs
/
elements
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/httpdocs/modules/mod_otminitabs/elements/articles.php
<?php /** * @package OT Mini Tabs for Joomla! 3.x * @version $Id: articles.php - May 2014 00:00:00Z OmegaTheme * @author OmegaTheme Extensions (services@omegatheme.com) - http://omegatheme.com * @copyright Copyright(C) 2012 - OmegaTheme Extensions * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL **/ // no direct access // 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); } }