/** * @version $Id: admin.admin.html.php,v 1.16 2005/02/15 21:53:39 eddieajau Exp $ * @package Mambo * @subpackage Admin * @copyright (C) 2000 - 2005 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software */ /** ensure this file is being included by a parent file */ defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); /** * @package Mambo * @subpackage Admin */ class HTML_admin_misc { /** * Control panel */ function controlPanel() { global $mosConfig_absolute_path, $mainframe, $adminLanguage; ?> $path = $mosConfig_absolute_path . '/administrator/templates/' . $mainframe->getTemplate() . '/cpanel.php'; if (file_exists( $path )) { require $path; } else { echo ''; mosLoadAdminModules( 'cpanel', 1 ); } } function get_php_setting($val) { $r = (ini_get($val) == '1' ? 1 : 0); return $r ? 'ON' : 'OFF'; } function get_server_software() { if (isset($_SERVER['SERVER_SOFTWARE'])) { return $_SERVER['SERVER_SOFTWARE']; } else if (($sf = getenv('SERVER_SOFTWARE'))) { return $sf; } else { return 'n/a'; } } function system_info( $version ) { global $mosConfig_absolute_path, $database, $adminLanguage; //$tab = mosGetParam( $_REQUEST, 'tab', 'tab1' ); $width = 400; // width of 100% $tabs = new mosTabs(0); ?> $tabs->startPane("sysinfo"); $tabs->startTab($adminLanguage->A_MENU_SYSTEM_INFO,"system-page"); ?> $query = "SELECT name FROM #__mambots" . "\nWHERE folder='editors' AND published='1'" . "\nLIMIT 1"; $database->setQuery( $query ); $editor = $database->loadResult(); ?> $cf = file( $mosConfig_absolute_path . '/configuration.php' ); foreach ($cf as $k=>$v) { if (eregi( 'mosConfig_host', $v)) { $cf[$k] = '$mosConfig_host = \'xxxxxx\''; } else if (eregi( 'mosConfig_user', $v)) { $cf[$k] = '$mosConfig_user = \'xxxxxx\''; } else if (eregi( 'mosConfig_password', $v)) { $cf[$k] = '$mosConfig_password = \'xxxxxx\''; } else if (eregi( 'mosConfig_db ', $v)) { $cf[$k] = '$mosConfig_db = \'xxxxxx\''; } else if (eregi( ' $cf[$k] = '<?php'; } } echo implode( "", $cf ); ?> $tabs->endTab(); $tabs->startTab($adminLanguage->A_COMP_ADMIN_PHP_INFO2,"php-page"); ?> ob_start(); phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES); $phpinfo = ob_get_contents(); ob_end_clean(); preg_match_all('#]*>(.*)#siU', $phpinfo, $output); $output = preg_replace('# $output = preg_replace('#(\w),(\w)#', '\1, \2', $output); $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output); $output = preg_replace('##', '', $output); echo $output; ?> $tabs->endTab(); $tabs->startTab($adminLanguage->A_COMP_ADMIN_PERMISSIONS,"perms"); ?> mosHTML::writableCell( 'administrator/backups' ); mosHTML::writableCell( 'administrator/components' ); mosHTML::writableCell( 'administrator/modules' ); mosHTML::writableCell( 'administrator/templates' ); mosHTML::writableCell( 'cache' ); mosHTML::writableCell( 'components' ); mosHTML::writableCell( 'images' ); mosHTML::writableCell( 'images/banners' ); mosHTML::writableCell( 'images/stories' ); mosHTML::writableCell( 'language' ); mosHTML::writableCell( 'mambots' ); mosHTML::writableCell( 'mambots/content' ); mosHTML::writableCell( 'mambots/search' ); mosHTML::writableCell( 'media' ); mosHTML::writableCell( 'modules' ); mosHTML::writableCell( 'templates' ); ?> $tabs->endTab(); $tabs->endPane(); ?> } function ListComponents() { mosLoadAdminModule( 'components' ); } /** * Display Help Page */ function help() { global $mosConfig_live_site, $adminLanguage; $helpurl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); $fullhelpurl = $helpurl . '/index2.php?option=com_content&task=findkey&pop=1&keyref='; $helpsearch = mosGetParam( $_REQUEST, 'helpsearch', '' ); $page = mosGetParam( $_REQUEST, 'page', 'mambo.whatsnew452.html' ); $toc = getHelpToc( $helpsearch ); if (!eregi( '\.html$', $page )) { $page .= '.xml'; } ?> .helpIndex { border: 0px; width: 95%; height: 100%; padding: 0px 5px 0px 10px; overflow: auto; } .helpFrame { border-left: 0px solid #222; border-right: none; border-top: none; border-bottom: none; width: 100%; height: 700px; padding: 0px 5px 0px 10px; } Search: if ($helpurl) { ?> Glossary | Credits | Support } else { ?> Glossary | Credits | Support } ?> | License | help.mamboserver.com | System Info foreach ($toc as $k=>$v) { if ($helpurl) { echo '' . $v . ''; } else { echo '' . $v . ''; } } ?> } /** * Preview site */ function preview( $tp=0 ) { global $mosConfig_live_site; Global $adminLanguage; $tp = intval( $tp ); ?> .previewFrame { border: none; width: 95%; height: 600px; padding: 0px 5px 0px 10px; } } } /** * Compiles the help table of contents * @param string A specific keyword on which to filter the resulting list */ function getHelpTOC( $helpsearch ) { global $mosConfig_absolute_path; $helpurl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); $files = mosReadDirectory( $mosConfig_absolute_path . '/help/', '\.xml$|\.html$' ); require_once( $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php' ); $toc = array(); foreach ($files as $file) { $buffer = file_get_contents( $mosConfig_absolute_path . '/help/' . $file ); if (preg_match( '#(.*?)#', $buffer, $m )) { $title = trim( $m[1] ); if ($title) { if ($helpurl) { // strip the extension $file = preg_replace( '#\.xml$|\.html$#', '', $file ); } if ($helpsearch) { if (strpos( strip_tags( $buffer ), $helpsearch ) !== false) { $toc[$file] = $title; } } else { $toc[$file] = $title; } } } /* $xmlDoc =& new DOMIT_Lite_Document(); $xmlDoc->resolveErrors( true ); echo "$file "; if ($xmlDoc->loadXML( $mosConfig_absolute_path . '/help/' . $file, false, true )) { if (eregi( '\.html$', $file )) { // html file $elem = $xmlDoc->getElementsByPath( 'head/title', 1 ); } else { // xml file $elem = $xmlDoc->getElementsByPath( 'title', 1 ); } if ($elem) { if ($helpsearch) { if (strpos( $xmlDoc->getText(), $helpsearch ) !== false) { $toc[$file] = $elem->getText(); } } else { $toc[$file] = $elem->getText(); } } } else { echo $xmlDoc->getErrorString(); } */ } asort( $toc ); return $toc; } ?>