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