Current Path :
/
home
/
develito
/
public_html
/
modules
/
mod_otminitabs
/
elements
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/public_html/modules/mod_otminitabs/elements/modules.php
<?php /** * @package OT Mini Tabs for Joomla! 3.x * @version $Id: modules.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 defined( '_JEXEC' ) or die( 'Restricted access' ); jimport('joomla.html.html'); jimport('joomla.form.formfield'); class JFormFieldModules extends JFormField { protected $type = 'Modules'; //the form field type protected function getInput() { // Initialize variables. $html = array(); $attr = ''; $options = array(); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('id, title, module, position'); $query->from('#__modules AS m'); $query->where('m.client_id = 0 AND m.published = 1 AND m.module <> "mod_otminitabs"'); $query->order('position, ordering'); $db->setQuery($query); if (!($modules = $db->loadObjectList())) { JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $db->getErrorMsg())); return false; } foreach($modules as $module){ $options[] = JHtml::_('select.option', $module->id, $module->title . ' (' . $module->module . ')'); } //array_unshift ( $options, JHTML::_('select.option', '', JText::_('SELECT'), 'value', 'text', false)); $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', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); return implode($html); } }