function pagestyle_admin_settings in Page Style 5
Same name and namespace in other branches
- 6 includes/pagestyle.admin.inc \pagestyle_admin_settings()
- 7 includes/pagestyle.admin.inc \pagestyle_admin_settings()
Builds and returns the pagestyle settings form.
See also
pagestyle_validate_form()
1 string reference to 'pagestyle_admin_settings'
- pagestyle_menu in ./
pagestyle.module - Implement hook_menu().
File
- includes/
pagestyle.admin.inc, line 143 - Provides the Page Style administrative interface.
Code
function pagestyle_admin_settings() {
$abbr_php = '<abbr lang="en" xml:lang="en" title="' . t('PHP: Hypertext Preprocessor') . '">PHP</abbr>';
$abbr_xhtml = '<abbr lang="en" xml:lang="en" title="' . t('Extensible Hypertext Markup Language') . '">XHTML</abbr>';
$abbr_css = '<abbr lang="en" xml:lang="en" title="' . t('Cascading Style Sheets') . '">CSS</abbr>';
$abbr_wcag = '<abbr lang="en xml:lang="en" title="' . t('Web Content Accessibility Guidelines') . '">WCAG</abbr>';
$abbr_bitv = '<abbr lang="de" xml:lang="de" title="' . t('Barrierefreie Informationstechnik-Verordnung') . '">BITV</abbr>';
$abbr_id = '<abbr lang="en" xml:lang="en" title="' . t('Identification') . '">ID</abbr>';
$link_footnote_1 = l('1', 'admin/settings/pagestyle', $attributes = array(
'title' => t('Footnote') . ' 1',
), $query = NULL, $fragment = 'footnote-1');
$link_footnote_2 = l('2', 'admin/settings/pagestyle', $attributes = array(
'title' => t('Footnote') . ' 2',
), $query = NULL, $fragment = 'footnote-2');
$link_footnote_3 = l('3', 'admin/settings/pagestyle', $attributes = array(
'title' => t('Footnote') . ' 3',
), $query = NULL, $fragment = 'footnote-3');
$pagestyle_fontweight = array(
'lighter' => t('Lighter'),
'normal' => t('Normal'),
'bold' => t('Bold'),
'bolder' => t('Bolder'),
'100' => 100 . ' (' . t('Lighter') . ')',
'200' => 200,
'300' => 300,
'400' => 400 . ' (' . t('Normal') . ')',
'500' => 500 . ' (' . t('Medium') . ')',
'600' => 600,
'700' => 700 . ' (' . t('Bold') . ')',
'800' => 800,
'900' => 900 . ' (' . t('Bolder') . ')',
);
$form['pagestyle'] = array(
'#type' => 'fieldset',
'#title' => t('Global settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['pagestyle']['pagestyle_block_title'] = array(
'#type' => 'radios',
'#title' => t('Block title'),
'#options' => array(
'page_style' => t('Page Style'),
'theme' => t('Theme'),
),
'#default_value' => variable_get('pagestyle_block_title', 'page_style'),
'#description' => t('Select the block title.') . ' ' . t('Default') . ': "' . t('Page Style') . '".',
);
$form['pagestyle']['pagestyle_block_type'] = array(
'#type' => 'radios',
'#title' => t('Block type'),
'#options' => array(
'text' => t('Text links') . ' [' . $link_footnote_1 . ']',
'image' => t('Image links') . ' [' . $link_footnote_2 . ']',
'select' => t('Select menu'),
),
'#default_value' => variable_get('pagestyle_block_type', 'text'),
'#description' => t('Select the type of block.') . ' ' . t('Default') . ': "' . t('Text links') . ' <br /><span id="footnote-1">[1] ' . t('Images are showed with !abbr_css.', array(
'!abbr_css' => $abbr_css,
)) . ' <span class="ps_ok">' . t('Ideal for Web Accessibility.') . '</span></span><br /><span id="footnote-2">[2] ' . t('Images in the !abbr_xhtml source code.', array(
'!abbr_xhtml' => $abbr_xhtml,
)) . ' <span class="ps_warning">' . t('Warning') . ': ' . t('Not for: !abbr_wcag/!abbr_bitv 3.1! No hover action if !javascript is not activated!', array(
'!abbr_wcag' => $abbr_wcag,
'!abbr_bitv' => $abbr_bitv,
'!javascript' => '<em lang="en">JavaScript</em>',
)) . '</span></span>',
);
$form['pagestyle_adv'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['pagestyle_adv']['pagestyle_normal'] = array(
'#type' => 'select',
'#title' => t('Normal Page Style'),
'#options' => array(
'black_white' => t('Black') . '/' . t('White'),
'white_black' => t('White') . '/' . t('Black'),
'yellow_blue' => t('Yellow') . '/' . t('Blue'),
'standard' => t('Standard'),
),
'#default_value' => variable_get('pagestyle_normal', 'standard'),
'#description' => t('Select the normal page style.') . ' ' . t('Default') . ': "' . t('Standard') . '".',
'#attributes' => array(
'class' => 'pagestyle_admin',
),
);
$form['pagestyle_adv']['pagestyle_javascript'] = array(
'#type' => 'checkbox',
'#title' => t('Support !javascript', array(
'!javascript' => '<em lang="en">JavaScript</em>',
)),
'#default_value' => variable_get('pagestyle_javascript', 1),
'#description' => t('Support !javascript (!jquery) or only !abbr_php for caching mode: "Normal" and "Aggressive" and anonymous users.', array(
'!abbr_php' => $abbr_php,
'!javascript' => '<em lang="en">JavaScript</em>',
'!jquery' => '<em lang="en">jQuery</em>',
)) . ' ' . t('Default') . ': ' . t('Checked.'),
);
$form['pagestyle_adv']['pagestyle_message'] = array(
'#type' => 'checkbox',
'#title' => t('Display message after changing page style'),
'#default_value' => variable_get('pagestyle_message', 1),
'#description' => t('Default') . ': ' . t('Checked.'),
);
$form['pagestyle_adv']['pagestyle_cookie_expires'] = array(
'#type' => 'textfield',
'#title' => t('Cookie Expires'),
'#size' => 4,
'#maxlength' => 4,
'#field_suffix' => t('days'),
'#default_value' => variable_get('pagestyle_cookie_expires', 365),
'#description' => t('Default') . ': "365" ' . t('days') . '. ' . t('Allowed values') . ': 1-3650 ' . t('days') . '.',
'#required' => TRUE,
);
$form['pagestyle_adv']['pagestyle_cookie_domain'] = array(
'#type' => 'textfield',
'#title' => t('Cookie Domain'),
'#size' => 40,
'#maxlength' => 100,
'#field_prefix' => 'http://' . $_SERVER['SERVER_NAME'],
'#default_value' => variable_get('pagestyle_cookie_domain', base_path()),
'#description' => t('Default') . ': "' . base_path() . '". <span class="ps_warning">' . t('Warning') . ': ' . t('After a change, the user must store the cookie again.') . '</span>',
'#required' => TRUE,
);
$form['pagestyle_theme'] = array(
'#type' => 'fieldset',
'#title' => t('Theme settings'),
'#description' => t('Enable, disable or set the display of certain page styles and elements.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['pagestyle_theme']['pagestyle_display'] = array(
'#type' => 'fieldset',
'#title' => t('Toggle display'),
'#description' => t('Enable or disable the display of certain page styles and elements.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['pagestyle_theme']['pagestyle_display']['pagestyle_display_subtitle'] = array(
'#type' => 'checkbox',
'#title' => t('Subtitle'),
'#default_value' => variable_get('pagestyle_display_subtitle', 0),
'#description' => t('Ideal for image links and the select menue (title as label).') . ' ' . t('Default') . ': ' . t('Not checked.'),
);
$form['pagestyle_theme']['pagestyle_display']['pagestyle_black_white'] = array(
'#type' => 'checkbox',
'#title' => t('Black') . '/' . t('White'),
'#default_value' => variable_get('pagestyle_black_white', 1),
'#description' => t('Default') . ': ' . t('Checked.'),
);
$form['pagestyle_theme']['pagestyle_display']['pagestyle_white_black'] = array(
'#type' => 'checkbox',
'#title' => t('White') . '/' . t('Black'),
'#default_value' => variable_get('pagestyle_white_black', 1),
'#description' => t('Default') . ': ' . t('Checked.'),
);
$form['pagestyle_theme']['pagestyle_display']['pagestyle_yellow_blue'] = array(
'#type' => 'checkbox',
'#title' => t('Yellow') . '/' . t('Blue'),
'#default_value' => variable_get('pagestyle_yellow_blue', 1),
'#description' => t('Default') . ': ' . t('Checked.'),
);
$form['pagestyle_theme']['pagestyle_display']['pagestyle_standard'] = array(
'#type' => 'checkbox',
'#title' => t('Standard'),
'#description' => '<span class="info">' . t('Minimum 2 styles are required.') . '</span>',
'#default_value' => variable_get('pagestyle_standard', 1),
'#description' => t('Default') . ': ' . t('Checked.'),
);
$form['pagestyle_theme']['pagestyle_display']['pagestyle_display_links'] = array(
'#type' => 'checkbox',
'#title' => t('Link text'),
'#default_value' => variable_get('pagestyle_display_links', 1),
'#description' => t('Default') . ': ' . t('Checked.') . ' <span class="ps_warning">' . t('Warning') . ': ' . t('Not for block type "Image links" with images in the !abbr_xhtml source code.', array(
'!abbr_xhtml' => $abbr_xhtml,
)) . '</span>',
);
$form['pagestyle_theme']['pagestyle_display']['pagestyle_display_current_text_value'] = array(
'#type' => 'radios',
'#title' => t('Display current page style text and value'),
'#options' => array(
'text_value' => t('Text and value') . ' (' . t('for example') . ': "' . t("Current Style") . ': ' . t('Standard') . '")',
'value' => t('Only the value') . ' (' . t('for example') . ': "<span title="' . t("Current Style") . ': ' . t('Standard') . '" class="pagestyle_current_help">' . t('Standard') . '</span>")',
'hidden' => t('Hide text and value'),
'remove' => t('Remove text and value in the source code') . ' [' . $link_footnote_3 . ']',
),
'#default_value' => variable_get('pagestyle_display_current_text_value', 'text_value'),
'#description' => t('Default') . ': "' . t('Text and value') . '". <br /><span id="footnote-3" class="ps_warning">[3] ' . t('Warning') . ': ' . t('Not for screen readers or text browsers (text is not in the !abbr_xhtml source code).', array(
'!abbr_xhtml' => $abbr_xhtml,
)) . '</span>',
);
$form['pagestyle_theme']['pagestyle_fontweight'] = array(
'#type' => 'fieldset',
'#title' => t('Font weight'),
'#description' => t('Define the font weights for the certain page styles.') . ' <br /><span class="ps_warning">' . t('Warning') . ': ' . t('The values 100-900 are not for all fonts.') . '</span>',
'#attributes' => array(
'id' => 'pagestyle-fontweight',
),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['pagestyle_theme']['pagestyle_fontweight']['pagestyle_fontweight_black_white'] = array(
'#type' => 'select',
'#title' => t('Black') . '/' . t('White') . ' ' . t('font weight'),
'#options' => $pagestyle_fontweight,
'#default_value' => variable_get('pagestyle_fontweight_black_white', 'normal'),
'#description' => t('Default') . ': "' . t('Normal') . '".',
);
$form['pagestyle_theme']['pagestyle_fontweight']['pagestyle_fontweight_white_black'] = array(
'#type' => 'select',
'#title' => t('Black') . '/' . t('White') . ' ' . t('font weight'),
'#options' => $pagestyle_fontweight,
'#default_value' => variable_get('pagestyle_fontweight_white_black', 'bold'),
'#description' => t('Default') . ': "' . t('Bold') . '". <span class="ps_ok">' . t('Optimal') . ' "' . t('Bold') . '" ' . t('or') . ' "' . t('Bolder') . '</span>',
);
$form['pagestyle_theme']['pagestyle_fontweight']['pagestyle_fontweight_yellow_blue'] = array(
'#type' => 'select',
'#title' => t('Black') . '/' . t('White') . ' ' . t('font weight'),
'#options' => $pagestyle_fontweight,
'#default_value' => variable_get('pagestyle_fontweight_yellow_blue', 'bold'),
'#description' => t('Default') . ': "' . t('Bold') . '". <span class="ps_ok">' . t('Optimal') . ' "' . t('Bold') . '" ' . t('or') . ' "' . t('Bolder') . '</span>',
);
$form['pagestyle_theme']['pagestyle_fontweight']['pagestyle_fontweight_standard'] = array(
'#type' => 'select',
'#title' => t('Black') . '/' . t('White') . ' ' . t('font weight'),
'#options' => $pagestyle_fontweight,
'#default_value' => variable_get('pagestyle_fontweight_standard', 'normal'),
'#description' => t('Default') . ': "' . t('Normal') . '".',
);
$form['pagestyle_theme']['pagestyle_inline'] = array(
'#type' => 'fieldset',
'#title' => t('Display inline'),
'#description' => t('Set the display of certain page style elements to inline or normal.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['pagestyle_theme']['pagestyle_inline']['pagestyle_display_list_inline'] = array(
'#type' => 'checkbox',
'#title' => t('Subtitle, list and select menu'),
'#default_value' => variable_get('pagestyle_display_list_inline', 0),
'#description' => t('Default') . ': ' . t('Not checked.'),
);
$form['pagestyle_theme']['pagestyle_inline']['pagestyle_display_current_inline'] = array(
'#type' => 'checkbox',
'#title' => t('Current page style'),
'#default_value' => variable_get('pagestyle_display_current_inline', 0),
'#description' => t('Default') . ': ' . t('Not checked.'),
);
return system_settings_form($form);
}