function template_preprocess_pagestyle_image in Page Style 6
Same name and namespace in other branches
- 7 includes/pagestyle.block.inc \template_preprocess_pagestyle_image()
Process variables for pagestyle-image.tpl.php.
The $variables array contains the following arguments:
- $dest: The drupal function drupal_get_destination().
- $block_title: Block title: "Page Style" or "Theme".
- $list_inline: Display the ul list "inline" or not.
- $current_inline: Display the current page style "inline" or not.
- $subtitle: The subtitle.
- $subtitle_text: "Page Style"/"Theme" or inline "Page Style: "/"Theme: ".
- $display_links: Show or hide ("display_hidden") the text in the links.
- $black_white: The pagestyle Black/White "black_white".
- $white_black: The pagestyle White/Black "white_black".
- $yellow_blue: The pagestyle Yellow/Blue "yellow_blue".
- $standard: The pagestyle Standard "standard".
- $current_pagestyle: The current page style.
- $display_current_pagestyle: Show or hide ("display_hidden") the text of the current page style.
- $display_current_pagestyle_text: Show or hide ("display_hidden");
- $current_pagestyle_text: The current pagestyle text "Current Style" or "Current Theme".
- $pagestyle: The current page style (default Standard).
See also
pagestyle_theme(), pagestyle-image.tpl.php
File
- includes/
pagestyle.block.inc, line 507 - Block, page and theme functions.
Code
function template_preprocess_pagestyle_image(&$variables) {
$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);
if (isset($variables['block'])) {
$variables['template_files'][] = 'pagestyle-image';
}
$variables['block_' . $pagestyle_block_type] = 'block_' . $pagestyle_block_type;
$variables['dest'] = drupal_get_destination();
$variables['block_title'] = $pagestyle_block_title;
$variables['list_inline'] = "list";
$subtitle_add = NULL;
if (variable_get('pagestyle_display_list_inline', 0) == 1) {
$variables['list_inline'] = "inline";
$subtitle_add = ": ";
}
$variables['current_inline'] = "pagestyle_current_list";
if (variable_get('pagestyle_display_current_inline', 0) == 1) {
$variables['current_inline'] = "pagestyle_current_inline";
}
$variables['subtitle'] = NULL;
$variables['subtitle_text'] = NULL;
if (variable_get('pagestyle_display_subtitle', 0) == 1) {
$variables['subtitle'] = "subtitle";
$variables['subtitle_text'] = $pagestyle_block_title . $subtitle_add;
}
$variables['display_links'] = "display";
if (variable_get('pagestyle_display_links', 1) == 0) {
$variables['display_links'] = "display_hidden";
}
$variables['black_white'] = NULL;
if ($pagestyle_black_white == 1) {
$variables['black_white'] = "black_white";
}
$variables['white_black'] = NULL;
if ($pagestyle_white_black == 1) {
$variables['white_black'] = "white_black";
}
$variables['yellow_blue'] = NULL;
if ($pagestyle_yellow_blue == 1) {
$variables['yellow_blue'] = "yellow_blue";
}
$variables['standard'] = NULL;
if ($pagestyle_standard == 1) {
$variables['standard'] = "standard";
}
$variables['current_pagestyle'] = NULL;
$variables['display_current_pagestyle'] = "display";
$variables['display_current_pagestyle_text'] = "display";
switch (variable_get('pagestyle_display_current_text_value', 'text_value')) {
case "text_value":
$variables['current_pagestyle'] = "current_pagestyle";
$variables['display_current_pagestyle'] = "display";
$variables['display_current_pagestyle_text'] = "display";
break;
case "value":
$variables['current_pagestyle'] = "current_pagestyle";
$variables['display_current_pagestyle'] = "display";
$variables['display_current_pagestyle_text'] = "display_hidden";
break;
case "hidden":
$variables['current_pagestyle'] = "current_pagestyle";
$variables['display_current_pagestyle'] = "display_hidden";
$variables['display_current_pagestyle_text'] = "display_hidden";
break;
case "remove":
$variables['display_current_pagestyle'] = "display_hidden";
$variables['display_current_pagestyle_text'] = "display_hidden";
break;
}
$variables['current_pagestyle_text'] = $pagestyle_current_pagestyle_text;
$variables['pagestyle'] = pagestyle_get_current($value = 'name');
}