You are here

function theme_pagestyle_text in Page Style 5

Implement theme().

See also

pagestyle_block()

1 theme call to theme_pagestyle_text()
pagestyle_block in ./pagestyle.module
Implement hook_block().

File

includes/pagestyle.block.inc, line 317
Block, page and theme functions.

Code

function theme_pagestyle_text() {
  $pagestyle_block_title = pagestyle_block_title($title = 'title');
  $pagestyle_current_pagestyle_text = pagestyle_block_title($title = 'current');
  $pagestyle_block_type = variable_get('pagestyle_block_type', 'text');
  $pagestyle_black_white = variable_get('pagestyle_black_white', 1);
  $pagestyle_white_black = variable_get('pagestyle_white_black', 1);
  $pagestyle_yellow_blue = variable_get('pagestyle_yellow_blue', 1);
  $pagestyle_standard = variable_get('pagestyle_standard', 1);
  $block_[$pagestyle_block_type] = 'block_' . $pagestyle_block_type;
  $dest = drupal_get_destination();
  $block_title = $pagestyle_block_title;
  $list_inline = "list";
  $subtitle_add = NULL;
  if (variable_get('pagestyle_display_list_inline', 0) == 1) {
    $list_inline = "inline";
    $subtitle_add = ": ";
  }
  $current_inline = "pagestyle_current_list";
  if (variable_get('pagestyle_display_current_inline', 0) == 1) {
    $current_inline = "pagestyle_current_inline";
  }
  $subtitle = NULL;
  $subtitle_text = NULL;
  if (variable_get('pagestyle_display_subtitle', 0) == 1) {
    $subtitle = "subtitle";
    $subtitle_text = $pagestyle_block_title . $subtitle_add;
  }
  $display_links = "display";
  if (variable_get('pagestyle_display_links', 1) == 0) {
    $display_links = "display_hidden";
  }
  $black_white = NULL;
  if ($pagestyle_black_white == 1) {
    $black_white = "black_white";
  }
  $white_black = NULL;
  if ($pagestyle_white_black == 1) {
    $white_black = "white_black";
  }
  $yellow_blue = NULL;
  if ($pagestyle_yellow_blue == 1) {
    $yellow_blue = "yellow_blue";
  }
  $standard = NULL;
  if ($pagestyle_standard == 1) {
    $standard = "standard";
  }
  $current_pagestyle = NULL;
  $display_current_pagestyle = "display";
  $display_current_pagestyle_text = "display";
  switch (variable_get('pagestyle_display_current_text_value', 'text_value')) {
    case "text_value":
      $current_pagestyle = "current_pagestyle";
      $display_current_pagestyle = "display";
      $display_current_pagestyle_text = "display";
      break;
    case "value":
      $current_pagestyle = "current_pagestyle";
      $display_current_pagestyle = "display";
      $display_current_pagestyle_text = "display_hidden";
      break;
    case "hidden":
      $current_pagestyle = "current_pagestyle";
      $display_current_pagestyle = "display_hidden";
      $display_current_pagestyle_text = "display_hidden";
      break;
    case "remove":
      $display_current_pagestyle = "display_hidden";
      $display_current_pagestyle_text = "display_hidden";
      break;
  }
  $current_pagestyle_text = $pagestyle_current_pagestyle_text;
  $pagestyle = pagestyle_get_current($value = 'name');
  if ($subtitle) {
    $output .= '<h3 class="' . $list_inline . '">' . $subtitle_text . '</h3>' . "\n";
  }
  $output .= '<ul class="pagestyle_' . $list_inline . '">' . "\n";
  if ($black_white) {
    $output .= '  <li class="ps_black_white">' . l('<span class="' . $display_links . '">' . t('Black') . '/' . t('White') . '</span>', 'pagestyle/black_white', $attributes = array(
      'title' => $block_title . ': ' . t('Black') . '/' . t('White'),
      'class' => 'ps_icon ps_black_white' . $link_type . ' pagestyle_black_white text_' . $display_links,
    ), $query = $dest, $fragment = NULL, $absolute = FALSE, $html = TRUE) . '</li>' . "\n";
  }
  if ($white_black) {
    $output .= '  <li class="ps_white_black">' . l('<span class="' . $display_links . '">' . t('White') . '/' . t('Black') . '</span>', 'pagestyle/white_black', $attributes = array(
      'title' => $block_title . ': ' . t('White') . '/' . t('Black'),
      'class' => 'ps_icon ps_white_black' . $link_type . ' pagestyle_white_black text_' . $display_links,
    ), $query = $dest, $fragment = NULL, $absolute = FALSE, $html = TRUE) . '</li>' . "\n";
  }
  if ($yellow_blue) {
    $output .= '  <li class="ps_yellow_blue">' . l('<span class="' . $display_links . '">' . t('Yellow') . '/' . t('Blue') . '</span>', 'pagestyle/yellow_blue', $attributes = array(
      'title' => $block_title . ': ' . t('Yellow') . '/' . t('Blue'),
      'class' => 'ps_icon ps_yellow_blue' . $link_type . ' pagestyle_yellow_blue text_' . $display_links,
    ), $query = $dest, $fragment = NULL, $absolute = FALSE, $html = TRUE) . '</li>' . "\n";
  }
  if ($standard) {
    $output .= '  <li>' . l('<span class="' . $display_links . '">' . t('Standard') . '</span>', 'pagestyle/standard', $attributes = array(
      'title' => $block_title . ': ' . t('Standard'),
      'class' => 'ps_icon ps_standard' . $link_type . ' pagestyle_standard text_' . $display_links,
    ), $query = $dest, $fragment = NULL, $absolute = FALSE, $html = TRUE) . '</li>' . "\n";
  }
  $output .= '</ul>' . "\n";
  if ($current_pagestyle) {
    $output .= '<p class="pagestyle_current ' . $current_inline . ' ' . $display_current_pagestyle . ' current_text_' . $display_current_pagestyle_text . '"><span class="' . $display_current_pagestyle_text . '">' . $current_pagestyle_text . ': </span><span id="pagestyle_current" title="' . $current_pagestyle_text . ': ' . $pagestyle . '">' . $pagestyle . '</span></p>' . "\n";
  }
  $output .= '<div class="ps_clear"></div>' . "\n";
  return $output;
}