comparison install.php @ 9:acef7ccb09b5 6.4

Drupal 6.4
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:08 +0100
parents fff6d4c8c043
children 589fb7c02327
comparison
equal deleted inserted replaced
8:85cbd6048071 9:acef7ccb09b5
1 <?php 1 <?php
2 // $Id: install.php,v 1.113.2.3 2008/07/09 19:15:59 goba Exp $ 2 // $Id: install.php,v 1.113.2.5 2008/07/18 07:17:44 dries Exp $
3 3
4 require_once './includes/install.inc'; 4 require_once './includes/install.inc';
5 5
6 define('MAINTENANCE_MODE', 'install'); 6 define('MAINTENANCE_MODE', 'install');
7 7
446 } 446 }
447 } 447 }
448 448
449 /** 449 /**
450 * Form API array definition for the profile selection form. 450 * Form API array definition for the profile selection form.
451 */ 451 *
452 function install_select_profile_form(&$form_state, $profiles) { 452 * @param $form_state
453 foreach ($profiles as $profile) { 453 * Array of metadata about state of form processing.
454 * @param $profile_files
455 * Array of .profile files, as returned from file_scan_directory().
456 */
457 function install_select_profile_form(&$form_state, $profile_files) {
458 $profiles = array();
459 $names = array();
460
461 foreach ($profile_files as $profile) {
454 include_once($profile->filename); 462 include_once($profile->filename);
455 // Load profile details. 463
464 // Load profile details and store them for later retrieval.
456 $function = $profile->name .'_profile_details'; 465 $function = $profile->name .'_profile_details';
457 if (function_exists($function)) { 466 if (function_exists($function)) {
458 $details = $function(); 467 $details = $function();
459 } 468 }
460 // If set, used defined name. Otherwise use file name. 469 $profiles[$profile->name] = $details;
470
471 // Determine the name of the profile; default to file name if defined name
472 // is unspecified.
461 $name = isset($details['name']) ? $details['name'] : $profile->name; 473 $name = isset($details['name']) ? $details['name'] : $profile->name;
474 $names[$profile->name] = $name;
475 }
476
477 // Display radio buttons alphabetically by human-readable name.
478 natcasesort($names);
479 foreach ($names as $profile => $name) {
462 $form['profile'][$name] = array( 480 $form['profile'][$name] = array(
463 '#type' => 'radio', 481 '#type' => 'radio',
464 '#value' => 'default', 482 '#value' => 'default',
465 '#return_value' => $profile->name, 483 '#return_value' => $profile,
466 '#title' => $name, 484 '#title' => $name,
467 '#description' => isset($details['description']) ? $details['description'] : '', 485 '#description' => isset($profiles[$profile]['description']) ? $profiles[$profile]['description'] : '',
468 '#parents' => array('profile'), 486 '#parents' => array('profile'),
469 ); 487 );
470 } 488 }
471 $form['submit'] = array( 489 $form['submit'] = array(
472 '#type' => 'submit', 490 '#type' => 'submit',
878 // If it does, make sure it is writable. 896 // If it does, make sure it is writable.
879 $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE); 897 $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE);
880 } 898 }
881 } 899 }
882 if (!$exists) { 900 if (!$exists) {
883 drupal_set_message(st('The @drupal installer requires that you create %file as part of the installation process, and then make it writable. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error'); 901 drupal_set_message(st('The @drupal installer requires that you create a settings file as part of the installation process.
902 <ol>
903 <li>Copy the %default_file file to %file.</li>
904 <li>Change file permissions so that it is writable by the web server. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.</li>
905 </ol>
906 More details about installing Drupal are available in INSTALL.txt.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '%default_file' => $conf_path .'/default.settings.php', '@handbook_url' => 'http://drupal.org/server-permissions')), 'error');
884 } 907 }
885 elseif (!$writable) { 908 elseif (!$writable) {
886 drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error'); 909 drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, please consult the <a href="@handbook_url">on-line handbook</a>.', array('@drupal' => drupal_install_profile_name(), '%file' => $file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'error');
887 } 910 }
888 } 911 }