"; echo "\"$title\""; echo "\n"; } function install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) { // this is in function because we want the /install.php to parse in PHP4 try { try { $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions); } catch (moodle_exception $e) { // let's try to create new database if ($database->create_database($dbhost, $dbuser, $dbpass, $dbname, $dboptions)) { $database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions); } else { throw $e; } } return ''; } catch (dml_exception $ex) { return get_string($ex->errorcode, $ex->module, $ex->a).'
'.$ex->debuginfo; } } /** * This function returns a list of languages and their full names. The * list of available languages is fetched from install/lang/xx/installer.php * and it's used exclusively by the installation process * @return array An associative array with contents in the form of LanguageCode => LanguageName */ function install_get_list_of_languages() { global $CFG; $languages = array(); /// Get raw list of lang directories $langdirs = get_list_of_plugins('install/lang'); asort($langdirs); /// Get some info from each lang foreach ($langdirs as $lang) { if ($lang == 'en') { continue; } if (file_exists($CFG->dirroot.'/install/lang/'.$lang.'/installer.php')) { $string = array(); include($CFG->dirroot.'/install/lang/'.$lang.'/installer.php'); if (substr($lang, -5) === '_utf8') { //Remove the _utf8 suffix from the lang to show $shortlang = substr($lang, 0, -5); } else { $shortlang = $lang; } if (!empty($string['thislanguage'])) { $languages[$lang] = $string['thislanguage'].' ('.$shortlang.')'; } } } /// Return array return $languages; } function install_print_help_page($help) { global $CFG; @header('Content-Type: text/html; charset=UTF-8'); @header('Cache-Control: no-store, no-cache, must-revalidate'); @header('Cache-Control: post-check=0, pre-check=0', false); @header('Pragma: no-cache'); @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT'); @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); echo ''; echo ' '.get_string('installation','install').' '; echo ''; switch ($help) { case 'phpversionhelp': print_string($help, 'install', phpversion()); break; case 'memorylimithelp': print_string($help, 'install', get_memory_limit()); break; default: print_string($help, 'install'); } close_window_button(); echo ''; die; } function install_print_header($config, $stagename, $heading, $stagetext) { global $CFG; @header('Content-Type: text/html; charset=UTF-8'); @header('Cache-Control: no-store, no-cache, must-revalidate'); @header('Cache-Control: post-check=0, pre-check=0', false); @header('Pragma: no-cache'); @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT'); @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); echo ''; echo ' '; $sheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_moz'); $csss = array(); foreach ($sheets as $sheet) { $csss[] = $CFG->wwwroot.'/theme/standard/'.$sheet.'.css'; } $sheets = array('gradients'); foreach ($sheets as $sheet) { $csss[] = $CFG->wwwroot.'/theme/standardwhite/'.$sheet.'.css'; } foreach ($csss as $css) { echo ''."\n"; } echo ' '.get_string('installation','install').' - Moodle '.$CFG->target_release.' '; echo '
'; echo '

'.$heading.'

'; if ($stagetext !== '') { echo '
'; echo $stagetext; echo '
'; } // main echo '
'; foreach ($config as $name=>$value) { echo ''; } } function install_print_footer($config, $reload=false) { global $CFG; if ($config->stage > INSTALL_WELCOME) { $first = ''; } else { $first = ''; $first .= ' '; } if ($reload) { $next = ''; } else { $next = ''; } echo '
'; $homelink = ''; echo '
'; echo ''; echo '
'; } function install_css_styles() { global $CFG; @header('Content-type: text/css'); // Correct MIME type @header('Cache-Control: no-store, no-cache, must-revalidate'); @header('Cache-Control: post-check=0, pre-check=0', false); @header('Pragma: no-cache'); @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT'); @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); //TODO: add rtl support here echo ' h2 { text-align:center; } #installdiv { width: 800px; margin-left:auto; margin-right:auto; } #installdiv dt { font-weight: bold; } #installdiv dd { padding-bottom: 0.5em; } .stage { margin-top: 2em; margin-bottom: 2em; width: 100%; padding:25px; } #installform { width: 100%; } #nav_buttons input { margin: 5px; } #envresult { text-align:left; width: auto; margin-left:10em; } #envresult dd { color: red; } .formrow { clear:both; text-align:left; padding: 8px; } .formrow label.formlabel { display:block; float:left; width: 260px; margin-right:5px; text-align:right; } .formrow .forminput { display:block; float:left; } fieldset { text-align:center; border:none; } .hint { display:block; clear:both; padding-left: 265px; color: red; } .configphp { text-align:left; background-color:white; padding:1em; width:95%; } .stage6 .stage { font-weight: bold; color: red; } '; die; }