Annotation of /mambo/branches/4.5.3h/administrator/components/com_admin/admin.admin.html.php
Parent Directory
|
Revision Log
Revision 535 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: admin.admin.html.php,v 1.3 2005/11/08 10:26:19 eliasan Exp $ | ||
| 4 : | cauld | 535 | * @package Mambo Open Source |
| 5 : | root | 1 | * @subpackage Admin |
| 6 : | cauld | 535 | * @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
| 7 : | root | 1 | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 8 : | cauld | 535 | * |
| 9 : | * Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure | ||
| 10 : | * that Mambo remained free Open Source software owned and managed by the community. | ||
| 11 : | root | 1 | * Mambo is Free Software |
| 12 : | */ | ||
| 13 : | |||
| 14 : | /** ensure this file is being included by a parent file */ | ||
| 15 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 16 : | |||
| 17 : | /** | ||
| 18 : | * @package Mambo | ||
| 19 : | * @subpackage Admin | ||
| 20 : | */ | ||
| 21 : | class HTML_admin_misc { | ||
| 22 : | |||
| 23 : | /** | ||
| 24 : | * Control panel | ||
| 25 : | */ | ||
| 26 : | function controlPanel() { | ||
| 27 : | global $mosConfig_absolute_path, $mainframe; | ||
| 28 : | ?> | ||
| 29 : | <table class="adminheading" border="0"> | ||
| 30 : | <tr> | ||
| 31 : | <th class="cpanel"> | ||
| 32 : | Home | ||
| 33 : | </th> | ||
| 34 : | </tr> | ||
| 35 : | </table> | ||
| 36 : | <table width="100%" class="adminheading"> | ||
| 37 : | <tr> | ||
| 38 : | csouza | 86 | <?php if($_SESSION['simple_editing'] == 'on' || ($_SESSION['simple_editing'] == '')) |
| 39 : | root | 1 | { |
| 40 : | $_SESSION['simple_editing'] = 'on'; | ||
| 41 : | ?> | ||
| 42 : | <td align="left" width="20%"> </td><td align="left" ><a class="selected" href="index2.php?option=simple_mode" title="Simple Mode (selected)">Simple Mode</a> / <a class="unselected" href="index2.php?option=advanced_mode" title="Advanced Mode (unselected)">Advanced Mode</a></td> | ||
| 43 : | csouza | 86 | <?php }else{?> |
| 44 : | root | 1 | <td align="left" width="20%"> </td><td align="left" ><a class="unselected"href="index2.php?option=simple_mode" title="Simple Mode (unselected)" >Simple Mode</a> / <a class="selected" href="index2.php?option=advanced_mode" title="Advanced Mode (selected)">Advanced Mode</a></td> |
| 45 : | csouza | 86 | <?php }?> |
| 46 : | root | 1 | </tr> |
| 47 : | </table> | ||
| 48 : | <?php | ||
| 49 : | $path = $mosConfig_absolute_path . '/administrator/templates/' . $mainframe->getTemplate() . '/cpanel.php'; | ||
| 50 : | if (file_exists( $path )) { | ||
| 51 : | require $path; | ||
| 52 : | } else { | ||
| 53 : | echo '<br />'; | ||
| 54 : | mosLoadAdminModules( 'cpanel', 1 ); | ||
| 55 : | } | ||
| 56 : | } | ||
| 57 : | |||
| 58 : | function get_php_setting($val) { | ||
| 59 : | $r = (ini_get($val) == '1' ? 1 : 0); | ||
| 60 : | return $r ? 'ON' : 'OFF'; | ||
| 61 : | } | ||
| 62 : | |||
| 63 : | function get_server_software() { | ||
| 64 : | if (isset($_SERVER['SERVER_SOFTWARE'])) { | ||
| 65 : | return $_SERVER['SERVER_SOFTWARE']; | ||
| 66 : | } else if (($sf = getenv('SERVER_SOFTWARE'))) { | ||
| 67 : | return $sf; | ||
| 68 : | } else { | ||
| 69 : | return 'n/a'; | ||
| 70 : | } | ||
| 71 : | } | ||
| 72 : | |||
| 73 : | function system_info( $version ) { | ||
| 74 : | global $mosConfig_absolute_path, $database; | ||
| 75 : | //$tab = mosGetParam( $_REQUEST, 'tab', 'tab1' ); | ||
| 76 : | $width = 400; // width of 100% | ||
| 77 : | $tabs = new mosTabs(0); | ||
| 78 : | ?> | ||
| 79 : | |||
| 80 : | <table class="adminheading"> | ||
| 81 : | <tr> | ||
| 82 : | <th class="info"> | ||
| 83 : | Information | ||
| 84 : | </th> | ||
| 85 : | </tr> | ||
| 86 : | </table> | ||
| 87 : | <?php | ||
| 88 : | $tabs->startPane("sysinfo"); | ||
| 89 : | $tabs->startTab("System Info","system-page"); | ||
| 90 : | ?> | ||
| 91 : | <table class="adminform"> | ||
| 92 : | <tr> | ||
| 93 : | <th colspan="2"> | ||
| 94 : | System Information | ||
| 95 : | </th> | ||
| 96 : | </tr> | ||
| 97 : | <tr> | ||
| 98 : | <td valign="top" width="250"> | ||
| 99 : | <b> | ||
| 100 : | PHP built On: | ||
| 101 : | </b> | ||
| 102 : | </td> | ||
| 103 : | <td> | ||
| 104 : | <?php echo php_uname(); ?> | ||
| 105 : | </td> | ||
| 106 : | </tr> | ||
| 107 : | <tr> | ||
| 108 : | <td> | ||
| 109 : | <b> | ||
| 110 : | Database Version: | ||
| 111 : | </b> | ||
| 112 : | </td> | ||
| 113 : | <td> | ||
| 114 : | <?php echo mysql_get_server_info(); ?> | ||
| 115 : | </td> | ||
| 116 : | </tr> | ||
| 117 : | <tr> | ||
| 118 : | <td> | ||
| 119 : | <b> | ||
| 120 : | PHP Version: | ||
| 121 : | </b> | ||
| 122 : | </td> | ||
| 123 : | <td> | ||
| 124 : | <?php echo phpversion(); ?> | ||
| 125 : | </td> | ||
| 126 : | </tr> | ||
| 127 : | <tr> | ||
| 128 : | <td> | ||
| 129 : | <b> | ||
| 130 : | Web Server: | ||
| 131 : | </b> | ||
| 132 : | </td> | ||
| 133 : | <td> | ||
| 134 : | <?php echo HTML_admin_misc::get_server_software(); ?> | ||
| 135 : | </td> | ||
| 136 : | </tr> | ||
| 137 : | <tr> | ||
| 138 : | <td> | ||
| 139 : | <b> | ||
| 140 : | WebServer to PHP interface: | ||
| 141 : | </b> | ||
| 142 : | </td> | ||
| 143 : | <td> | ||
| 144 : | <?php echo php_sapi_name(); ?> | ||
| 145 : | </td> | ||
| 146 : | </tr> | ||
| 147 : | <tr> | ||
| 148 : | <td> | ||
| 149 : | <b> | ||
| 150 : | Mambo Version: | ||
| 151 : | </b> | ||
| 152 : | </td> | ||
| 153 : | <td> | ||
| 154 : | <?php echo $version; ?> | ||
| 155 : | </td> | ||
| 156 : | </tr> | ||
| 157 : | <tr> | ||
| 158 : | <td> | ||
| 159 : | <b> | ||
| 160 : | User Agent: | ||
| 161 : | </b> | ||
| 162 : | </td> | ||
| 163 : | <td> | ||
| 164 : | <?php echo phpversion() <= "4.2.1" ? getenv( "HTTP_USER_AGENT" ) : $_SERVER['HTTP_USER_AGENT'];?> | ||
| 165 : | </td> | ||
| 166 : | </tr> | ||
| 167 : | <tr> | ||
| 168 : | <td valign="top"> | ||
| 169 : | <b> | ||
| 170 : | Relevant PHP Settings: | ||
| 171 : | </b> | ||
| 172 : | </td> | ||
| 173 : | <td> | ||
| 174 : | <table cellspacing="1" cellpadding="1" border="0"> | ||
| 175 : | <tr> | ||
| 176 : | <td> | ||
| 177 : | Safe Mode: | ||
| 178 : | </td> | ||
| 179 : | <td> | ||
| 180 : | <?php echo HTML_admin_misc::get_php_setting('safe_mode'); ?> | ||
| 181 : | </td> | ||
| 182 : | </tr> | ||
| 183 : | <tr> | ||
| 184 : | <td> | ||
| 185 : | Open basedir: | ||
| 186 : | </td> | ||
| 187 : | <td> | ||
| 188 : | <?php echo (($ob = ini_get('open_basedir')) ? $ob : 'none'); ?> | ||
| 189 : | </td> | ||
| 190 : | </tr> | ||
| 191 : | <tr> | ||
| 192 : | <td> | ||
| 193 : | Display Errors: | ||
| 194 : | </td> | ||
| 195 : | <td> | ||
| 196 : | <?php echo HTML_admin_misc::get_php_setting('display_errors'); ?> | ||
| 197 : | </td> | ||
| 198 : | </tr> | ||
| 199 : | <tr> | ||
| 200 : | <td> | ||
| 201 : | Short Open Tags: | ||
| 202 : | </td> | ||
| 203 : | <td> | ||
| 204 : | <?php echo HTML_admin_misc::get_php_setting('short_open_tag'); ?> | ||
| 205 : | </td> | ||
| 206 : | </tr> | ||
| 207 : | <tr> | ||
| 208 : | <td> | ||
| 209 : | File Uploads: | ||
| 210 : | </td> | ||
| 211 : | <td> | ||
| 212 : | <?php echo HTML_admin_misc::get_php_setting('file_uploads'); ?> | ||
| 213 : | </td> | ||
| 214 : | </tr> | ||
| 215 : | <tr> | ||
| 216 : | <td> | ||
| 217 : | Magic Quotes: | ||
| 218 : | </td> | ||
| 219 : | <td> | ||
| 220 : | <?php echo HTML_admin_misc::get_php_setting('magic_quotes_gpc'); ?> | ||
| 221 : | </td> | ||
| 222 : | </tr> | ||
| 223 : | <tr> | ||
| 224 : | <td> | ||
| 225 : | Register Globals: | ||
| 226 : | </td> | ||
| 227 : | <td> | ||
| 228 : | <?php echo HTML_admin_misc::get_php_setting('register_globals'); ?> | ||
| 229 : | </td> | ||
| 230 : | </tr> | ||
| 231 : | <tr> | ||
| 232 : | <td> | ||
| 233 : | Output Buffering: | ||
| 234 : | </td> | ||
| 235 : | <td> | ||
| 236 : | <?php echo HTML_admin_misc::get_php_setting('output_buffering'); ?> | ||
| 237 : | </td> | ||
| 238 : | </tr> | ||
| 239 : | <tr> | ||
| 240 : | <td> | ||
| 241 : | Session save path: | ||
| 242 : | </td> | ||
| 243 : | <td> | ||
| 244 : | <?php echo (($sp=ini_get('session.save_path'))?$sp:'none'); ?> | ||
| 245 : | </td> | ||
| 246 : | </tr> | ||
| 247 : | <tr> | ||
| 248 : | <td> | ||
| 249 : | Session auto start: | ||
| 250 : | </td> | ||
| 251 : | <td> | ||
| 252 : | <?php echo intval( ini_get( 'session.auto_start' ) ); ?> | ||
| 253 : | </td> | ||
| 254 : | </tr> | ||
| 255 : | <tr> | ||
| 256 : | <td> | ||
| 257 : | XML enabled: | ||
| 258 : | </td> | ||
| 259 : | <td> | ||
| 260 : | <?php echo extension_loaded('xml')?'Yes':'No'; ?> | ||
| 261 : | </td> | ||
| 262 : | </tr> | ||
| 263 : | <tr> | ||
| 264 : | <td> | ||
| 265 : | Zlib enabled: | ||
| 266 : | </td> | ||
| 267 : | <td> | ||
| 268 : | <?php echo extension_loaded('zlib')?'Yes':'No'; ?> | ||
| 269 : | </td> | ||
| 270 : | </tr> | ||
| 271 : | <tr> | ||
| 272 : | <td> | ||
| 273 : | Disabled Functions: | ||
| 274 : | </td> | ||
| 275 : | <td> | ||
| 276 : | <?php echo (($df=ini_get('disable_functions'))?$df:'none'); ?> | ||
| 277 : | </td> | ||
| 278 : | </tr> | ||
| 279 : | <?php | ||
| 280 : | $query = "SELECT name FROM #__mambots" | ||
| 281 : | . "\nWHERE folder='editors' AND published='1'" | ||
| 282 : | . "\nLIMIT 1"; | ||
| 283 : | $database->setQuery( $query ); | ||
| 284 : | $editor = $database->loadResult(); | ||
| 285 : | ?> | ||
| 286 : | <tr> | ||
| 287 : | <td> | ||
| 288 : | WYSIWYG Editor: | ||
| 289 : | </td> | ||
| 290 : | <td> | ||
| 291 : | <?php echo $editor; ?> | ||
| 292 : | </td> | ||
| 293 : | </tr> | ||
| 294 : | </table> | ||
| 295 : | </td> | ||
| 296 : | </tr> | ||
| 297 : | <tr> | ||
| 298 : | <td valign="top"> | ||
| 299 : | <b> | ||
| 300 : | Configuration File: | ||
| 301 : | </b> | ||
| 302 : | </td> | ||
| 303 : | <td> | ||
| 304 : | <?php | ||
| 305 : | $cf = file( $mosConfig_absolute_path . '/configuration.php' ); | ||
| 306 : | foreach ($cf as $k=>$v) { | ||
| 307 : | if (eregi( 'mosConfig_host', $v)) { | ||
| 308 : | $cf[$k] = '$mosConfig_host = \'xxxxxx\''; | ||
| 309 : | } else if (eregi( 'mosConfig_user', $v)) { | ||
| 310 : | $cf[$k] = '$mosConfig_user = \'xxxxxx\''; | ||
| 311 : | } else if (eregi( 'mosConfig_password', $v)) { | ||
| 312 : | $cf[$k] = '$mosConfig_password = \'xxxxxx\''; | ||
| 313 : | } else if (eregi( 'mosConfig_db ', $v)) { | ||
| 314 : | $cf[$k] = '$mosConfig_db = \'xxxxxx\''; | ||
| 315 : | } else if (eregi( '<?php', $v)) { | ||
| 316 : | $cf[$k] = '<?php'; | ||
| 317 : | } | ||
| 318 : | } | ||
| 319 : | echo implode( "<br />", $cf ); | ||
| 320 : | ?> | ||
| 321 : | </td> | ||
| 322 : | </tr> | ||
| 323 : | </table> | ||
| 324 : | <?php | ||
| 325 : | $tabs->endTab(); | ||
| 326 : | $tabs->startTab("PHP Info","php-page"); | ||
| 327 : | ?> | ||
| 328 : | <table class="adminform"> | ||
| 329 : | <tr> | ||
| 330 : | <th colspan="2"> | ||
| 331 : | PHP Information | ||
| 332 : | </th> | ||
| 333 : | </tr> | ||
| 334 : | <tr> | ||
| 335 : | <td> | ||
| 336 : | <?php | ||
| 337 : | ob_start(); | ||
| 338 : | phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES); | ||
| 339 : | $phpinfo = ob_get_contents(); | ||
| 340 : | ob_end_clean(); | ||
| 341 : | preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output); | ||
| 342 : | $output = preg_replace('#<table#', '<table class="adminlist" align="center"', $output[1][0]); | ||
| 343 : | $output = preg_replace('#(\w),(\w)#', '\1, \2', $output); | ||
| 344 : | $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output); | ||
| 345 : | $output = preg_replace('#<hr />#', '', $output); | ||
| 346 : | echo $output; | ||
| 347 : | ?> | ||
| 348 : | </td> | ||
| 349 : | </tr> | ||
| 350 : | </table> | ||
| 351 : | <?php | ||
| 352 : | $tabs->endTab(); | ||
| 353 : | $tabs->startTab('Permissions','perms'); | ||
| 354 : | ?> | ||
| 355 : | <table class="adminform"> | ||
| 356 : | <tr> | ||
| 357 : | <th colspan="2"> Directory Permissions</th> | ||
| 358 : | </tr> | ||
| 359 : | <tr> | ||
| 360 : | <td> | ||
| 361 : | <strong>For all Mambo functions and features to work ALL of the following directories should be writeable:</strong> | ||
| 362 : | <?php | ||
| 363 : | mosHTML::writableCell( 'administrator/backups' ); | ||
| 364 : | mosHTML::writableCell( 'administrator/components' ); | ||
| 365 : | mosHTML::writableCell( 'administrator/modules' ); | ||
| 366 : | mosHTML::writableCell( 'administrator/templates' ); | ||
| 367 : | mosHTML::writableCell( 'cache' ); | ||
| 368 : | mosHTML::writableCell( 'components' ); | ||
| 369 : | mosHTML::writableCell( 'images' ); | ||
| 370 : | mosHTML::writableCell( 'images/banners' ); | ||
| 371 : | mosHTML::writableCell( 'images/stories' ); | ||
| 372 : | mosHTML::writableCell( 'language' ); | ||
| 373 : | mosHTML::writableCell( 'mambots' ); | ||
| 374 : | mosHTML::writableCell( 'mambots/content' ); | ||
| 375 : | mosHTML::writableCell( 'mambots/search' ); | ||
| 376 : | mosHTML::writableCell( 'media' ); | ||
| 377 : | mosHTML::writableCell( 'modules' ); | ||
| 378 : | mosHTML::writableCell( 'templates' ); | ||
| 379 : | |||
| 380 : | ?> | ||
| 381 : | |||
| 382 : | </td> | ||
| 383 : | </tr> | ||
| 384 : | </table> | ||
| 385 : | <?php | ||
| 386 : | $tabs->endTab(); | ||
| 387 : | $tabs->endPane(); | ||
| 388 : | ?> | ||
| 389 : | <?php | ||
| 390 : | } | ||
| 391 : | |||
| 392 : | function ListComponents() { | ||
| 393 : | mosLoadAdminModule( 'components' ); | ||
| 394 : | } | ||
| 395 : | |||
| 396 : | /** | ||
| 397 : | * Display Help Page | ||
| 398 : | */ | ||
| 399 : | function help() { | ||
| 400 : | global $mosConfig_live_site; | ||
| 401 : | $helpurl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); | ||
| 402 : | cauld | 535 | $fullhelpurl = $helpurl . '/index2.php?option=com_content&task=findkey&pop=1&keyref='; // This line don't used? NineKrit |
| 403 : | $fullhelpurl = $helpurl.'/help/'; // add by NineKrit | ||
| 404 : | // $helpexit=file_exists( $helpurl.'/help/454.mambo.whatsnew.html' ); | ||
| 405 : | $helpexit=true; | ||
| 406 : | root | 1 | $helpsearch = mosGetParam( $_REQUEST, 'helpsearch', '' ); |
| 407 : | cauld | 535 | $page = mosGetParam( $_REQUEST, 'page', '454.mambo.whatsnew.html' ); |
| 408 : | root | 1 | $toc = getHelpToc( $helpsearch ); |
| 409 : | if (!eregi( '\.html$', $page )) { | ||
| 410 : | $page .= '.xml'; | ||
| 411 : | } | ||
| 412 : | ?> | ||
| 413 : | <style type="text/css"> | ||
| 414 : | .helpIndex { | ||
| 415 : | border: 0px; | ||
| 416 : | width: 95%; | ||
| 417 : | height: 100%; | ||
| 418 : | padding: 0px 5px 0px 10px; | ||
| 419 : | overflow: auto; | ||
| 420 : | } | ||
| 421 : | .helpFrame { | ||
| 422 : | border-left: 0px solid #222; | ||
| 423 : | border-right: none; | ||
| 424 : | border-top: none; | ||
| 425 : | border-bottom: none; | ||
| 426 : | width: 100%; | ||
| 427 : | height: 700px; | ||
| 428 : | padding: 0px 5px 0px 10px; | ||
| 429 : | } | ||
| 430 : | </style> | ||
| 431 : | <form name="adminForm"> | ||
| 432 : | <table class="adminform" border="1"> | ||
| 433 : | <tr> | ||
| 434 : | <th colspan="2" class="title"> | ||
| 435 : | Help | ||
| 436 : | </th> | ||
| 437 : | </tr> | ||
| 438 : | <tr> | ||
| 439 : | <td colspan="2"> | ||
| 440 : | <table width="100%"> | ||
| 441 : | <tr> | ||
| 442 : | <td> | ||
| 443 : | <strong>Search:</strong> | ||
| 444 : | <input class="text_area" type="hidden" name="option" value="com_admin" /> | ||
| 445 : | <input type="text" name="helpsearch" value="<?php echo $helpsearch;?>" class="inputbox" /> | ||
| 446 : | <input type="submit" value="Go" class="button" /> | ||
| 447 : | <input type="button" value="Clear Results" class="button" onclick="f=document.adminForm;f.helpsearch.value='';f.submit()" /> | ||
| 448 : | </td> | ||
| 449 : | <td style="text-align:right"> | ||
| 450 : | <?php | ||
| 451 : | cauld | 535 | // if ($helpurl) { // change to check the exist file |
| 452 : | if ($helpexit) { | ||
| 453 : | root | 1 | ?> |
| 454 : | cauld | 535 | <a href="<?php echo $fullhelpurl;?>454.mambo.glossary.html" target="helpFrame"> |
| 455 : | root | 1 | Glossary</a> |
| 456 : | | | ||
| 457 : | cauld | 535 | <a href="<?php echo $fullhelpurl;?>454.mambo.credits.html" target="helpFrame"> |
| 458 : | root | 1 | Credits</a> |
| 459 : | | | ||
| 460 : | cauld | 535 | <a href="<?php echo $fullhelpurl;?>454.mambo.support.html" target="helpFrame"> |
| 461 : | root | 1 | Support</a> |
| 462 : | <?php | ||
| 463 : | } else { | ||
| 464 : | ?> | ||
| 465 : | cauld | 535 | <a href="<?php echo $mosConfig_live_site;?>/help/454.mambo.glossary.html" target="helpFrame"> |
| 466 : | root | 1 | Glossary</a> |
| 467 : | | | ||
| 468 : | cauld | 535 | <a href="<?php echo $mosConfig_live_site;?>/help/454.mambo.credits.html" target="helpFrame"> |
| 469 : | root | 1 | Credits</a> |
| 470 : | | | ||
| 471 : | cauld | 535 | <a href="<?php echo $mosConfig_live_site;?>/help/454.mambo.support.html" target="helpFrame"> |
| 472 : | root | 1 | Support</a> |
| 473 : | <?php | ||
| 474 : | } | ||
| 475 : | ?> | ||
| 476 : | | | ||
| 477 : | <a href="http://www.gnu.org/copyleft/gpl.html" target="helpFrame"> | ||
| 478 : | License</a> | ||
| 479 : | | | ||
| 480 : | <a href="http://help.mamboserver.com" target="_blank"> | ||
| 481 : | help.mamboserver.com</a> | ||
| 482 : | | | ||
| 483 : | <a href="<?php echo $mosConfig_live_site;?>/administrator/index2.php?option=com_admin&task=sysinfo&no_html=1" target="helpFrame"> | ||
| 484 : | System Info</a> | ||
| 485 : | </td> | ||
| 486 : | </tr> | ||
| 487 : | </table> | ||
| 488 : | </td> | ||
| 489 : | </tr> | ||
| 490 : | <tr valign="top"> | ||
| 491 : | <td width="20%" valign="top"> | ||
| 492 : | <strong>Index</strong> | ||
| 493 : | <div class="helpIndex"> | ||
| 494 : | <?php | ||
| 495 : | foreach ($toc as $k=>$v) { | ||
| 496 : | cauld | 535 | // if ($helpurl) { |
| 497 : | if ($helpexit) { | ||
| 498 : | root | 1 | echo '<br /><a href="' . $fullhelpurl . urlencode( $k ) . '" target="helpFrame">' . $v . '</a>'; |
| 499 : | } else { | ||
| 500 : | echo '<br /><a href="' . $mosConfig_live_site . '/help/' . $k . '" target="helpFrame">' . $v . '</a>'; | ||
| 501 : | } | ||
| 502 : | } | ||
| 503 : | ?> | ||
| 504 : | </div> | ||
| 505 : | </td> | ||
| 506 : | <td valign="top"> | ||
| 507 : | <iframe name="helpFrame" src="<?php echo $mosConfig_live_site . '/help/' . $page;?>" class="helpFrame" frameborder="0" /></iframe> | ||
| 508 : | </td> | ||
| 509 : | </tr> | ||
| 510 : | </table> | ||
| 511 : | |||
| 512 : | <input type="hidden" name="task" value="help" /> | ||
| 513 : | </form> | ||
| 514 : | <?php | ||
| 515 : | } | ||
| 516 : | |||
| 517 : | /** | ||
| 518 : | * Preview site | ||
| 519 : | */ | ||
| 520 : | function preview( $tp=0 ) { | ||
| 521 : | global $mosConfig_live_site; | ||
| 522 : | $tp = intval( $tp ); | ||
| 523 : | ?> | ||
| 524 : | <style type="text/css"> | ||
| 525 : | .previewFrame { | ||
| 526 : | border: none; | ||
| 527 : | width: 95%; | ||
| 528 : | height: 600px; | ||
| 529 : | padding: 0px 5px 0px 10px; | ||
| 530 : | } | ||
| 531 : | </style> | ||
| 532 : | <table class="adminform"> | ||
| 533 : | <tr> | ||
| 534 : | <th width="50%" class="title"> | ||
| 535 : | Site Preview | ||
| 536 : | </th> | ||
| 537 : | <th width="50%" style="text-align:right"> | ||
| 538 : | <a href="<?php echo $mosConfig_live_site . '/index.php?tp=' . $tp;?>" target="_blank"> | ||
| 539 : | Open in new window | ||
| 540 : | </a> | ||
| 541 : | </th> | ||
| 542 : | </tr> | ||
| 543 : | <tr> | ||
| 544 : | <td width="100%" valign="top" colspan="2"> | ||
| 545 : | <iframe name="previewFrame" src="<?php echo $mosConfig_live_site . '/index.php?tp=' . $tp;?>" class="previewFrame" /></iframe> | ||
| 546 : | </td> | ||
| 547 : | </tr> | ||
| 548 : | </table> | ||
| 549 : | <?php | ||
| 550 : | } | ||
| 551 : | } | ||
| 552 : | |||
| 553 : | /** | ||
| 554 : | * Compiles the help table of contents | ||
| 555 : | * @param string A specific keyword on which to filter the resulting list | ||
| 556 : | */ | ||
| 557 : | function getHelpTOC( $helpsearch ) { | ||
| 558 : | global $mosConfig_absolute_path; | ||
| 559 : | $helpurl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); | ||
| 560 : | |||
| 561 : | $files = mosReadDirectory( $mosConfig_absolute_path . '/help/', '\.xml$|\.html$' ); | ||
| 562 : | |||
| 563 : | require_once( $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php' ); | ||
| 564 : | |||
| 565 : | $toc = array(); | ||
| 566 : | foreach ($files as $file) { | ||
| 567 : | $buffer = file_get_contents( $mosConfig_absolute_path . '/help/' . $file ); | ||
| 568 : | if (preg_match( '#<title>(.*?)</title>#', $buffer, $m )) { | ||
| 569 : | $title = trim( $m[1] ); | ||
| 570 : | if ($title) { | ||
| 571 : | cauld | 535 | // if ($helpurl) { |
| 572 : | if ($helpexit) { | ||
| 573 : | root | 1 | // strip the extension |
| 574 : | $file = preg_replace( '#\.xml$|\.html$#', '', $file ); | ||
| 575 : | } | ||
| 576 : | if ($helpsearch) { | ||
| 577 : | if (strpos( strip_tags( $buffer ), $helpsearch ) !== false) { | ||
| 578 : | $toc[$file] = $title; | ||
| 579 : | } | ||
| 580 : | } else { | ||
| 581 : | $toc[$file] = $title; | ||
| 582 : | } | ||
| 583 : | } | ||
| 584 : | } | ||
| 585 : | /* | ||
| 586 : | $xmlDoc =& new DOMIT_Lite_Document(); | ||
| 587 : | $xmlDoc->resolveErrors( true ); | ||
| 588 : | echo "<br>$file "; | ||
| 589 : | if ($xmlDoc->loadXML( $mosConfig_absolute_path . '/help/' . $file, false, true )) { | ||
| 590 : | if (eregi( '\.html$', $file )) { | ||
| 591 : | // html file | ||
| 592 : | $elem = $xmlDoc->getElementsByPath( 'head/title', 1 ); | ||
| 593 : | } else { | ||
| 594 : | // xml file | ||
| 595 : | $elem = $xmlDoc->getElementsByPath( 'title', 1 ); | ||
| 596 : | } | ||
| 597 : | if ($elem) { | ||
| 598 : | if ($helpsearch) { | ||
| 599 : | if (strpos( $xmlDoc->getText(), $helpsearch ) !== false) { | ||
| 600 : | $toc[$file] = $elem->getText(); | ||
| 601 : | } | ||
| 602 : | } else { | ||
| 603 : | $toc[$file] = $elem->getText(); | ||
| 604 : | } | ||
| 605 : | } | ||
| 606 : | } else { | ||
| 607 : | echo $xmlDoc->getErrorString(); | ||
| 608 : | } | ||
| 609 : | */ | ||
| 610 : | } | ||
| 611 : | asort( $toc ); | ||
| 612 : | return $toc; | ||
| 613 : | } | ||
| 614 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

