function theme_textsize_text in Text Size 5
Implement theme().
See also
1 theme call to theme_textsize_text()
- textsize_block in ./
textsize.module - Implement hook_block().
File
- includes/
textsize.block.inc, line 363 - block, page and theme functions.
Code
function theme_textsize_text() {
$textsize_block_title = textsize_block_title($title = 'title');
$textsize_current_textsize_text = textsize_block_title($title = 'current');
$dest = drupal_get_destination();
$list_inline = variable_get('textsize_list_inline', 'list');
$link_type = variable_get('textsize_link_type', 'variable');
$display_links = variable_get('textsize_display_links', 'display');
$increment = variable_get('textsize_increment', 5);
$normal = variable_get('textsize_normal', 75);
$display_current_textsize = variable_get('textsize_display_current_textsize', 'display');
$textsize = textsize_get_current($value = 'display');
$block_title = $textsize_block_title;
$current_textsize_text = $textsize_current_textsize_text;
$list_inline = "list";
$subtitle_add = NULL;
if (variable_get('textsize_display_list_inline', 0) == 1) {
$list_inline = "inline";
$subtitle_add = ": ";
}
$current_inline = "textsize_current_list";
if (variable_get('textsize_display_current_inline', 0) == 1) {
$current_inline = "textsize_current_inline";
}
$subtitle = NULL;
$subtitle_text = NULL;
if (variable_get('textsize_display_subtitle', 0) == 1) {
$subtitle = "subtitle";
$subtitle_text = $textsize_block_title . $subtitle_add;
}
$textsize_increase = NULL;
if (variable_get('textsize_display_increase', 1) == 1) {
$textsize_increase = "textsize_increase";
}
$textsize_decrease = NULL;
if (variable_get('textsize_display_decrease', 1) == 1) {
$textsize_decrease = "textsize_decrease";
}
$textsize_normal = NULL;
if (variable_get('textsize_display_normal', 1) == 1) {
$textsize_normal = "textsize_normal";
}
$display_links = "display";
if (variable_get('textsize_display_links', 1) == 0) {
$display_links = "display_hidden";
}
$current_textsize = NULL;
$display_current_textsize = "display";
$display_current_textsize_text = "display";
switch (variable_get('textsize_display_current_text_value', 'text_value')) {
case "text_value":
$current_textsize = "current_textsize";
$display_current_textsize = "display";
$display_current_textsize_text = "display";
break;
case "value":
$current_textsize = "current_textsize";
$display_current_textsize = "display";
$display_current_textsize_text = "display_hidden";
break;
case "hidden":
$current_textsize = "current_textsize";
$display_current_textsize = "display_hidden";
$display_current_textsize_text = "display_hidden";
break;
case "remove":
$display_current_textsize = "display_hidden";
$display_current_textsize_text = "display_hidden";
break;
}
if ($subtitle) {
$output .= '<h3 class="' . $list_inline . '">' . $subtitle_text . '</h3>' . "\n";
}
$output .= '<ul class="textsize_' . $list_inline . '">' . "\n";
if ($textsize_increase) {
$output .= ' <li class="ts_increase_' . check_plain($link_type) . '">' . l('<span class="' . $display_links . '">' . t('Increase') . '</span>', 'textsize/increase', $attributes = array(
'title' => $block_title . ': ' . t('Increase') . ' +' . $increment . '%',
'class' => 'ts_icon ts_increase_' . check_plain($link_type) . ' textsize_increase text_' . $display_links,
), $query = $dest, $fragment = NULL, $absolute = FALSE, $html = TRUE) . '</li>' . "\n";
}
if ($textsize_decrease) {
$output .= ' <li class="ts_decrease_' . check_plain($link_type) . '">' . l('<span class="' . $display_links . '">' . t('Decrease') . '</span>', 'textsize/decrease', $attributes = array(
'title' => $block_title . ': ' . t('Decrease') . ' -' . $increment . '%',
'class' => 'ts_icon ts_decrease_' . check_plain($link_type) . ' textsize_decrease text_' . $display_links,
), $query = $dest, $fragment = NULL, $absolute = FALSE, $html = TRUE) . '</li>' . "\n";
}
if ($textsize_normal) {
$output .= ' <li class="ts_normal_' . check_plain($link_type) . '">' . l('<span class="' . $display_links . '">' . t('Normal') . '</span>', 'textsize/normal', $attributes = array(
'title' => $block_title . ': ' . t('Normal') . ' =' . $normal . '%',
'class' => 'ts_icon ts_normal_' . check_plain($link_type) . ' textsize_normal text_' . $display_links,
), $query = $dest, $fragment = NULL, $absolute = FALSE, $html = TRUE) . '</li>' . "\n";
}
$output .= '</ul>' . "\n";
if ($current_textsize) {
$output .= '<p class="textsize_current ' . $current_inline . ' ' . $display_current_textsize . ' current_text_' . $display_current_textsize_text . '"><span class="' . $display_current_textsize_text . '">' . $current_textsize_text . ': </span><span id="textsize_current" title="' . $current_textsize_text . ': ' . $textsize . '%">' . $textsize . '%</span></p>' . "\n";
}
$output .= '<div class="ts_clear"></div>' . "\n";
return $output;
}