sites->site as $site) { if ((string) $site->attributes()->url == $value) { $text = (string) $site; break; } } } $value = htmlspecialchars($value); if (substr($value, 0, 4) == "http") { return '' . $text . ''; } else { return '' . $text . ''; } } } public static function templatestyle($value) { if (empty($value)) { return static::value($value); } else { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('title') ->from('#__template_styles') ->where('id = ' . $db->quote($value)); $db->setQuery($query); $title = $db->loadResult(); if ($title) { return htmlspecialchars($title); } else { return static::value(''); } } } public static function admin_language($value) { if (empty($value)) { return static::value($value); } else { $path = JLanguage::getLanguagePath(JPATH_ADMINISTRATOR, $value); $file = "$value.xml"; $result = null; if (is_file("$path/$file")) { $result = JLanguage::parseXMLLanguageFile("$path/$file"); } if ($result) { return htmlspecialchars($result['name']); } else { return static::value(''); } } } public static function language($value) { if (empty($value)) { return static::value($value); } else { $path = JLanguage::getLanguagePath(JPATH_SITE, $value); $file = "$value.xml"; $result = null; if (is_file("$path/$file")) { $result = JLanguage::parseXMLLanguageFile("$path/$file"); } if ($result) { return htmlspecialchars($result['name']); } else { return static::value(''); } } } public static function editor($value) { if (empty($value)) { return static::value($value); } else { $db = JFactory::getDbo(); $lang = JFactory::getLanguage(); $query = $db->getQuery(true) ->select('name') ->from('#__extensions') ->where('element = ' . $db->quote($value)) ->where('folder = ' . $db->quote('editors')); $db->setQuery($query); $title = $db->loadResult(); if ($title) { $lang->load("plg_editors_$value.sys", JPATH_ADMINISTRATOR, null, false, false) || $lang->load("plg_editors_$value.sys", JPATH_PLUGINS . '/editors/' . $value, null, false, false) || $lang->load("plg_editors_$value.sys", JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load("plg_editors_$value.sys", JPATH_PLUGINS . '/editors/' . $value, $lang->getDefault(), false, false); $lang->load($title . '.sys'); return JText::_($title); } else { return static::value(''); } } } }