getQuery(true) ->select('DISTINCT(folder) AS value, folder AS text') ->from('#__extensions') ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) ->order('folder'); $db->setQuery($query); try { $options = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); } return $options; } /** * Parse the template file. * * @param string $templateBaseDir Base path to the template directory. * @param string $templateDir Template directory. * * @return JObject */ public function parseXMLTemplateFile($templateBaseDir, $templateDir) { $data = new JObject; // Check of the xml file exists. $filePath = JPath::clean($templateBaseDir . '/templates/' . $templateDir . '/templateDetails.xml'); if (is_file($filePath)) { $xml = JInstaller::parseXMLInstallFile($filePath); if ($xml['type'] != 'template') { return false; } foreach ($xml as $key => $value) { $data->set($key, $value); } } return $data; } }