Adding blue bar during the installation process see #4807

skala
Julio Montoya 13 years ago
parent 9a76db0fd0
commit a1532c34fc
  1. 59
      main/inc/global_error_message.inc.php
  2. 128
      main/install/index.php
  3. 19
      main/template/default/layout/main_header.tpl

@ -27,7 +27,7 @@ $ErrorCode = 'Error code';
// Error code 1.
$IncorrectPhpVersionTitle = 'Incorrect PHP version';
$IncorrectPhpVersionDescription = 'Warning: we have detected that your version of PHP is %s1. To install Chamilo, you need to have PHP %s2 or superior. If you don\'t know what we\'re talking about, please contact your hosting provider or your support team.
$IncorrectPhpVersionDescription = 'Warning: we have detected that your version of PHP is %s1. To install Chamilo, you need to have PHP %s2 or superior. If you don\'t know what we\'re talking about, please contact your hosting provider or your support team.
%s3 Read the installation guide.';
// Error code 2.
@ -52,11 +52,11 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$theme = 'chamilo/';
$css_path = 'main/css/';
$css_file = $css_path.$theme.'default.css';
$css_file = $css_path.$theme.'default.css';
$bootstrap_file = $css_path.'bootstrap.css';
$css_base_file = $css_path.'base.css';
$css_base_chamilo_file = $css_path.'base_chamilo.css';
$css_base_chamilo_file = $css_path.'base_chamilo.css';
$css_list = array($css_base_file, $css_base_chamilo_file, $bootstrap_file, $css_file);
$root_sys = str_replace('\\', '/', realpath(dirname(__FILE__).'/../../')).'/';
@ -70,8 +70,7 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$pos = $test_pos + 1;
}
$root_rel = substr($root_rel, 0, $pos);
}
elseif (strpos($root_rel, '/courses/') !== false) {
} elseif (strpos($root_rel, '/courses/') !== false) {
$pos = 0;
while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) {
$pos = $test_pos + 1;
@ -81,15 +80,15 @@ if (is_int($global_error_code) && $global_error_code > 0) {
}
$installation_guide_url = $root_rel.'documentation/installation_guide.html';
$css_def = '';
foreach ($css_list as $css_item) {
$css_base_chamilo_file = $root_sys.$css_item;
if (file_exists($css_base_chamilo_file)) {
if (file_exists($css_base_chamilo_file)) {
$css_def .= @file_get_contents($css_base_chamilo_file);
}
}
}
$css_def = str_replace("@import url('bootstrap.css');", '', $css_def);
$css_def = str_replace('main/', $root_rel.'main/', $css_def);
$css_def = str_replace('images/', $root_rel.$css_path.$theme.'images/', $css_def);
@ -119,7 +118,7 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$global_error_message['title'] = $InstallationTitle;
if (($pos = strpos($InstallationDescription, '%s')) === false) {
$InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide';
}
}
$read_installation_guide = substr($InstallationDescription, $pos + 2);
$InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get">
<p class="download-info">
@ -160,7 +159,7 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$global_error_message['encoding'] = 'UTF-8';
$global_error_message['css'] = $css_def;
$global_error_message['chamilo_logo'] = $root_rel.$css_path.$theme.'images/header-logo.png';
// {ORGANISATION} moved from the header
$global_error_message_page =
@ -168,7 +167,7 @@ if (is_int($global_error_code) && $global_error_code > 0) {
<!DOCTYPE html>
<html>
<head>
<title>{TITLE}</title>
<title>{TITLE}</title>
<meta charset="{ENCODING}" />
<style type="text/css" media="screen, projection">
/*<![CDATA[*/
@ -181,34 +180,44 @@ if (is_int($global_error_code) && $global_error_code > 0) {
<div id="main" class="container">
<header>
<div class="row">
<div id="header_left" class="span4">
<div id="logo">
<img vspace="10" hspace="10" alt="Chamilo" src="{CHAMILO_LOGO}">
<div id="header_left" class="span4">
<div id="logo">
<img vspace="10" hspace="10" alt="Chamilo" src="{CHAMILO_LOGO}">
</div>
</div>
</div>
</header>
<ul class="breadcrumb">
<li><a href="#">{SECTION}</a></li>
</ul>
</div>
<div class="subnav">
<ul class="nav nav-pills">
<li id="current">
<a target="_top" href="index.php">Homepage</a>
</li>
</ul>
</div>
<ul class="breadcrumb">
<li><a href="#">{SECTION}</a></li>
</ul>
</header>
<br />
<section>
<div style="text-align:center">
{DESCRIPTION}
{CODE}
{CODE}
</div>
</section>
</section>
</div>
<div class="push"/></div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="row">
<div style="text-align: center;">
&nbsp;<br />{POWERED_BY}
</div>
</div>
</div>
</footer>
</body>
</html>

@ -213,7 +213,7 @@ if (!isset($_GET['running'])) {
$dbPassForm = '';
$dbPrefixForm = '';
$dbNameForm = 'chamilo';
$dbStatsForm = 'chamilo';
$dbScormForm = 'chamilo';
$dbUserForm = 'chamilo';
@ -301,17 +301,17 @@ if ($encryptPassForm == '1') {
<head>
<title>&mdash; <?php echo get_lang('ChamiloInstallation').' &mdash; '.get_lang('Version_').' '.$new_version; ?></title>
<style type="text/css" media="screen, projection">
/*<![CDATA[*/
/*<![CDATA[*/
@import "../css/base.css";
@import "../css/<?php echo api_get_visual_theme(); ?>/default.css";
@import "../css/<?php echo api_get_visual_theme(); ?>/default.css";
/*]]>*/
</style>
<script type="text/javascript" src="../inc/lib/javascript/jquery.min.js"></script>
<script type="text/javascript" src="../inc/lib/javascript/jquery.min.js"></script>
<script type="text/javascript" >
$(document).ready( function() {
$("#button_please_wait").hide();
//checked
if ($('#singleDb1').attr('checked')==false) {
//$('#dbStatsForm').removeAttr('disabled');
@ -324,60 +324,60 @@ if ($encryptPassForm == '1') {
$('#dbStatsForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
}
$("button").addClass('btn');
//Allow Chamilo install in IE
$("button").click(function() {
$("#is_executable").attr("value",$(this).attr("name"));
});
//Blocking step6 button
$("#button_step6").click(function() {
$("#button_step6").click(function() {
$("#button_step6").hide();
$("#button_please_wait").html('<?php echo addslashes(get_lang('PleaseWait'));?>');
$("#button_please_wait").show();
$("#button_please_wait").attr('disabled', true);
$("#is_executable").attr("value",'step6');
});
});
});
function show_hide_tracking_and_user_db (my_option) {
if (my_option=='singleDb1') {
$('#optional_param2').hide();
$('#optional_param4').hide();
$('#optional_param4').hide();
$('#dbStatsForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
} else if (my_option=='singleDb0') {
$('#optional_param2').show();
$('#optional_param4').show();
$('#dbStatsForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
}
}
init_visibility=0;
function show_hide_option() {
function show_hide_option() {
if (init_visibility == 0) {
$('#optional_param1').show();
if ($('#singleDb1').attr("checked") == true) {
if ($('#singleDb1').attr("checked") == true) {
//$('#optional_param2').hide();
//$('#optional_param4').hide();
$('#optional_param5').hide();
} else {
} else {
//$('#optional_param2').show();
//$('#optional_param4').show();
$('#optional_param5').show();
}
$('#optional_param5').show();
}
//document.getElementById('optional_param2').style.display = '';
if (document.getElementById('optional_param3')) {
document.getElementById('optional_param3').style.display = '';
}
//document.getElementById('optional_param5').style.display = '';
//document.getElementById('optional_param6').style.display = '';
init_visibility = 1;
@ -396,7 +396,7 @@ if ($encryptPassForm == '1') {
init_visibility = 0;
}
return false;
}
}
$(document).ready( function() {
$(".advanced_parameters").click(function() {
@ -439,25 +439,33 @@ if ($encryptPassForm == '1') {
}
});
}
</script>
</script>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
</head>
<body dir="<?php echo api_get_text_direction(); ?>">
<div id="wrapper">
<div id="wrapper">
<div id="main" class="container">
<header>
<div class="row">
<div id="header_left" class="span4">
<div id="logo">
<img src="../css/chamilo/images/header-logo.png" hspace="10" vspace="10" alt="Chamilo" />
</div>
<div id="logo">
<img src="../css/chamilo/images/header-logo.png" hspace="10" vspace="10" alt="Chamilo" />
</div>
</div>
</div>
</header>
</div>
<div class="subnav">
<ul class="nav nav-pills">
<li id="current">
<a target="_top" href="index.php"><?php echo get_lang('Homepage'); ?></a>
</li>
</ul>
</div>
</header>
<br />
<div class="row">
<div class="span3">
<div class="well">
<div class="well">
<ol>
<li <?php step_active('1'); ?>><?php echo get_lang('InstallationLanguage'); ?></li>
<li <?php step_active('2'); ?>><?php echo get_lang('Requirements'); ?></li>
@ -467,7 +475,7 @@ if ($encryptPassForm == '1') {
<li <?php step_active('6'); ?>><?php echo get_lang('PrintOverview'); ?></li>
<li <?php step_active('7'); ?>><?php echo get_lang('Installing'); ?></li>
</ol>
</div>
</div>
<div id="note">
<a class="btn" href="../../documentation/installation_guide.html" target="_blank">
<?php echo get_lang('ReadTheInstallationGuide'); ?>
@ -478,17 +486,17 @@ if ($encryptPassForm == '1') {
<form class="form-horizontal" id="install_form" style="padding: 0px; margin: 0px;" method="post" action="<?php echo api_get_self(); ?>?running=1&amp;installType=<?php echo $installType; ?>&amp;updateFromConfigFile=<?php echo urlencode($updateFromConfigFile); ?>">
<?php
echo '<div class="page-header"><h1>'.get_lang('ChamiloInstallation').' &ndash; '.get_lang('Version_').' '.$new_version.'</h1></div>';
$instalation_type_label = '';
if ($installType == 'new'){
$instalation_type_label = get_lang('NewInstallation');
if ($installType == 'new'){
$instalation_type_label = get_lang('NewInstallation');
}elseif ($installType == 'update') {
$update_from_version = isset($update_from_version) ? $update_from_version : null;
$instalation_type_label = get_lang('UpdateFromDokeosVersion').(is_array($update_from_version) ? implode('|', $update_from_version) : '');
}
if (!empty($instalation_type_label)) {
echo "<h2>$instalation_type_label</h2><hr />";
}
}
?>
<input type="hidden" name="updatePath" value="<?php if (!$badUpdatePath) echo api_htmlentities($proposedUpdatePath, ENT_QUOTES); ?>" />
<input type="hidden" name="urlAppendPath" value="<?php echo api_htmlentities($urlAppendPath, ENT_QUOTES); ?>" />
@ -540,11 +548,11 @@ if (@$_POST['step2']) {
//STEP 3 : LICENSE
display_license_agreement();
} elseif (@$_POST['step3']) {
//STEP 4 : MYSQL DATABASE SETTINGS
//STEP 4 : MYSQL DATABASE SETTINGS
display_database_settings_form($installType, $dbHostForm, $dbUsernameForm, $dbPassForm, $dbPrefixForm, $enableTrackingForm, $singleDbForm, $dbNameForm, $dbStatsForm, $dbScormForm, $dbUserForm);
} elseif (@$_POST['step4']) {
//STEP 5 : CONFIGURATION SETTINGS
//if update, try getting settings from the database...
if ($installType == 'update') {
$db_name = $dbNameForm;
@ -618,22 +626,22 @@ if (@$_POST['step2']) {
</div>
<div class="RequirementContent">
<?php echo get_lang('HereAreTheValuesYouEntered'); ?>
</div><br />
<blockquote>
</div><br />
<blockquote>
<?php if ($installType == 'new'): ?>
<?php echo get_lang('AdminLogin').' : <strong>'.$loginForm; ?></strong><br />
<?php echo get_lang('AdminPass').' : <strong>'.$passForm; /* TODO: Maybe this password should be hidden too? */ ?></strong><br /><br />
<?php else: ?>
<?php endif;
<?php else: ?>
<?php endif;
if (api_is_western_name_order()) {
echo get_lang('AdminFirstName').' : '.$adminFirstName, '<br />', get_lang('AdminLastName').' : '.$adminLastName, '<br />';
} else {
echo get_lang('AdminLastName').' : '.$adminLastName, '<br />', get_lang('AdminFirstName').' : '.$adminFirstName, '<br />';
}
echo get_lang('AdminEmail').' : '.$emailForm; ?><br />
echo get_lang('AdminEmail').' : '.$emailForm; ?><br />
<?php echo get_lang('AdminPhone').' : '.$adminPhoneForm; ?><br />
<?php echo get_lang('MainLang').' : '.$languageForm; ?><br /><br />
<?php echo get_lang('DBHost').' : '.$dbHostForm; ?><br />
@ -641,7 +649,7 @@ if (@$_POST['step2']) {
<?php echo get_lang('DBPassword').' : '.str_repeat('*', api_strlen($dbPassForm)); ?><br />
<?php //echo get_lang('DbPrefixForm').' : '.$dbPrefixForm.'<br />'; ?>
<?php echo get_lang('MainDB').' : <strong>'.$dbNameForm; ?></strong>
<?php
if (!$singleDbForm) {
//Showing this data only in case a user migrates from a 3 main databases (main, user, tracking)
@ -660,7 +668,7 @@ if (@$_POST['step2']) {
echo '<br />';
}
}
//echo get_lang('EnableTracking').' : '.($enableTrackingForm ? get_lang('Yes') : get_lang('No')); ?>
<?php //echo get_lang('SingleDb').' : '.($singleDbForm ? get_lang('One') : get_lang('Several')); ?><br /><br />
<?php echo get_lang('AllowSelfReg').' : '.($allowSelfReg ? get_lang('Yes') : get_lang('No')); ?><br />
@ -676,13 +684,13 @@ if (@$_POST['step2']) {
</blockquote>
<?php if ($installType == 'new'): ?>
<div style="background-color:#FFFFFF">
<div style="background-color:#FFFFFF">
<div class="warning-message">
<center>
<h3><?php echo get_lang('Warning'); ?> !</h3>
<?php echo get_lang('TheInstallScriptWillEraseAllTables'); ?>
</center>
</div>
</div>
</div>
<?php endif; ?>
@ -695,7 +703,7 @@ if (@$_POST['step2']) {
<button id="button_step6" class="save" type="submit" name="button_step6" value="<?php echo get_lang('InstallChamilo'); ?>">
<?php echo get_lang('InstallChamilo'); ?>
</button>
<button class="save" id="button_please_wait"></button>
</td>
</tr>
@ -705,7 +713,7 @@ if (@$_POST['step2']) {
} elseif (@$_POST['step6']) {
//STEP 6 : INSTALLATION PROCESS
if ($installType == 'update') {
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
@ -720,7 +728,7 @@ if (@$_POST['step2']) {
$perm_file = api_get_permissions_for_new_files();
if (empty($my_old_version)) { $my_old_version = '1.8.6.2'; } //we guess
$_configuration['main_database'] = $dbNameForm;
//$urlAppendPath = get_config_param('urlAppend');
Log::notice('Starting migration process from '.$my_old_version.' ('.time().')');
@ -730,7 +738,7 @@ if (@$_POST['step2']) {
} elseif ($userPasswordCrypted == '0') {
$userPasswordCrypted = 'none';
}
Database::query("SET storage_engine = MYISAM;");
if (version_compare($my_old_version, '1.8.7', '>=')) {
@ -784,24 +792,24 @@ if (@$_POST['step2']) {
Database::query("SET NAMES 'utf8';");
case '1.8.7':
case '1.8.7.1':
case '1.8.7.1':
include 'update-db-1.8.7-1.8.8.inc.php';
include 'update-files-1.8.7-1.8.8.inc.php';
include 'update-files-1.8.7-1.8.8.inc.php';
case '1.8.8':
case '1.8.8.2':
//Only updates the configuration.inc.php with the new version
//Only updates the configuration.inc.php with the new version
include 'update-configuration.inc.php';
case '1.8.8.4':
case '1.8.8.4':
include 'update-db-1.8.8-1.9.0.inc.php';
//include 'update-files-1.8.8-1.9.0.inc.php';
//Only updates the configuration.inc.php with the new version
include 'update-configuration.inc.php';
break;
default:
break;
}
} else {
} else {
set_file_folder_permissions();
database_server_connect();

@ -26,6 +26,7 @@
{% include "default/layout/topbar.tpl" %}
<div id="main" class="container">
<header>
<div class="row">
<div id="header_left" class="span4">
@ -73,16 +74,18 @@
</div>
{% endif %}
{# menu #}
{% if menu is not null %}
<div class="subnav">
{{ menu }}
</div>
{% endif %}
{# menu #}
{% if menu is not null %}
<div class="subnav">
{{ menu }}
</div>
{% endif %}
{# breadcrumb #}
{{ breadcrumb }}
</header>
{# breadcrumb #}
{{ breadcrumb }}
<div class="row">
{# course navigation links/shortcuts need to be activated by the admin #}

Loading…
Cancel
Save