From 39c302eec0a64183207bbbf7cc6bb7adfae16ef7 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 2 Jun 2009 03:33:36 +0000 Subject: [PATCH] #475596 by emmajane, catch, yoroy, et al. Move default welcome message to help system. --- install.php | 1 + modules/help/help.module | 9 ++++++++- modules/node/node.module | 25 ++++++++++++++----------- modules/simpletest/simpletest.test | 2 +- modules/simpletest/tests/common.test | 2 +- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/install.php b/install.php index 82dcfe9d8d9..ec158f3e648 100644 --- a/install.php +++ b/install.php @@ -800,6 +800,7 @@ function install_tasks($profile, $task) { $messages = drupal_set_message(); $output = '

' . st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) . '

'; $output .= '

' . (isset($messages['error']) ? st('Please review the messages above before continuing on to your new site.', array('@url' => url(''))) : st('You may now visit your new site.', array('@url' => url('')))) . '

'; + $output .= '

' . st('For more information on configuring Drupal, please refer to the help section.', array('@help' => url('admin/help'))) . '

'; $task = 'done'; } diff --git a/modules/help/help.module b/modules/help/help.module index 0d0c28ca40b..15d350c51f2 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -36,7 +36,14 @@ function help_menu() { function help_help($path, $arg) { switch ($path) { case 'admin/help': - $output = '

' . t('This guide provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '

'; + $output = '

' . t('Please follow these steps to set up and start using your website:') . '

'; + $output .= '
    '; + $output .= '
  1. ' . t('Configure your website Once logged in, visit the administration section, where you can customize and configure all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) . '
  2. '; + $output .= '
  3. ' . t('Enable additional functionality Next, visit the module list and enable features which suit your specific needs. You can find additional modules in the Drupal modules download section.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) . '
  4. '; + $output .= '
  5. ' . t('Customize your website design To change the "look and feel" of your website, visit the themes section. You may choose from one of the included themes or download additional themes from the Drupal themes download section.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) . '
  6. '; + $output .= '
  7. ' . t('Start posting content Finally, you can add new content for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) . '
  8. '; + $output .= '
'; + $output .= '

' . t('For more information, please refer to the specific topics listed in the next section, or the online Drupal handbooks. You may also post at the Drupal forum, or view the wide range of other support options available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) . '

'; return $output; case 'admin/help#help': $output = '

' . t('The help module provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '

'; diff --git a/modules/node/node.module b/modules/node/node.module index 0473b1b65b4..3f2922a0015 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -2141,7 +2141,7 @@ function node_page_default() { ->addTag('node_access'); $nids = $select->execute()->fetchCol(); - + if (!empty($nids)) { $nodes = node_load_multiple($nids); $build = node_build_multiple($nodes); @@ -2152,24 +2152,27 @@ function node_page_default() { '#markup' => theme('pager', NULL), '#weight' => 5, ); + drupal_set_title(''); } else { - $default_message = '

' . t('Welcome to your new Drupal website!') . '

'; - $default_message .= '

' . t('Please follow these steps to set up and start using your website:') . '

'; - $default_message .= '
    '; - $default_message .= '
  1. ' . t('Configure your website Once logged in, visit the administration section, where you can customize and configure all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) . '
  2. '; - $default_message .= '
  3. ' . t('Enable additional functionality Next, visit the module list and enable features which suit your specific needs. You can find additional modules in the Drupal modules download section.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) . '
  4. '; - $default_message .= '
  5. ' . t('Customize your website design To change the "look and feel" of your website, visit the themes section. You may choose from one of the included themes or download additional themes from the Drupal themes download section.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) . '
  6. '; - $default_message .= '
  7. ' . t('Start posting content Finally, you can add new content for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) . '
  8. '; - $default_message .= '
'; - $default_message .= '

' . t('For more information, please refer to the help section, or the online Drupal handbooks. You may also post at the Drupal forum, or view the wide range of other support options available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) . '

'; + drupal_set_title(t('Welcome to @site-name', array('@site-name' => variable_get('site_name', 'Drupal')))); + + $default_message = '

' . t('No front page content has been created yet.') . '

'; + + if (user_access('access administration pages')) { + $default_links = array ( + l(t('Create content'), 'node/add'), + l(t('Change the default front page'), 'admin/settings/site-information'), + ); + $default_message .= theme('item_list', $default_links); + } + $build['default_message'] = array( '#markup' => $default_message, '#prefix' => '
', '#suffix' => '
', ); } - drupal_set_title(''); return $build; } diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test index 227aa13e7fe..45d2d15b4c1 100644 --- a/modules/simpletest/simpletest.test +++ b/modules/simpletest/simpletest.test @@ -45,7 +45,7 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase { if (!$this->inCURL()) { $this->drupalGet('node'); $this->assertTrue($this->drupalGetHeader('Date'), t('An HTTP header was received.')); - $this->assertTitle(variable_get('site_name', 'Drupal'), t('Site title matches.')); + $this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), t('Site title matches.')); $this->assertNoTitle('Foo', t('Site title does not match.')); // Make sure that we are locked out of the installer when prefixing // using the user-agent header. This is an important security check. diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 28431372524..9b91d5775ee 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -302,7 +302,7 @@ class DrupalHTTPRequestTestCase extends DrupalWebTestCase { $result = drupal_http_request(url('node', array('absolute' => TRUE))); $this->assertEqual($result->code, 200, t('Fetched page successfully.')); $this->drupalSetContent($result->data); - $this->assertTitle(variable_get('site_name', 'Drupal'), t('Site title matches.')); + $this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), t('Site title matches.')); // Test that code and status message is returned. $result = drupal_http_request(url('pagedoesnotexist', array('absolute' => TRUE)));