### Eclipse Workspace Patch 1.0 #P core-moodle Index: lib/installlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/installlib.php,v retrieving revision 1.37 diff -u -r1.37 installlib.php --- lib/installlib.php 18 Sep 2010 11:29:45 -0000 1.37 +++ lib/installlib.php 25 Oct 2010 15:35:26 -0000 @@ -580,5 +580,10 @@ admin_apply_default_settings(NULL, true); admin_apply_default_settings(NULL, true); set_config('registerauth', ''); + + // Update the name of the main course + $DB->set_field('course', 'shortname', $options['shortname'], array('id' => 1)); + $DB->set_field('course', 'fullname', $options['fullname'], array('id' => 1)); + } \ No newline at end of file Index: admin/cli/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/cli/install.php,v retrieving revision 1.30 diff -u -r1.30 install.php --- admin/cli/install.php 1 Sep 2010 08:37:46 -0000 1.30 +++ admin/cli/install.php 25 Oct 2010 15:35:26 -0000 @@ -61,6 +61,8 @@ --dbpass=PASSWORD Database password. Default is blank --dbsocket Use database sockets. Available for some databases only. --prefix=STRING Table prefix for above database tables. Default is mdl_ +--fullname=STRING The fullname of the site +--shortname=STRING The shortname of the site --adminuser=USERNAME Username for the moodle admin account. Default is admin --adminpass=PASSWORD Password for the moodle admin account, required in non-interactive mode. @@ -185,6 +187,8 @@ 'dbpass' => '', 'dbsocket' => false, 'prefix' => 'mdl_', + 'fullname' => '', + 'shortname' => '', 'adminuser' => 'admin', 'adminpass' => '', 'non-interactive' => false, @@ -227,7 +231,7 @@ foreach ($languages as $key=>$lang) { $c++; $length = iconv_strlen($lang, 'UTF-8'); - $padded = $lang.str_repeat(' ', 28-$length); + $padded = $lang.str_repeat(' ', 38-$length); $langlist .= $padded; if ($c % 3 == 0) { $langlist .= "\n"; @@ -507,6 +511,48 @@ } } +// ask for fullname +if ($interactive) { + cli_separator(); + cli_heading(get_string('fullsitename', 'moodle')); + + if ($options['fullname'] !== '') { + $prompt = get_string('clitypevaluedefault', 'admin', $options['fullname']); + } else { + $prompt = get_string('clitypevalue', 'admin'); + } + + do { + $options['fullname'] = cli_input($prompt, $options['fullname']); + } while (empty($options['fullname'])); +} else { + if (empty($options['fullname'])) { + $a = (object)array('option'=>'fullname', 'value'=>$options['fullname']); + cli_error(get_string('cliincorrectvalueerror', 'admin', $a)); + } +} + +// ask for shortname +if ($interactive) { + cli_separator(); + cli_heading(get_string('shortsitename', 'moodle')); + + if ($options['shortname'] !== '') { + $prompt = get_string('clitypevaluedefault', 'admin', $options['shortname']); + } else { + $prompt = get_string('clitypevalue', 'admin'); + } + + do { + $options['shortname'] = cli_input($prompt, $options['shortname']); + } while (empty($options['shortname'])); +} else { + if (empty($options['shortname'])) { + $a = (object)array('option'=>'shortname', 'value'=>$options['shortname']); + cli_error(get_string('cliincorrectvalueerror', 'admin', $a)); + } +} + // ask for admin user name if ($interactive) { cli_separator();