- md5
- 193666791ed3e30291c17cf70c0e56a3
- sha1
- ab0a1ba64222a441a4275fa7edbeb9aafe2e691d
- sha256
- 74b7b941a64c28455b3933b83abfff58d889559b0934ff19848c363ab64ecce7
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Users Html Helper
*
* @package Joomla.Site
* @subpackage com_users
* @since 1.6
*/
abstract class JHtmlUsers
{
public static function value($value)
{
if (is_string($value))
{
$value = trim($value);
}
if (empty($value))
{
return JText::_('COM_USERS_PROFILE_VALUE_NOT_FOUND');
}
elseif (!is_array($value))
{
return htmlspecialchars($value);
}
}
public static function spacer($value)
{
return '';
}
public static function helpsite($value)
{
if (empty($value))
{
return static::value($value);
}
else
{
$pathToXml = JPATH_ADMINISTRATOR . '/help/helpsites.xml';
$text = $value;
if (!empty($pathToXml) && $xml = simplexml_load_file($pathToXml))
{
foreach ($xml->sites->site as $site)
{
if ((string) $site->attributes()->url == $value)
{
$text = (string) $site;
break;
}
}
}
$value = htmlspecialchars($value);
if (substr($value, 0, 4) == "http")
{
return '<a href="' . $value . '">' . $text . '</a>';
}
else
{
return '<a href="http://' . $value . '">' . $text . '</a>';
}
}
}
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, true)
|| $lang->load("plg_editors_$value.sys", JPATH_PLUGINS . '/editors/' . $value, null, false, true);
$lang->load($title . '.sys');
return JText::_($title);
}
else
{
return static::value('');
}
}
}
}
The same content is in 2 releases, Joomla 3.2.0 to 3.2.1. See them all, or every version of this file.