function block_help

Implements hook_help().

File

drupal/core/modules/block/block.module, line 46
Controls the visual building blocks a page is constructed with.

Code

function block_help($path, $arg) {
  switch ($path) {
    case 'admin/help#block':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Block module allows you to create boxes of content, which are rendered into an area, or region, of one or more pages of a website. The core Seven administration theme, for example, implements the regions "Content" and "Help", and a block may appear in either of these regions. The <a href="@blocks">Blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. For more information, see the online handbook entry for <a href="@block">Block module</a>.', array(
        '@block' => 'http://drupal.org/documentation/modules/block',
        '@blocks' => url('admin/structure/block'),
      )) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Positioning content') . '</dt>';
      $output .= '<dd>' . t('When working with blocks, remember that all themes do <em>not</em> implement the same regions, or display regions in the same way. Blocks are positioned on a per-theme basis. Users with the <em>Administer blocks</em> permission can disable blocks. Disabled blocks are listed on the <a href="@blocks">Blocks administration page</a>, but are not displayed in any region.', array(
        '@block' => 'http://drupal.org/documentation/modules/block',
        '@blocks' => url('admin/structure/block'),
      )) . '</dd>';
      $output .= '<dt>' . t('Controlling visibility') . '</dt>';
      $output .= '<dd>' . t('Blocks can be configured to be visible only on certain pages, only to users of certain roles, or only on pages displaying certain <a href="@content-type">content types</a>. Administrators can also allow specific blocks to be enabled or disabled by users when they edit their <a href="@user">My account</a> page. Some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.', array(
        '@content-type' => url('admin/structure/types'),
        '@user' => url('user'),
      )) . '</dd>';
      $output .= '<dt>' . t('Creating custom blocks') . '</dt>';
      $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can <a href="@block-add">add custom blocks</a>, which are then listed on the <a href="@blocks">Blocks administration page</a>. Once created, custom blocks behave just like default and module-generated blocks.', array(
        '@blocks' => url('admin/structure/block'),
        '@block-add' => url('admin/structure/block/add'),
      )) . '</dd>';
      $output .= '</dl>';
      return $output;
    case 'admin/structure/block/add':
      return '<p>' . t('Use this page to create a new custom block.') . '</p>';
  }
  if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list')) {
    $demo_theme = !empty($arg[4]) ? $arg[4] : variable_get('theme_default', 'stark');
    $themes = list_themes();
    $output = '<p>' . 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 <em>Save blocks</em> button at the bottom of the page. Click the <em>configure</em> link next to each block to configure its specific title and visibility settings.') . '</p>';
    $output .= '<p>' . l(t('Demonstrate block regions (@theme)', array(
      '@theme' => $themes[$demo_theme]->info['name'],
    )), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
    return $output;
  }
}