You are here

function blockify_get_content in Blockify 7

Same name and namespace in other branches
  1. 8 blockify.module \blockify_get_content()
  2. 6 blockify.module \blockify_get_content()

Provides individual block content.

1 call to blockify_get_content()
blockify_block_view in ./blockify.module
Implements hook_block_view().

File

./blockify.module, line 107
Exposes a number of core Drupal elements as blocks.

Code

function blockify_get_content($delta) {
  global $theme_key;
  $variables = array();
  switch ($delta) {
    case 'blockify-logo':
      $variables['logo_path'] = theme_get_setting('logo');
      if (empty($variables['logo_path'])) {
        $variables['logo_path'] = theme_get_setting('logo_path');
        if (empty($variables['logo_path']) || theme_get_setting('default_logo')) {
          $variables['logo_path'] = drupal_get_path('theme', $theme_key) . '/logo.png';
        }
      }
      return theme('blockify_logo', $variables);
    case 'blockify-site-name':
      $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
      return theme('blockify_site_name', $variables);
    case 'blockify-site-slogan':
      $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
      return theme('blockify_site_slogan', $variables);
    case 'blockify-page-title':
      $variables['page_title'] = drupal_get_title();
      return theme('blockify_page_title', $variables);
    case 'blockify-breadcrumb':
      if (function_exists('path_breadcrumbs_set_breadcrumb')) {
        path_breadcrumbs_set_breadcrumb();
      }
      $variables['breadcrumb'] = drupal_get_breadcrumb();
      return theme('blockify_breadcrumb', $variables);
    case 'blockify-messages':
      return array(
        '#theme' => 'status_messages',
      );
    case 'blockify-tabs':
      $variables['primary'] = menu_primary_local_tasks();
      $variables['secondary'] = menu_secondary_local_tasks();
      return theme('blockify_menu_local_tasks', $variables);
    case 'blockify-actions':
      $variables['menu_local_actions'] = menu_local_actions();
      return theme('blockify_local_actions', $variables);
    case 'blockify-feed-icons':
      $variables['feed_icons'] = drupal_get_feeds();
      return theme('blockify_feed_icons', $variables);
  }
}