getQuery(true); $query->select('id, title, module, position'); $query->from('#__modules AS m'); $query->where('m.client_id = 0'); $query->order('position, ordering'); // Set the query $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 . ')'); } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } }