| [ Index ] |
PHP Cross Reference of Joomla 2.5.4 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package Joomla.Site 4 * @subpackage com_users 5 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 6 * @license GNU General Public License version 2 or later; see LICENSE.txt 7 */ 8 9 defined('_JEXEC') or die; 10 11 /** 12 * Users Html Helper 13 * 14 * @package Joomla.Site 15 * @subpackage com_users 16 * @since 1.6 17 */ 18 19 abstract class JHtmlUsers 20 { 21 public static function value($value) 22 { 23 if (is_string($value)) { 24 $value = trim($value); 25 } 26 if (empty($value)) { 27 return JText::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); 28 } 29 else { 30 return htmlspecialchars($value); 31 } 32 } 33 public static function spacer($value) 34 { 35 return ''; 36 } 37 38 public static function helpsite($value) 39 { 40 if (empty($value)) 41 { 42 return self::value($value); 43 } 44 else 45 { 46 $version = new JVersion(); 47 $jver = explode( '.', $version->getShortVersion() ); 48 49 $pathToXml = JPATH_ADMINISTRATOR.'/help/helpsites.xml'; 50 51 $text = $value; 52 if (!empty($pathToXml) && $xml = JFactory::getXML($pathToXml)) 53 { 54 foreach ($xml->sites->site as $site) 55 { 56 if ((string)$site->attributes()->url == $value) 57 { 58 $text = (string)$site; 59 break; 60 } 61 } 62 } 63 64 $value = htmlspecialchars($value); 65 if (substr ($value, 0, 4) == "http") { 66 return '<a href="'.$value.'">'.$text.'</a>'; 67 } 68 else { 69 return '<a href="http://'.$value.'">'.$text.'</a>'; 70 } 71 } 72 } 73 74 public static function templatestyle($value) 75 { 76 if (empty($value)) 77 { 78 return self::value($value); 79 } 80 else 81 { 82 $db = JFactory::getDbo(); 83 $query = $db->getQuery(true); 84 $query->select('title'); 85 $query->from('#__template_styles'); 86 $query->where('id = '.$db->quote($value)); 87 $db->setQuery($query); 88 $title = $db->loadResult(); 89 if ($title) { 90 return htmlspecialchars($title); 91 } 92 else { 93 return self::value(''); 94 } 95 } 96 } 97 98 public static function admin_language($value) 99 { 100 if (empty($value)) 101 { 102 return self::value($value); 103 } 104 else 105 { 106 $path = JLanguage::getLanguagePath(JPATH_ADMINISTRATOR, $value); 107 $file = "$value.xml"; 108 109 $result = null; 110 if (is_file("$path/$file")) { 111 $result = JLanguage::parseXMLLanguageFile("$path/$file"); 112 } 113 114 if ($result) { 115 return htmlspecialchars($result['name']); 116 } 117 else { 118 return self::value(''); 119 } 120 } 121 } 122 123 public static function language($value) 124 { 125 if (empty($value)) 126 { 127 return self::value($value); 128 } 129 else 130 { 131 $path = JLanguage::getLanguagePath(JPATH_SITE, $value); 132 $file = "$value.xml"; 133 134 $result = null; 135 if (is_file("$path/$file")) { 136 $result = JLanguage::parseXMLLanguageFile("$path/$file"); 137 } 138 139 if ($result) { 140 return htmlspecialchars($result['name']); 141 } 142 else { 143 return self::value(''); 144 } 145 } 146 } 147 148 public static function editor($value) 149 { 150 if (empty($value)) 151 { 152 return self::value($value); 153 } 154 else 155 { 156 $db = JFactory::getDbo(); 157 $lang = JFactory::getLanguage(); 158 $query = $db->getQuery(true); 159 $query->select('name'); 160 $query->from('#__extensions'); 161 $query->where('element = '.$db->quote($value)); 162 $query->where('folder = '.$db->quote('editors')); 163 $db->setQuery($query); 164 $title = $db->loadResult(); 165 if ($title) 166 { 167 $lang->load("plg_editors_$value.sys", JPATH_ADMINISTRATOR, null, false, false) 168 || $lang->load("plg_editors_$value.sys", JPATH_PLUGINS . '/editors/' . $value, null, false, false) 169 || $lang->load("plg_editors_$value.sys", JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) 170 || $lang->load("plg_editors_$value.sys", JPATH_PLUGINS . '/editors/' . $value, $lang->getDefault(), false, false); 171 $lang->load($title.'.sys'); 172 return JText::_($title); 173 } 174 else 175 { 176 return self::value(''); 177 } 178 } 179 } 180 181 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Apr 3 11:40:28 2012 | Cross-referenced by PHPXref 0.7.1 |