diff --git a/core/modules/help/help-rtl.css b/core/modules/help/help-rtl.css index 8e40a8c..ce103d2 100644 --- a/core/modules/help/help-rtl.css +++ b/core/modules/help/help-rtl.css @@ -1,10 +1,10 @@ .help-items { float: right; - padding-right: 0; padding-left: 3%; + padding-right: 0; } .help-items-last { - padding-right: 0; padding-left: 0; + padding-right: 0; } diff --git a/core/modules/help/help.admin.inc b/core/modules/help/help.admin.inc index 0a8e147..28ac445 100644 --- a/core/modules/help/help.admin.inc +++ b/core/modules/help/help.admin.inc @@ -11,7 +11,7 @@ * @see help_menu() */ function help_main() { - // Add CSS + // Add CSS. drupal_add_css(drupal_get_path('module', 'help') . '/help.css'); $output = '

' . t('Help topics') . '

' . t('Help is available on the following items:') . '

' . help_links_as_list(); return $output; @@ -20,7 +20,7 @@ function help_main() { /** * Page callback: Prints a page listing general help for a module. * - * @param $name + * @param string $name * A module name to display a help page for. * * @see help_menu() @@ -47,7 +47,13 @@ function help_page($name) { foreach ($admin_tasks as $task) { $links[] = l($task['title'], $task['link_path'], $task['localized_options']); } - $output .= theme('item_list', array('items' => $links, 'title' => t('@module administration pages', array('@module' => $info[$name]['name'])))); + $output .= theme('item_list', array( + 'items' => $links, + 'title' => t('@module administration pages', array( + '@module' => $info[$name]['name'], + )), + ) + ); } } return $output; @@ -56,7 +62,7 @@ function help_page($name) { /** * Provides a formatted list of available help topics. * - * @return + * @return string * A string containing the formatted list. */ function help_links_as_list() { @@ -87,4 +93,3 @@ function help_links_as_list() { return $output; } - diff --git a/core/modules/help/help.api.php b/core/modules/help/help.api.php index f7d9c08..30ae58b 100644 --- a/core/modules/help/help.api.php +++ b/core/modules/help/help.api.php @@ -20,7 +20,7 @@ * * For a detailed usage example, see page_example.module. * - * @param $path + * @param string $path * The router menu path, as defined in hook_menu(), for the help that is * being requested; e.g., 'admin/people' or 'user/register'. If the router * path includes a wildcard, then this will appear in $path as %, even if it @@ -32,7 +32,7 @@ * 'admin/help#modulename' * The main module help text, displayed on the admin/help/modulename * page and linked to from the admin/help page. - * @param $arg + * @param array $arg * An array that corresponds to the return value of the arg() function, for * modules that want to provide help that is specific to certain values * of wildcards in $path. For example, you could provide help for the path @@ -43,16 +43,16 @@ * hook_help, $arg may contain only empty strings. Regardless, $arg[0] to * $arg[11] will always be set. * - * @return + * @return string * A localized string containing the help text. */ function hook_help($path, $arg) { switch ($path) { - // Main module help for the block module + // Main module help for the block module. case 'admin/help#block': return '

' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '

'; - // Help for another path in the block module + // Help for another path in the block module. case 'admin/structure/block': return '

' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '

'; } diff --git a/core/modules/help/help.css b/core/modules/help/help.css index 9228170..56762d3 100644 --- a/core/modules/help/help.css +++ b/core/modules/help/help.css @@ -1,8 +1,8 @@ .help-items { float: left; /* LTR */ - width: 22%; padding-right: 3%; /* LTR */ + width: 22%; } .help-items-last { padding-right: 0; /* LTR */ diff --git a/core/modules/help/help.module b/core/modules/help/help.module index a74bf52..87e6cb7 100644 --- a/core/modules/help/help.module +++ b/core/modules/help/help.module @@ -50,12 +50,21 @@ function help_help($path, $arg) { $output .= '
  • ' . t('Start posting content Finally, you can add new content for your website.', array('@content' => url('node/add'))) . '
  • '; } $output .= ''; - $output .= '

    ' . t('For more information, refer to the specific topics listed in the next section or to 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/documentation', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) . '

    '; + $output .= '

    ' . t('For more information, refer to the specific topics listed in the next section or to 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/documentation', + '@forum' => 'http://drupal.org/forum', + '@support' => 'http://drupal.org/support', + )) . '

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

    ' . t('About') . '

    '; - $output .= '

    ' . t('The Help module provides Help reference pages and context-sensitive advice to guide you through the use and configuration of modules. It is a starting point for the online Drupal handbooks. The handbooks contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online handbook entry for the Help module.', array('@help' => 'http://drupal.org/documentation/modules/help/', '@handbook' => 'http://drupal.org/documentation', '@help-page' => url('admin/help'))) . '

    '; + $output .= '

    ' . t('The Help module provides Help reference pages and context-sensitive advice to guide you through the use and configuration of modules. It is a starting point for the online Drupal handbooks. The handbooks contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online handbook entry for the Help module.', array( + '@help' => 'http://drupal.org/documentation/modules/help/', + '@handbook' => 'http://drupal.org/documentation', + '@help-page' => url('admin/help'), + )) . '

    '; $output .= '

    ' . t('Uses') . '

    '; $output .= '
    '; $output .= '
    ' . t('Providing a help reference') . '
    '; @@ -68,7 +77,9 @@ function help_help($path, $arg) { } /** - * Implements hook_preprocess_HOOK() for block.tpl.php. + * Implements hook_preprocess_HOOK(). + * + * This implementation is for block.tpl.php. */ function help_preprocess_block(&$variables) { if ($variables['block']->module == 'system' && $variables['block']->delta == 'help') { diff --git a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php index 8404d85..47be4bd 100644 --- a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php +++ b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php @@ -27,13 +27,16 @@ class HelpTest extends WebTestBase { /** * The admin user that will be created. */ - protected $big_user; + protected $bigUser; /** * The anonymous user that will be created. */ - protected $any_user; + protected $anyUser; + /** + * Returns Info. + */ public static function getInfo() { return array( 'name' => 'Help functionality', @@ -42,30 +45,37 @@ class HelpTest extends WebTestBase { ); } - function setUp() { + /** + * Setup function. + */ + public function setUp() { parent::setUp(); $this->getModuleList(); // Create users. - $this->big_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer permissions')); - $this->any_user = $this->drupalCreateUser(array()); + $this->bigUser = $this->drupalCreateUser(array( + 'access administration pages', + 'view the administration theme', + 'administer permissions', + )); + $this->anyUser = $this->drupalCreateUser(array()); } /** * Logs in users, creates dblog events, and tests dblog functionality. */ - function testHelp() { + public function testHelp() { // Login the admin user. - $this->drupalLogin($this->big_user); + $this->drupalLogin($this->bigUser); $this->verifyHelp(); // Login the regular user. - $this->drupalLogin($this->any_user); + $this->drupalLogin($this->anyUser); $this->verifyHelp(403); // Check for css on admin/help. - $this->drupalLogin($this->big_user); + $this->drupalLogin($this->bigUser); $this->drupalGet('admin/help'); $this->assertRaw(drupal_get_path('module', 'help') . '/help.css', t('The help.css file is present in the HTML.')); @@ -93,9 +103,9 @@ class HelpTest extends WebTestBase { $this->drupalGet('admin/help/' . $module); $this->assertResponse($response); if ($response == 200) { - $this->assertTitle($name . ' | Drupal', t('[' . $module . '] Title was displayed')); - $this->assertRaw('

    ' . t($name) . '

    ', t('[' . $module . '] Heading was displayed')); - } + $this->assertTitle($name . ' | Drupal', t("[$module] Title was displayed")); + $this->assertRaw('

    ' . t($name) . '

    ', t("[$module] Heading was displayed")); + } } } diff --git a/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php b/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php index 933c20f..2e212bb 100644 --- a/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php +++ b/core/modules/help/lib/Drupal/help/Tests/NoHelpTest.php @@ -26,8 +26,11 @@ class NoHelpTest extends WebTestBase { /** * The user who will be created. */ - protected $big_user; + protected $bigUser; + /** + * Returns Info. + */ public static function getInfo() { return array( 'name' => 'No help', @@ -36,16 +39,19 @@ class NoHelpTest extends WebTestBase { ); } - function setUp() { + /** + * Setup function. + */ + public function setUp() { parent::setUp(); - $this->big_user = $this->drupalCreateUser(array('access administration pages')); + $this->bigUser = $this->drupalCreateUser(array('access administration pages')); } /** * Ensures modules not implementing help do not appear on admin/help. */ - function testMainPageNoHelp() { - $this->drupalLogin($this->big_user); + public function testMainPageNoHelp() { + $this->drupalLogin($this->bigUser); $this->drupalGet('admin/help'); $this->assertNoText('Hook menu tests', t('Making sure the test module menu_test does not display a help link in admin/help'));