Skip to content

Commit

Permalink
MDL-18167 more distro hooks refactoring - agreed with Eloy
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Feb 7, 2009
1 parent cc87274 commit 64c368e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 42 deletions.
41 changes: 17 additions & 24 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,8 @@

// distro specific customisation
$distro = null;
if (file_exists('install/versions.php')) {
$a = null;
include('install/versions.php');
if ($a) {
$distro = $a;
unset($a);
}
if (file_exists('install/distro.php')) {
include('install/distro.php');
}

$config = new stdClass();
Expand All @@ -69,9 +64,6 @@
if ($config->stage == INSTALL_ENVIRONMENT or $config->stage == INSTALL_DOWNLOADLANG) {
$config->stage--;
}
if (INSTALL_DISTRIBUTION and empty($distro)) {
$config->stage--;
}
} else if (isset($_POST['next'])) {
$config->stage++;
}
Expand Down Expand Up @@ -479,17 +471,6 @@



if ($config->stage == INSTALL_DISTRIBUTION) {
if (!$distro) {
$config->stage = INSTALL_PATHS;
} else {
include('install/distribution.html');
die;
}
}



if ($config->stage == INSTALL_PATHS) {
$paths = array('wwwroot' => get_string('wwwroot', 'install'),
'dirroot' => get_string('dirroot', 'install'),
Expand Down Expand Up @@ -550,9 +531,21 @@


$config->stage = INSTALL_WELCOME;
install_print_header($config, get_string('language'),
get_string('chooselanguagehead', 'install'),
get_string('chooselanguagesub', 'install'));

if ($distro) {
ob_start();
include('install/distribution.html');
$sub = ob_get_clean();

install_print_header($config, get_string('language'),
get_string('chooselanguagehead', 'install'),
$sub);

} else {
install_print_header($config, get_string('language'),
get_string('chooselanguagehead', 'install'),
get_string('chooselanguagesub', 'install'));
}

$languages = install_get_list_of_languages();
echo '<div class="userinput">';
Expand Down
8 changes: 0 additions & 8 deletions install/distribution.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<?php
install_print_header($config, get_string('distribution', 'install'),
get_string('welcomep10', 'install', $distro),
get_string('welcomep20', 'install', $distro));
?>

<p><?php print_string('welcomep30', 'install', $distro) ?></p>
<ul>
<li><?php p($distro->webname) ?> <?php p($distro->webversion) ?></li>
Expand All @@ -14,5 +8,3 @@
<p><?php print_string('welcomep50', 'install', $distro) ?></p>
<p><?php print_string('welcomep60', 'install', $distro) ?></p>
<p><?php print_string('welcomep70', 'install', $distro) ?></p>

<?php install_print_footer($config); ?>
1 change: 0 additions & 1 deletion install/stringnames.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ errorsinenvironment
environmentsub2
dataroot
dirroot
distribution
environmentrequireinstall
environmentrequireversion
installation
Expand Down
1 change: 0 additions & 1 deletion lang/en_utf8/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@
directly via the web.';
$string['dirroot'] = 'Moodle Directory';
$string['dirrooterror'] = 'The \'Moodle Directory\' setting seems to be incorrect - we can\'t find a Moodle installation there. The value below has been reset.';
$string['distribution'] = 'Distribution';
$string['download'] = 'Download';
$string['downloadlanguagebutton'] = 'Download the &quot;$a&quot; language pack';
$string['downloadlanguagehead'] = 'Download language pack';
Expand Down
15 changes: 7 additions & 8 deletions lib/installlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
*/

define('INSTALL_WELCOME', 0);
define('INSTALL_DISTRIBUTION', 1);
define('INSTALL_ENVIRONMENT', 2);
define('INSTALL_PATHS', 3);
define('INSTALL_DOWNLOADLANG', 4);
define('INSTALL_DATABASETYPE', 5);
define('INSTALL_DATABASE', 6);
define('INSTALL_SAVE', 7);
define('INSTALL_ENVIRONMENT', 1);
define('INSTALL_PATHS', 2);
define('INSTALL_DOWNLOADLANG', 3);
define('INSTALL_DATABASETYPE', 4);
define('INSTALL_DATABASE', 5);
define('INSTALL_SAVE', 6);

/**
*Tries to detect the right www root setting.
Expand Down Expand Up @@ -351,7 +350,7 @@ function install_css_styles() {
width:95%;
}
.stage7 .stage {
.stage6 .stage {
font-weight: bold;
color: red;
}
Expand Down

0 comments on commit 64c368e

Please sign in to comment.