| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @version $Id: admin.admin.html.php 18162 2010-07-16 07:00:47Z ian $ 4 * @package Joomla 5 * @subpackage Admin 6 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. 7 * @license GNU/GPL, see LICENSE.php 8 * Joomla! is free software. This version may have been modified pursuant 9 * to the GNU General Public License, and as distributed it includes or 10 * is derivative of works licensed under the GNU General Public License or 11 * other free or open source software licenses. 12 * See COPYRIGHT.php for copyright notices and details. 13 */ 14 15 // no direct access 16 defined( '_JEXEC' ) or die( 'Restricted access' ); 17 18 /** 19 * @package Joomla 20 * @subpackage Admin 21 */ 22 class HTML_admin_misc 23 { 24 function get_php_setting($val) 25 { 26 $r = (ini_get($val) == '1' ? 1 : 0); 27 return $r ? JText::_( 'ON' ) : JText::_( 'OFF' ) ; 28 } 29 30 function get_server_software() 31 { 32 if (isset($_SERVER['SERVER_SOFTWARE'])) { 33 return $_SERVER['SERVER_SOFTWARE']; 34 } else if (($sf = getenv('SERVER_SOFTWARE'))) { 35 return $sf; 36 } else { 37 return JText::_( 'n/a' ); 38 } 39 } 40 41 function system_info( ) 42 { 43 global $mainframe; 44 45 //Load switcher behavior 46 JHTML::_('behavior.switcher'); 47 48 $db =& JFactory::getDBO(); 49 50 $contents = ''; 51 ob_start(); 52 require_once (JPATH_COMPONENT.DS.'tmpl'.DS.'navigation.php'); 53 $contents = ob_get_contents(); 54 ob_clean(); 55 56 $document =& JFactory::getDocument(); 57 $document->setBuffer($contents, 'modules', 'submenu'); 58 ?> 59 <form action="index.php" method="post" name="adminForm"> 60 61 <div id="config-document"> 62 <div id="page-site"> 63 <table class="noshow"> 64 <tr> 65 <td> 66 <?php require_once (JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_system.php'); ?> 67 </td> 68 </tr> 69 </table> 70 </div> 71 72 <div id="page-phpsettings"> 73 <table class="noshow"> 74 <tr> 75 <td> 76 <?php require_once (JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_phpsettings.php'); ?> 77 </td> 78 </tr> 79 </table> 80 </div> 81 82 <div id="page-config"> 83 <table class="noshow"> 84 <tr> 85 <td> 86 <?php require_once (JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_config.php'); ?> 87 </td> 88 </tr> 89 </table> 90 </div> 91 92 <div id="page-directory"> 93 <table class="noshow"> 94 <tr> 95 <td> 96 <?php require_once (JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_directory.php'); ?> 97 </td> 98 </tr> 99 </table> 100 </div> 101 102 <div id="page-phpinfo"> 103 <table class="noshow"> 104 <tr> 105 <td> 106 <?php require_once (JPATH_COMPONENT.DS.'tmpl'.DS.'sysinfo_phpinfo.php'); ?> 107 </td> 108 </tr> 109 </table> 110 </div> 111 </div> 112 113 <div class="clr"></div> 114 <?php 115 } 116 117 /** 118 * Display Help Page 119 * 120 * For this method the important two scenarios are local or remote help files. 121 * In the case of local help files the language tag will be added in order to 122 * allow different languages of help.<br /> 123 * In case of the remote server it is assumed that this server provide one specific 124 * help set of files in one particular language. 125 */ 126 function help() 127 { 128 global $mainframe; 129 jimport( 'joomla.filesystem.folder' ); 130 jimport( 'joomla.language.help' ); 131 132 // Get Help URL - an empty helpurl is interpreted as local help files! 133 $helpurl = $mainframe->getCfg('helpurl'); 134 if ( $helpurl == 'http://help.mamboserver.com' ) { 135 $helpurl = 'http://help.joomla.org'; 136 } 137 $fullhelpurl = $helpurl . '/index2.php?option=com_content&task=findkey&pop=1&keyref='; 138 139 $helpsearch = JRequest::getString('helpsearch'); 140 $helpsearch = str_replace(array('=', '<', '"'), '', $helpsearch); 141 142 $page = JRequest::getCmd('page', 'joomla.whatsnew15.html'); 143 $toc = getHelpToc( $helpsearch ); 144 $lang =& JFactory::getLanguage(); 145 $langTag = $lang->getTag(); 146 if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) { 147 $langTag = 'en-GB'; // use english as fallback 148 } 149 150 if (!preg_match( '#\.html$#i', $page )) { 151 $page .= '.xml'; 152 } 153 ?> 154 <form action="index.php?option=com_admin&task=help" method="post" name="adminForm"> 155 156 <table class="adminform" border="1"> 157 <tr> 158 <td colspan="2"> 159 <table width="100%"> 160 <tr> 161 <td> 162 <strong><?php echo JText::_( 'Search' ); ?>:</strong> 163 <input class="text_area" type="hidden" name="option" value="com_admin" /> 164 <input type="text" name="helpsearch" value="<?php echo htmlspecialchars($helpsearch);?>" class="inputbox" /> 165 <input type="submit" value="<?php echo JText::_( 'Go' ); ?>" class="button" /> 166 <input type="button" value="<?php echo JText::_( 'Clear Results' ); ?>" class="button" onclick="f=document.adminForm;f.helpsearch.value='';f.submit()" /> 167 </td> 168 <td class="helpMenu"> 169 <?php 170 if ($helpurl) { 171 ?> 172 <?php echo JHTML::_('link', JHelp::createUrl( 'joomla.glossary' ), JText::_( 'Glossary' ), array('target' => 'helpFrame')) ?> 173 | 174 <?php echo JHTML::_('link', JHelp::createUrl( 'joomla.credits' ), JText::_( 'Credits' ), array('target' => 'helpFrame')) ?> 175 | 176 <?php echo JHTML::_('link', JHelp::createUrl( 'joomla.support' ), JText::_( 'Support' ), array('target' => 'helpFrame')) ?> 177 <?php 178 } else { 179 ?> 180 <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Glossary&printable=true', JText::_( 'Glossary' ), array('target' => 'helpFrame')) ?> | 181 <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Joomla.credits.15&printable=true', JText::_( 'Credits' ), array('target' => 'helpFrame')) ?> | 182 <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Joomla.support.15&printable=true', JText::_( 'Support' ), array('target' => 'helpFrame')) ?> 183 <?php } ?> 184 | 185 <?php echo JHTML::_('link', 'http://www.gnu.org/licenses/gpl-2.0.html', JText::_( 'License' ), array('target' => 'helpFrame')) ?> 186 | 187 <?php echo JHTML::_('link', 'http://docs.joomla.org', 'docs.joomla.org', array('target' => 'helpFrame')) ?> 188 | 189 <?php echo JHTML::_('link', 'index.php?option=com_admin&task=changelog&tmpl=component', JText::_( 'Changelog' ), array('target' => 'helpFrame')) ?> 190 | 191 <?php echo JHTML::_('link', 'http://docs.joomla.org/index.php?title=Joomla_1.5_version_history&printable=true', JText::_( 'Latest Version Check' ), array('target' => 'helpFrame')) ?> 192 </td> 193 </tr> 194 </table> 195 </td> 196 </tr> 197 </table> 198 199 <div id="treecellhelp"> 200 <fieldset title="<?php echo JText::_( 'Alphabetical Index' ); ?>"> 201 <legend> 202 <?php echo JText::_( 'Alphabetical Index' ); ?> 203 </legend> 204 205 <div class="helpIndex"> 206 <ul class="subext"> 207 <?php 208 foreach ($toc as $k=>$v) { 209 if ($helpurl) { 210 echo '<li>'; 211 echo JHTML::_('link', JHelp::createUrl( $k ), $v, array('target' => 'helpFrame')); 212 echo '</li>'; 213 } else { 214 echo '<li>'; 215 echo JHTML::_('link', JURI::base() .'help/'.$langTag.'/'.$k, $v, array('target' => 'helpFrame')); 216 echo '</li>'; 217 } 218 } 219 ?> 220 </ul> 221 </div> 222 </fieldset> 223 </div> 224 225 <div id="datacellhelp"> 226 <fieldset title="<?php echo JText::_( 'View' ); ?>"> 227 <legend> 228 <?php echo JText::_( 'View' ); ?> 229 </legend> 230 <?php 231 if ($helpurl && $page != 'joomla.whatsnew15.html') { 232 ?> 233 <iframe name="helpFrame" src="<?php echo $fullhelpurl .preg_replace( '#\.xml$|\.html$#', '', $page );?>" class="helpFrame" frameborder="0"></iframe> 234 <?php 235 } else { 236 ?> 237 <iframe name="helpFrame" src="<?php echo JURI::base() .'help/' .$langTag. '/' . $page;?>" class="helpFrame" frameborder="0"></iframe> 238 <?php 239 } 240 ?> 241 </fieldset> 242 </div> 243 244 <input type="hidden" name="task" value="help" /> 245 </form> 246 <?php 247 } 248 249 /* 250 * Displays contents of Changelog.php file 251 */ 252 function changelog() 253 { 254 ?> 255 <pre> 256 <?php 257 ob_start(); 258 readfile( JPATH_SITE.DS.'CHANGELOG.php' ); 259 $changelog = ob_get_contents(); 260 ob_clean(); 261 262 // Strip php tag 263 $changelog = preg_replace('/\<\?php[^\?]*\?\>/','',$changelog); 264 265 // Convert all other HTML entities 266 echo htmlentities($changelog); 267 ?> 268 </pre> 269 <?php 270 } 271 } 272 273 function writableCell( $folder, $relative=1, $text='', $visible=1 ) 274 { 275 $writeable = '<b><font color="green">'. JText::_( 'Writable' ) .'</font></b>'; 276 $unwriteable = '<b><font color="red">'. JText::_( 'Unwritable' ) .'</font></b>'; 277 278 echo '<tr>'; 279 echo '<td class="item">'; 280 echo $text; 281 if ( $visible ) { 282 echo $folder . '/'; 283 } 284 echo '</td>'; 285 echo '<td >'; 286 if ( $relative ) { 287 echo is_writable( "../$folder" ) ? $writeable : $unwriteable; 288 } else { 289 echo is_writable( "$folder" ) ? $writeable : $unwriteable; 290 } 291 echo '</td>'; 292 echo '</tr>'; 293 } 294 295 /** 296 * Compiles the help table of contents 297 * @param string A specific keyword on which to filter the resulting list 298 */ 299 function getHelpTOC( $helpsearch ) 300 { 301 global $mainframe; 302 303 $lang =& JFactory::getLanguage(); 304 jimport( 'joomla.filesystem.folder' ); 305 306 $helpurl = $mainframe->getCfg('helpurl'); 307 308 // Check for files in the actual language 309 $langTag = $lang->getTag(); 310 if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) { 311 $langTag = 'en-GB'; // use english as fallback 312 } 313 $files = JFolder::files( JPATH_BASE.DS.'help'.DS.$langTag, '\.xml$|\.html$' ); 314 315 $toc = array(); 316 foreach ($files as $file) { 317 $buffer = file_get_contents( JPATH_BASE.DS.'help'.DS.$langTag.DS.$file ); 318 if (preg_match( '#<title>(.*?)</title>#', $buffer, $m )) { 319 $title = trim( $m[1] ); 320 if ($title) { 321 if ($helpurl) { 322 // strip the extension 323 $file = preg_replace( '#\.xml$|\.html$#', '', $file ); 324 } 325 if ($helpsearch) { 326 if (JString::strpos( strip_tags( $buffer ), $helpsearch ) !== false) { 327 $toc[$file] = $title; 328 } 329 } else { 330 $toc[$file] = $title; 331 } 332 } 333 } 334 } 335 asort( $toc ); 336 return $toc; 337 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |