Index: pagestyle.module
===================================================================
--- pagestyle.module	(revision 1436)
+++ pagestyle.module	(working copy)
@@ -7,12 +7,6 @@
  */
 
 /**
- * Include pagestyle .inc files.
- */
-module_load_include('inc', 'pagestyle', 'includes/pagestyle.admin');
-module_load_include('inc', 'pagestyle', 'includes/pagestyle.block');
-
-/**
  * Implement hook_perm().
  */
 function pagestyle_perm() {
@@ -20,6 +14,125 @@
 }
 
 /**
+ * Implement hook_help().
+ */
+function pagestyle_help($path, $arg) {
+  $path_pagestyle = base_path() . drupal_get_path('module', 'pagestyle');
+  $abbr_php = '<abbr lang="en" xml:lang="en" title="'. t('PHP: Hypertext Preprocessor') .'">PHP</abbr>';
+  $abbr_php_small = '<abbr lang="en" xml:lang="en" title="'. t('PHP: Hypertext Preprocessor') .'">php</abbr>';
+  $abbr_mysql = '<abbr title="'. t('My Structured Query Language') .'">MySQL</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_css_small = '<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_png = '<abbr lang="en" xml:lang="en" title="'. t('Portable Network Graphics') .'">PNG</abbr>';
+  $abbr_gif = '<abbr lang="en" xml:lang="en" title="'. t('Graphic Interchange Format') .'">GIF</abbr>';
+  $abbr_svg = '<abbr lang="en" xml:lang="en" title="'. t('Scalable Vector Graphics') .'">SVG</abbr>';
+  $abbr_xcf_small = '<abbr lang="en" xml:lang="en" title="'. t('eXperimental Computing Facility') .'">xcf</abbr>';
+  $abbr_id = '<abbr lang="en" xml:lang="en" title="'. t('Identification') .'">ID</abbr>';
+  $abbr_tpl_php = '<abbr title="'. t('PHP: Hypertext Preprocessor Template', array('!abbr_php' => $abbr_php)) .'">tpl.php</abbr>';
+  $link_wcag = l(t('Web Content Accessibility Guidelines'), 'http://www.w3.org/TR/WCAG/', array('attributes' => array('title' => t('External link to:') .' '. t('Web Content Accessibility Guidelines'))));
+  $link_bitv= l(t('Barrierefreie Informationstechnik-Verordnung'), 'http://bundesrecht.juris.de/bitv/anlage_8.html', array('attributes' => array('title' => t('External link to:') .' '. t('Barrierefreie Informationstechnik-Verordnung'))));
+  $link_ff = l(t('Mozilla Firefox'), 'http://www.mozilla.com/en-US/firefox', array('attributes' => array('title' => t('External link to:') .' '. t('Mozilla Firefox'))));
+  $link_ps_perm = l(t('Permissions'), 'admin/user/permissions', array('attributes' => array('title' => t('Page Style configuration')), 'fragment' => 'module-pagestyle'));
+  $link_block = l(t('Blocks'), 'admin/build/block', array('attributes' => array('title' => t('Page Style configuration'))));
+  $link_ps_config = l(t('Page Style configuration'), 'admin/settings/pagestyle', array('attributes' => array('title' => t('Page Style configuration'))));
+  $link_po_import = l(t('Import'), 'admin/build/translate/import', array('attributes' => array('title' => t('Translate interface') .', '. t('Import'))));
+  $link_ps = l(t('Download Themes') .': '. t('Page Style home page'), 'http://www.zwahlendesign.ch/pagestyle', array('attributes' => array('title' => t('External link to the Page Style home page'), 'class' => 'ps_download_button')));
+  $link_jquery_cookie = l(t('jQuery plugins'), 'http://drupal.org/project/jquery_plugin');
+  $link_footnote_1 = l('1', 'admin/help/pagestyle', array('attributes' => array('title' =>  t('Footnote') .' 1'), 'fragment' => 'footnote-1'));
+  $link_footnote_2 = l('2', 'admin/help/pagestyle', array('attributes' => array('title' =>  t('Footnote') .' 2'), 'fragment' => 'footnote-2'));
+  switch ($path) {
+    case 'admin/help#pagestyle':
+      $output = '<p><img src="'. $path_pagestyle .'/images/pagestyle_list.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Select menu') .'." class="ps_float_right" /></p>'."\n";
+      $output .= '<p>'. t('This module display a style changer on the page and in the browser menue for a better web accessibility.') .'</p>'."\n";
+      $output .= '<h3>'. t('Advantages') .'</h4>'."\n";
+      $output .= '<ol>'."\n";
+      $output .= '  <li><strong>'. t('Lesser effort.') .'</strong> '. t('No building of extra themes required!') .' '. t('Black') .'/'. t('White') .', '. t('White') .'/'. t('Black') .' '. t('and') .' '.  t('Yellow') .'/'. t('Blue') .'.</li>'."\n";
+      $output .= '  <li><strong>'. t('Style changer in the browser available.') .'</strong></li>'."\n";
+      $output .= '  <li><strong>'. t('One click function.') .'</strong> '. t('No tutorial required.') .'</li>'."\n";
+      $output .= '  <li>'. t('Same handling in any browser (shortcuts).') .'</li>'."\n";
+      $output .= '  <li>'. t('Adjustable.') .'</li>'."\n";
+      $output .= '  <li>'. t('Select menu availabe.') .'</li>'."\n";
+      $output .= '  <li>'. t('Display current page style.') .'</li>'."\n";
+      $output .= '  <li>'. t('Browser independent.') .'</li>'."\n";
+      $output .= '</ol>'."\n";
+      $output .= '<hr />'."\n";
+      $output .= '<h3>'. t('Features') .'</h4>'."\n";
+      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle_select.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Select menu') .'." class="ps_float_right" /></p>'."\n";
+      $output .= '<ul>'."\n";
+      $output .= '<li>'. t('!abbr_wcag and !abbr_bitv conform. More Information on: !link_wcag and !link_bitv.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv, '!link_wcag' => $link_wcag, '!link_bitv' => $link_bitv)) .' '. t('Keep the conditions:') .' '."\n";
+      $output .= '  <ol>'."\n";
+      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 1.1: Short text equivalents for images.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
+      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 3.1: Standard links with text without images in the source code.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
+      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 6.3: No !javascript required.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv, '!javascript' => '<em lang="en">JavaScript</em>')) .'</li>'."\n";
+      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 11.1: Open and standard code.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
+      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 13.6: Links in a list.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
+      $output .= '  </ol>'."\n";
+      $output .= '</li>'."\n";
+      $output .= '<li>'. t('No !javascript required. !jquery suppport.', array('!javascript' => '<em lang="en">JavaScript</em>', '!jquery' => '<em lang="en">jQuery</em>')) .'</li>'."\n";
+      $output .= '<li>'. t('No !abbr_css required.', array('!abbr_css' => $abbr_css)) .'</li>'."\n";
+      $output .= '<li>'. t('Style display settings') .'.</li>'."\n";
+      $output .= '<li>'. t('Caching mode: "Normal" and "Aggressive" compatible.') .'</li>'."\n";
+      $output .= '<li>'. t('Uniform markin of menu, based on the open source browser Firefox 2.0/3.0 (!link_ff).', array('!link_ff' => $link_ff)) .'</li>'."\n";
+      $output .= '<li>'. t('Block type') .': '."\n";
+      $output .= '<a href="'. $path_pagestyle .'/images/pagestyle_list.png" title="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Text links') .'." >'. t('Text links') .'</a> ['. $link_footnote_1 .'], ';
+      $output .= '<a href="'. $path_pagestyle .'/images/pagestyle_img.png" title="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Image links') .'." >'. t('Image links') .'</a> ['. $link_footnote_2 .'], ';
+      $output .= '<a href="'. $path_pagestyle .'/images/pagestyle_select.png" title="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Select menu') .'." >'. t('Select menu') .'</a>.';
+      $output .= '  </li>'."\n";
+      $output .= '<li>'. t('Themable.') .'</li>'."\n";
+      $output .= '</ul>'."\n";
+      $output .= '<p 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></p>'."\n";
+      $output .= '<p id="footnote-2">[2] '. t('No Link text, only images in the !abbr_xhtml source code with standard 0 pixel margin.', array('!abbr_xhtml' => $abbr_xhtml)) .' <span class="warning">'. t('Warning') .': '. t('Not for: !abbr_wcag/!abbr_bitv 3.1! If !javascript is not activated: No image change action if the cursor move over the images!', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv, '!javascript' => '<em lang="en">JavaScript</em>')) .'</span></p>'."\n";
+      $output .= '<hr />'."\n";
+
+      // Drupal version specific
+      $output .= '<h3>'. t('Requirements') .'</h4>'."\n";
+      $output .= '<ol>'."\n";
+      $output .= '  <li>Drupal 6.</li>'."\n";
+      $output .= '  <li>'. t('Drupal module:') .' <em lang="en">'. $link_jquery_cookie .'.</em></li>'."\n";
+      $output .= '</ol>'."\n";
+      $output .= '<hr />'."\n";
+      $output .= '<h3>'. t('Settings') .'</h4>'."\n";
+      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle_img.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Image links') .'." class="ps_float_right" /></p>'."\n";
+      $output .= '<ol>'."\n";
+      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('User management') .'", "'. $link_ps_perm .'" ("<em lang="en">admin/user/permissions#module-pagestyle</em>"). '. t('Set the different roles.') .'</li>'."\n";
+      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('Site building') .'", "'. $link_block .'" ("<em lang="en">admin/build/block</em>"). '. t('Make the block "Page Style" visibile.') .'</li>'."\n";
+      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('Site configuration') .'", "'. $link_ps_config .'" ("<em lang="en">admin/settings/pagestyle</em>"). '. t('Change the settings if you want.') .'</li>'."\n";
+      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('Site building') .'", "'. t('Translate interface') .'", "'. $link_po_import .'" ("<em lang="en">admin/build/translate/import</em>"). '. t('Import your language file (for German "!de_po") if it is necessary.', array('!de_po' => '<em lang="en">'. drupal_get_path('module', 'pagestyle') .'/translations/<abbr lang="de" title="Deutsch">de</abbr>.<abbr title="PO translation file">po</abbr></em>')) .'</li>'."\n";
+      $output .= '</ol>'."\n";
+      $output .= '<hr />'."\n";
+      $output .= '<h3>'. t('Theming') .'</h3>'."\n";
+      $output .= '<h4>'. t('Create Themes') .'</h4>'."\n";
+      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle_img2.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Image links, not in a list', array('!abbr_php' => $abbr_php, '!abbr_css' => $abbr_css)) .'" class="ps_float_right" /></p>'."\n";
+      $output .= '<ol>'."\n";
+      $output .= '  <li>'. t('Copy the files/directorys in your theme:') ."\n";
+      $output .= '    <ol>'."\n";
+      $output .= '      <li lang="en">'.'pagestyle-text.'. $abbr_tpl_php .'</li>'."\n";
+      $output .= '      <li lang="en">'.'pagestyle-image.'. $abbr_tpl_php .'</li>'."\n";
+      $output .= '      <li lang="en">'.'pagestyle-form.'. $abbr_tpl_php .'</li>'."\n";
+      $output .= '      <li lang="en">'.'pagestyle.'. $abbr_css_small .'</li>'."\n";
+      $output .= '      <li lang="en">'.'images'.'</li>'."\n";
+      $output .= '    </ol>'."\n";
+      $output .= '  </li>'."\n";
+      $output .= '  <li>'. t('Edit the !abbr_php and !abbr_css code in the files.', array('!abbr_php' => $abbr_php, '!abbr_css' => $abbr_css)) .' '. t('Example:') .' '. t('Image links, not in a list') .': '. t('Change the following elements:') .' <del>&#060;ul&#062;/&#060;/ul&#062;</del> '. t('to') .': <ins>&#060;p&#062;/&#060;/p&#062;</ins><br /> <del>&#060;li&#062;&#060;/li&#062;</del> '. t('to') .': <ins>&#060;span class="display_hidden"&#062;&#160;&#124;&#160;&#060;/span&#062;</ins>.<br /><span class="info">'. t('!abbr_wcag/!abbr_bitv 10.5: Adjacent hyperlinks have to be separated by printable characters surrounded by spaces.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</span> <span class="warning">'. t('Warning') .': '. t('Not for: !abbr_wcag/!abbr_bitv 13.6! Links are not in a list.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</span></p>'."\n";
+      $output .= '  <li>'. t('Edit the images. Create your own icons. The source file is in the directory:') .' "<em lang="en">/images/source/pagestyle.'. $abbr_xcf_small .'</em>". '.  t('!abbr_png images are for new browsers and !abbr_gif images for old browsers (!internet_explorer 6).', array('!abbr_png' => $abbr_png, '!abbr_gif' => $abbr_gif, '!internet_explorer' => '<em lang="en">Internet Explorer</em>')) .'</li>'."\n";
+      $output .= '</ol>'."\n";
+      // Drupal version specific end
+
+      $output .= '<h4>'. t('Download Themes') .'</h4>'."\n";
+      $output .= '<p>'. t('Edited templates are available from the developers website:') .' '. $link_ps .'</p>'."\n";
+      $output .= '<hr />'."\n";
+      $output .= '<h3>'. t('Screenshots') .'</h3>'."\n";
+      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle.png" alt="'. t('Page Style') .' '. t('Screenshots') .'." />'.'</p>'."\n";
+      $output .= '<hr />'."\n";
+      return $output;
+    break;
+  }
+}
+
+/**
  * Implement hook_menu().
  */
 function pagestyle_menu() {
@@ -29,7 +142,8 @@
     'description' => 'Settings for the display and values.',
     'access arguments' => array('administer pagestyle'),
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('pagestyle_admin_settings')
+    'page arguments' => array('pagestyle_admin_settings'),
+    'file' => 'includes/pagestyle.admin.inc',
   );
   $items['pagestyle/black_white'] = array(
     'title' => 'Page Style Black/White',
@@ -134,6 +248,7 @@
   }
   if (isset($_COOKIE['pagestyle'])) {
     if (in_array($_COOKIE['pagestyle'], $pagestyle_allowed)) {
+      drupal_load('module', 'filter'); // Ensure that filter module is loaded, may not be the case in early bootstrap.
       $pagestyle_cookie['pagestyle'] = (string) filter_xss($_COOKIE['pagestyle']);
     }
   }
@@ -340,10 +455,15 @@
  * Implement hook_init().
  */
 function pagestyle_init() {
-  // Execute the defined functions.
   pagestyle_print_html();
   pagestyle_print_js_css();
   pagestyle_jq_plugin();
+}
+
+/**
+ * Implement hook_init().
+ */
+function pagestyle_boot() {
   pagestyle_check();
 }
 
@@ -365,4 +485,632 @@
   else {
     drupal_set_message(t('Drupal\'s !link_jquery_plugin Module Required for Page Style functionality.', array('!link_jquery_plugin' =>  $link_jquery_plugin )), 'error');
   }
-}
\ No newline at end of file
+}
+
+/**
+ * Returns an array of allowed values.
+ *
+ * @return
+ *   An array of allowed values.
+ */
+function pagestyle_allowed_values() {
+  $pagestyle_allowed = array(
+    'black_white',
+    'white_black',
+    'yellow_blue',
+    'standard',
+  );
+  return $pagestyle_allowed;
+}
+
+/**
+ * Cookie expires.
+ *
+ * @return
+ *   The cookie expires in seconds.
+ */
+function pagestyle_cookie_expires($mode = 'php') {
+  $pagestyle_cookie_expires = variable_get('pagestyle_cookie_expires', 365) ;
+  $output = ($pagestyle_cookie_expires * 24 * 60 * 60);
+  if ($mode == 'js') {
+    $output = $pagestyle_cookie_expires;
+  }
+  return $output;
+}
+
+/**
+ * Menu callback; Set the pagestyle to Black/White, then redirects to the previous page.
+ */
+function pagestyle_black_white() {
+  $pagestyle_cookie_expires = pagestyle_cookie_expires($mode = 'php');
+  $pagestyle_cookie_domain = variable_get('pagestyle_cookie_domain', base_path());
+  $ps_name = t('Black') .'/'. t('White');
+  $pagestyle_message = variable_get('pagestyle_message', 1);
+  if (!isset($_COOKIE['pagestyle']) && $pagestyle_message == 1) {
+    drupal_set_message(t('The page style have not been saved, because your browser do not accept cookies.'), 'error');
+  }
+  else {
+    $_SESSION['pagestyle'] = 'black_white';
+    setcookie("pagestyle", ("black_white"), time()+$pagestyle_cookie_expires, $pagestyle_cookie_domain, "");
+    if ($pagestyle_message == 1) {
+      drupal_set_message(t('The page style have been saved as %ps_name.', array('%ps_name' => $ps_name)));
+    }
+  }
+  pagestyle_clear_cache();
+  drupal_goto();
+}
+
+/**
+ * Menu callback; Set the pagestyle to White/Black, then redirects to the previous page.
+ */
+function pagestyle_white_black() {
+  $pagestyle_cookie_expires = pagestyle_cookie_expires($mode = 'php');
+  $pagestyle_cookie_domain = variable_get('pagestyle_cookie_domain', base_path());
+  $ps_name = t('White') .'/'. t('Black');
+  $pagestyle_message = variable_get('pagestyle_message', 1);
+  if (!isset($_COOKIE['pagestyle']) && $pagestyle_message == 1) {
+    drupal_set_message(t('The page style have not been saved, because your browser do not accept cookies.'), 'error');
+  }
+  else {
+    $_SESSION['pagestyle'] = 'white_black';
+    setcookie("pagestyle", ("white_black"), time()+$pagestyle_cookie_expires, $pagestyle_cookie_domain, "");
+    if ($pagestyle_message == 1) {
+      drupal_set_message(t('The page style have been saved as %ps_name.', array('%ps_name' => $ps_name)));
+    }
+  }
+  pagestyle_clear_cache();
+  drupal_goto();
+}
+
+/**
+ * Menu callback; Set the pagestyle to Yellow/Blue, then redirects to the previous page.
+ */
+function pagestyle_yellow_blue() {
+  $pagestyle_cookie_expires = pagestyle_cookie_expires($mode = 'php');
+  $pagestyle_cookie_domain = variable_get('pagestyle_cookie_domain', base_path());
+  $ps_name = t('Yellow') .'/'. t('Blue');
+  $pagestyle_message = variable_get('pagestyle_message', 1);
+  if (!isset($_COOKIE['pagestyle']) && $pagestyle_message == 1) {
+    drupal_set_message(t('The page style have not been saved, because your browser do not accept cookies.'), 'error');
+  }
+  else {
+    $_SESSION['pagestyle'] = 'yellow_blue';
+    setcookie("pagestyle", ("yellow_blue"), time()+$pagestyle_cookie_expires, $pagestyle_cookie_domain, "");
+    if ($pagestyle_message == 1) {
+      drupal_set_message(t('The page style have been saved as %ps_name.', array('%ps_name' => $ps_name)));
+    }
+  }
+  pagestyle_clear_cache();
+  drupal_goto();
+}
+
+/**
+ * Menu callback; change the pagestyle to Standard, then redirects to the previous page.
+ */
+function pagestyle_standard() {
+  $pagestyle_cookie_expires = pagestyle_cookie_expires($mode = 'php');
+  $pagestyle_cookie_domain = variable_get('pagestyle_cookie_domain', base_path());
+  $ps_name = t('Standard');
+  $pagestyle_message = variable_get('pagestyle_message', 1);
+  if (!isset($_COOKIE['pagestyle']) && $pagestyle_message == 1) {
+    drupal_set_message(t('The page style have not been saved, because your browser do not accept cookies.'), 'error');
+  }
+  else {
+    $_SESSION['pagestyle'] = 'standard';
+    setcookie("pagestyle", ("standard"), time()+$pagestyle_cookie_expires, $pagestyle_cookie_domain, "");
+    if ($pagestyle_message == 1) {
+      drupal_set_message(t('The page style have been saved as %ps_name.', array('%ps_name' => $ps_name)));
+    }
+  }
+  pagestyle_clear_cache();
+  drupal_goto();
+}
+
+/**
+ * Menu callback; change the pagestyle to the cookie value, then redirects to the previous page.
+ */
+function pagestyle_set() {
+  $pagestyle_cookie_expires = pagestyle_cookie_expires($mode = 'php');
+  $pagestyle_cookie_domain = variable_get('pagestyle_cookie_domain', base_path());
+  $pagestyle_normal = variable_get('pagestyle_normal', 'standard');
+  $pagestyle_text = array(
+    'black_white' => t('Black') .'/'. t('White'),
+    'white_black' => t('White') .'/'. t('Black'),
+    'yellow_blue' => t('Yellow') .'/'. t('Blue'),
+    'standard' => t('Standard'),
+  );
+  $pagestyle_message = variable_get('pagestyle_message', 1);
+  $pagestyle_post = array();
+  $pagestyle_cookie = array();
+  // allowed values
+  $pagestyle_allowed = pagestyle_allowed_values();
+  // check the type and the content
+  if (in_array($_COOKIE['pagestyle'], $pagestyle_allowed)) {
+    $pagestyle_cookie['pagestyle'] = (string) filter_xss($_COOKIE['pagestyle']);
+  }
+  // set session/cookie
+  if (!isset($_COOKIE['pagestyle']) && $pagestyle_message == 1) {
+    drupal_set_message(t('The page style have not been saved, because your browser do not accept cookies.'), 'error');
+  }
+  elseif (isset($_COOKIE['pagestyle'])) {
+    $_SESSION['pagestyle'] = $pagestyle_cookie['pagestyle'];
+    setcookie("pagestyle", $pagestyle_cookie['pagestyle'], time()+$pagestyle_cookie_expires, $pagestyle_cookie_domain, "");
+    if ($pagestyle_message == 1) {
+      drupal_set_message(t('The page style have been saved as %pagestyle.', array('%pagestyle' => $pagestyle_text[$pagestyle_cookie['pagestyle']])));
+    }
+  }
+  pagestyle_clear_cache();
+  drupal_goto();
+}
+
+/**
+ * Clear defined cache tables
+ */
+function pagestyle_clear_cache() {
+  $tables = array(
+    'cache_page',
+    'cache_block',
+  );
+  foreach ($tables as $table) {
+    cache_clear_all('*', $table, TRUE);
+  }
+}
+
+/**
+ * Block Title
+ *
+ * @return
+ *   "Page Style" and "Current Style" or "Theme" and "Current Theme".
+ *
+ * @see pagestyle_admin_settings()
+ */
+function pagestyle_block_title($title = 'title') {
+  $pagestyle_block_title = variable_get('pagestyle_block_title', 'page_style');
+  $pagestyle_block_title_text = t('Page Style');
+  $pagestyle_current_pagestyle_text = t('Current Style');
+  switch ($pagestyle_block_title) {
+    case 'theme':
+    $pagestyle_block_title_text = t('Theme');
+    $pagestyle_current_pagestyle_text = t('Current Theme');
+    break;
+  }
+  if ($title == 'title') {
+    return $pagestyle_block_title_text;
+  }
+  elseif ($title == 'current') {
+    return $pagestyle_current_pagestyle_text;
+  }
+}
+
+/**
+ * Returns an array of available values for the select element in the block page style.
+ *
+ * @return
+ *   An array of available values, for selecting the page style.
+ *
+ * @see pagestyle_form()
+ */
+function pagestyle_block_form_options() {
+  $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);
+  $ps_options = array(
+    $var['black_white'] = array(
+      'class' => 'black_white',
+      'name' => t('Black/White'),
+      'display' => $pagestyle_black_white,
+      ),
+    $var['white_black'] = array(
+      'class' => 'white_black',
+      'name' => t('White/Black'),
+      'display' => $pagestyle_white_black,
+      ),
+    $var['yellow_blue'] = array(
+      'class' => 'yellow_blue',
+      'name' => t('Yellow/Blue'),
+      'display' => $pagestyle_yellow_blue,
+      ),
+    $var['standard'] = array(
+      'class' => 'standard',
+      'name' => t('Standard'),
+      'display' => $pagestyle_standard,
+      ),
+    );
+  $options = array();
+  foreach ($ps_options as $name) {
+    if ($name['display'] == 1) {
+    $options[$name['class']] = $name['name'];
+    }
+  }
+  return $options;
+}
+
+/**
+ * Implement hook_form().
+ *
+ * Generate the select form for the block.
+ *
+ * @see pagestyle_block()
+ */
+function pagestyle_form() {
+  $pagestyle_cookie_expires = pagestyle_cookie_expires($mode = 'php');
+  $pagestyle_cookie_domain = variable_get('pagestyle_cookie_domain', base_path());
+  $pagestyle_block_title = pagestyle_block_title($title = 'title');
+  $pagestyle_normal = variable_get('pagestyle_normal', 'standard');
+  $pagestyle = pagestyle_get_current($value = 'int');
+  $options = pagestyle_block_form_options();
+  $pagestyle_text = array(
+    'black_white' => t('Black') .'/'. t('White'),
+    'white_black' => t('White') .'/'. t('Black'),
+    'yellow_blue' => t('Yellow') .'/'. t('Blue'),
+    'standard' => t('Standard'),
+  );
+  $pagestyle_message = variable_get('pagestyle_message', 1);
+  $pagestyle_post = array();
+  $pagestyle_cookie = array();
+  // allowed values
+  $pagestyle_allowed = pagestyle_allowed_values();
+  // check the type and the content
+  if (isset($_COOKIE['pagestyle']) && isset($_POST['pagestyle_select'])) {
+    if (in_array($_POST['pagestyle_select'], $pagestyle_allowed)) {
+      $pagestyle_post['pagestyle'] = (string) filter_xss($_POST['pagestyle_select']);
+    }
+    // set session/cookie
+    setcookie("pagestyle", $pagestyle_post['pagestyle'], time()+$pagestyle_cookie_expires, $pagestyle_cookie_domain, "");
+    $_SESSION['pagestyle'] = $pagestyle_post['pagestyle'];
+    if ($pagestyle_message == 1) {
+      drupal_set_message(t('The page style have been saved as %pagestyle_post.', array('%pagestyle_post' => $pagestyle_text[$pagestyle_post['pagestyle']])));
+    }
+    pagestyle_clear_cache();
+  }
+  elseif (!isset($_COOKIE['pagestyle']) && isset($_POST['pagestyle_select']) && $pagestyle_message == 1) {
+    drupal_set_message(t('The page style have not been saved, because your browser do not accept cookies.'), 'error');
+  }
+  $subtitle = NULL;
+  if (variable_get('pagestyle_display_subtitle', 0) == 1) {
+    $subtitle = $pagestyle_block_title;
+  }
+  $form = array();
+  $form['pagestyle_select'] = array(
+    '#type' => 'select',
+    '#title' => $subtitle,
+    '#name' => 'pagestyle_select',
+    '#options' => $options,
+    '#default_value' => variable_get('pagestyle_select', $pagestyle),
+    '#weight' => 0,
+    '#attributes' => array('class' => 'pagestyle'),
+    // '#description' => t('Select the page style.'),
+  );
+  $form['pagestyle_submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save'),
+    '#weight' => 1,
+  );
+  $form['#skip_duplicate_check'] = TRUE;
+  return $form;
+}
+
+/**
+ * Implement theme().
+ *
+ * @see pagestyle_form()
+ */
+function theme_pagestyle_form($form) {
+  $output = drupal_render($form);
+  return $output;
+}
+
+/**
+ * Implement hook_theme().
+ */
+function pagestyle_theme() {
+  $arguments = array(
+    'dest' => NULL,
+    'block_title' => NULL,
+    'list_inline' => NULL,
+    'current_inline' => NULL,
+    'subtitle' => NULL,
+    'subtitle_text' => NULL,
+    'display_links' => NULL,
+    'black_white' => NULL,
+    'white_black' => NULL,
+    'yellow_blue' => NULL,
+    'standard' => NULL,
+    'current_pagestyle' => NULL,
+    'display_current_pagestyle' => NULL,
+    'display_current_pagestyle_text' => NULL,
+    'current_pagestyle_text' => NULL,
+    'pagestyle' => NULL,
+  );
+  return array(
+    'pagestyle_text' => array(
+      'arguments' => $arguments,
+      'template' => 'pagestyle-text',
+    ),
+    'pagestyle_image' => array(
+      'arguments' => $arguments,
+      'template' => 'pagestyle-image',
+    ),
+    'pagestyle_form' => array(
+      'arguments' => array(
+        'form' => NULL,
+        'pagestyle_form' => NULL,
+        'display_current_pagestyle' => NULL,
+        'pagestyle' => NULL,
+      ),
+      'template' => 'pagestyle-form',
+    ),
+  );
+}
+
+/**
+ * Process variables for pagestyle-text.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 pagestyle_theme(), pagestyle-text.tpl.php
+ */
+function template_preprocess_pagestyle_text(&$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-text';
+  }
+  $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');
+}
+
+/**
+ * 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 pagestyle_theme(), pagestyle-image.tpl.php
+ */
+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');
+}
+
+/**
+ * Process variables for pagestyle-form.tpl.php.
+ *
+ * The $variables array contains the following arguments:
+ * - $list_inline: Display the ul list "inline" or not.
+ * - $current_inline: Display the current page style "inline" or not.
+ * - $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").
+ * - $pagestyle_form: The form.
+ * - $current_pagestyle_text: The current page style text "Current Style" or "Current Theme".
+ * - $pagestyle: The current page style (default Standard).
+ *
+ * @see pagestyle_theme(), pagestyle-form.tpl.php
+ */
+function template_preprocess_pagestyle_form(&$variables) {
+  $pagestyle_current_pagestyle_text = pagestyle_block_title($title = 'current');
+  $variables['pagestyle'] = array();
+  $hidden = array();
+  // Provide variables named after form keys so themers can print each element independently.
+  foreach (element_children($variables['form']) as $key) {
+    $type = $variables['form'][$key]['#type'];
+    if ($type == 'hidden' || $type == 'token') {
+      $hidden[] = drupal_render($variables['form'][$key]);
+    }
+    else {
+      $variables['pagestyle'][$key] = drupal_render($variables['form'][$key]);
+    }
+  }
+  $variables['list_inline'] = "list";
+  if (variable_get('pagestyle_display_list_inline', 0) == 1) {
+    $variables['list_inline'] = "inline";
+  }
+  $variables['current_inline'] = "pagestyle_current_list";
+  if (variable_get('pagestyle_display_current_inline', 0) == 1) {
+    $variables['current_inline'] = "pagestyle_current_inline";
+  }
+  $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;
+  }
+  // Hidden form elements have no value to themers. No need for separation.
+  $variables['pagestyle']['hidden'] = implode($hidden);
+  // Collect all form elements to make it easier to print the whole form.
+  $variables['pagestyle_form'] = implode($variables['pagestyle']);
+  $variables['current_pagestyle_text'] = $pagestyle_current_pagestyle_text;
+  $variables['pagestyle'] = pagestyle_get_current($value = 'name');
+}
Index: pagestyle.install
===================================================================
--- pagestyle.install	(revision 1436)
+++ pagestyle.install	(working copy)
@@ -149,3 +149,11 @@
   drupal_set_message(t('Page Style') .' '. t('module') .'. '. t('Update') .' #6170: '.  t('Now editable') .': "'. t('Font weight') .'" '. t('on') .' '. $link_ps_fontweight .'. '. t('For a compatibility to old designs, use:') .' "Normal"', 'ok');
   return $ret;
 }
+
+/**
+ * Update 6170 for 6.x-1.8: Change the cookie domain.
+ */
+function pagestyle_update_6171(&$sandbox) {
+  $res[] = update_sql("UPDATE {system} SET bootstrap = 1 WHERE name = 'pagestyle'");
+  return $res;
+}
\ No newline at end of file
Index: includes/pagestyle.admin.inc
===================================================================
--- includes/pagestyle.admin.inc	(revision 1436)
+++ includes/pagestyle.admin.inc	(working copy)
@@ -7,125 +7,6 @@
  */
 
 /**
- * Implement hook_help().
- */
-function pagestyle_help($path, $arg) {
-  $path_pagestyle = base_path() . drupal_get_path('module', 'pagestyle');
-  $abbr_php = '<abbr lang="en" xml:lang="en" title="'. t('PHP: Hypertext Preprocessor') .'">PHP</abbr>';
-  $abbr_php_small = '<abbr lang="en" xml:lang="en" title="'. t('PHP: Hypertext Preprocessor') .'">php</abbr>';
-  $abbr_mysql = '<abbr title="'. t('My Structured Query Language') .'">MySQL</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_css_small = '<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_png = '<abbr lang="en" xml:lang="en" title="'. t('Portable Network Graphics') .'">PNG</abbr>';
-  $abbr_gif = '<abbr lang="en" xml:lang="en" title="'. t('Graphic Interchange Format') .'">GIF</abbr>';
-  $abbr_svg = '<abbr lang="en" xml:lang="en" title="'. t('Scalable Vector Graphics') .'">SVG</abbr>';
-  $abbr_xcf_small = '<abbr lang="en" xml:lang="en" title="'. t('eXperimental Computing Facility') .'">xcf</abbr>';
-  $abbr_id = '<abbr lang="en" xml:lang="en" title="'. t('Identification') .'">ID</abbr>';
-  $abbr_tpl_php = '<abbr title="'. t('PHP: Hypertext Preprocessor Template', array('!abbr_php' => $abbr_php)) .'">tpl.php</abbr>';
-  $link_wcag = l(t('Web Content Accessibility Guidelines'), 'http://www.w3.org/TR/WCAG/', array('attributes' => array('title' => t('External link to:') .' '. t('Web Content Accessibility Guidelines'))));
-  $link_bitv= l(t('Barrierefreie Informationstechnik-Verordnung'), 'http://bundesrecht.juris.de/bitv/anlage_8.html', array('attributes' => array('title' => t('External link to:') .' '. t('Barrierefreie Informationstechnik-Verordnung'))));
-  $link_ff = l(t('Mozilla Firefox'), 'http://www.mozilla.com/en-US/firefox', array('attributes' => array('title' => t('External link to:') .' '. t('Mozilla Firefox'))));
-  $link_ps_perm = l(t('Permissions'), 'admin/user/permissions', array('attributes' => array('title' => t('Page Style configuration')), 'fragment' => 'module-pagestyle'));
-  $link_block = l(t('Blocks'), 'admin/build/block', array('attributes' => array('title' => t('Page Style configuration'))));
-  $link_ps_config = l(t('Page Style configuration'), 'admin/settings/pagestyle', array('attributes' => array('title' => t('Page Style configuration'))));
-  $link_po_import = l(t('Import'), 'admin/build/translate/import', array('attributes' => array('title' => t('Translate interface') .', '. t('Import'))));
-  $link_ps = l(t('Download Themes') .': '. t('Page Style home page'), 'http://www.zwahlendesign.ch/pagestyle', array('attributes' => array('title' => t('External link to the Page Style home page'), 'class' => 'ps_download_button')));
-  $link_jquery_cookie = l(t('jQuery plugins'), 'http://drupal.org/project/jquery_plugin');
-  $link_footnote_1 = l('1', 'admin/help/pagestyle', array('attributes' => array('title' =>  t('Footnote') .' 1'), 'fragment' => 'footnote-1'));
-  $link_footnote_2 = l('2', 'admin/help/pagestyle', array('attributes' => array('title' =>  t('Footnote') .' 2'), 'fragment' => 'footnote-2'));
-  switch ($path) {
-    case 'admin/help#pagestyle':
-      $output = '<p><img src="'. $path_pagestyle .'/images/pagestyle_list.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Select menu') .'." class="ps_float_right" /></p>'."\n";
-      $output .= '<p>'. t('This module display a style changer on the page and in the browser menue for a better web accessibility.') .'</p>'."\n";
-      $output .= '<h3>'. t('Advantages') .'</h4>'."\n";
-      $output .= '<ol>'."\n";
-      $output .= '  <li><strong>'. t('Lesser effort.') .'</strong> '. t('No building of extra themes required!') .' '. t('Black') .'/'. t('White') .', '. t('White') .'/'. t('Black') .' '. t('and') .' '.  t('Yellow') .'/'. t('Blue') .'.</li>'."\n";
-      $output .= '  <li><strong>'. t('Style changer in the browser available.') .'</strong></li>'."\n";
-      $output .= '  <li><strong>'. t('One click function.') .'</strong> '. t('No tutorial required.') .'</li>'."\n";
-      $output .= '  <li>'. t('Same handling in any browser (shortcuts).') .'</li>'."\n";
-      $output .= '  <li>'. t('Adjustable.') .'</li>'."\n";
-      $output .= '  <li>'. t('Select menu availabe.') .'</li>'."\n";
-      $output .= '  <li>'. t('Display current page style.') .'</li>'."\n";
-      $output .= '  <li>'. t('Browser independent.') .'</li>'."\n";
-      $output .= '</ol>'."\n";
-      $output .= '<hr />'."\n";
-      $output .= '<h3>'. t('Features') .'</h4>'."\n";
-      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle_select.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Select menu') .'." class="ps_float_right" /></p>'."\n";
-      $output .= '<ul>'."\n";
-      $output .= '<li>'. t('!abbr_wcag and !abbr_bitv conform. More Information on: !link_wcag and !link_bitv.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv, '!link_wcag' => $link_wcag, '!link_bitv' => $link_bitv)) .' '. t('Keep the conditions:') .' '."\n";
-      $output .= '  <ol>'."\n";
-      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 1.1: Short text equivalents for images.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
-      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 3.1: Standard links with text without images in the source code.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
-      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 6.3: No !javascript required.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv, '!javascript' => '<em lang="en">JavaScript</em>')) .'</li>'."\n";
-      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 11.1: Open and standard code.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
-      $output .= '    <li>'. t('!abbr_wcag/!abbr_bitv 13.6: Links in a list.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</li>'."\n";
-      $output .= '  </ol>'."\n";
-      $output .= '</li>'."\n";
-      $output .= '<li>'. t('No !javascript required. !jquery suppport.', array('!javascript' => '<em lang="en">JavaScript</em>', '!jquery' => '<em lang="en">jQuery</em>')) .'</li>'."\n";
-      $output .= '<li>'. t('No !abbr_css required.', array('!abbr_css' => $abbr_css)) .'</li>'."\n";
-      $output .= '<li>'. t('Style display settings') .'.</li>'."\n";
-      $output .= '<li>'. t('Caching mode: "Normal" and "Aggressive" compatible.') .'</li>'."\n";
-      $output .= '<li>'. t('Uniform markin of menu, based on the open source browser Firefox 2.0/3.0 (!link_ff).', array('!link_ff' => $link_ff)) .'</li>'."\n";
-      $output .= '<li>'. t('Block type') .': '."\n";
-      $output .= '<a href="'. $path_pagestyle .'/images/pagestyle_list.png" title="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Text links') .'." >'. t('Text links') .'</a> ['. $link_footnote_1 .'], ';
-      $output .= '<a href="'. $path_pagestyle .'/images/pagestyle_img.png" title="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Image links') .'." >'. t('Image links') .'</a> ['. $link_footnote_2 .'], ';
-      $output .= '<a href="'. $path_pagestyle .'/images/pagestyle_select.png" title="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Select menu') .'." >'. t('Select menu') .'</a>.';
-      $output .= '  </li>'."\n";
-      $output .= '<li>'. t('Themable.') .'</li>'."\n";
-      $output .= '</ul>'."\n";
-      $output .= '<p 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></p>'."\n";
-      $output .= '<p id="footnote-2">[2] '. t('No Link text, only images in the !abbr_xhtml source code with standard 0 pixel margin.', array('!abbr_xhtml' => $abbr_xhtml)) .' <span class="warning">'. t('Warning') .': '. t('Not for: !abbr_wcag/!abbr_bitv 3.1! If !javascript is not activated: No image change action if the cursor move over the images!', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv, '!javascript' => '<em lang="en">JavaScript</em>')) .'</span></p>'."\n";
-      $output .= '<hr />'."\n";
-
-      // Drupal version specific
-      $output .= '<h3>'. t('Requirements') .'</h4>'."\n";
-      $output .= '<ol>'."\n";
-      $output .= '  <li>Drupal 6.</li>'."\n";
-      $output .= '  <li>'. t('Drupal module:') .' <em lang="en">'. $link_jquery_cookie .'.</em></li>'."\n";
-      $output .= '</ol>'."\n";
-      $output .= '<hr />'."\n";
-      $output .= '<h3>'. t('Settings') .'</h4>'."\n";
-      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle_img.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Image links') .'." class="ps_float_right" /></p>'."\n";
-      $output .= '<ol>'."\n";
-      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('User management') .'", "'. $link_ps_perm .'" ("<em lang="en">admin/user/permissions#module-pagestyle</em>"). '. t('Set the different roles.') .'</li>'."\n";
-      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('Site building') .'", "'. $link_block .'" ("<em lang="en">admin/build/block</em>"). '. t('Make the block "Page Style" visibile.') .'</li>'."\n";
-      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('Site configuration') .'", "'. $link_ps_config .'" ("<em lang="en">admin/settings/pagestyle</em>"). '. t('Change the settings if you want.') .'</li>'."\n";
-      $output .= '  <li>'. t('Go to:') .' "'. t('Administer') .'", "'. t('Site building') .'", "'. t('Translate interface') .'", "'. $link_po_import .'" ("<em lang="en">admin/build/translate/import</em>"). '. t('Import your language file (for German "!de_po") if it is necessary.', array('!de_po' => '<em lang="en">'. drupal_get_path('module', 'pagestyle') .'/translations/<abbr lang="de" title="Deutsch">de</abbr>.<abbr title="PO translation file">po</abbr></em>')) .'</li>'."\n";
-      $output .= '</ol>'."\n";
-      $output .= '<hr />'."\n";
-      $output .= '<h3>'. t('Theming') .'</h3>'."\n";
-      $output .= '<h4>'. t('Create Themes') .'</h4>'."\n";
-      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle_img2.png" alt="'. t('Screenshot of block:') .' '. t('Page Style') .', '. t('Image links, not in a list', array('!abbr_php' => $abbr_php, '!abbr_css' => $abbr_css)) .'" class="ps_float_right" /></p>'."\n";
-      $output .= '<ol>'."\n";
-      $output .= '  <li>'. t('Copy the files/directorys in your theme:') ."\n";
-      $output .= '    <ol>'."\n";
-      $output .= '      <li lang="en">'.'pagestyle-text.'. $abbr_tpl_php .'</li>'."\n";
-      $output .= '      <li lang="en">'.'pagestyle-image.'. $abbr_tpl_php .'</li>'."\n";
-      $output .= '      <li lang="en">'.'pagestyle-form.'. $abbr_tpl_php .'</li>'."\n";
-      $output .= '      <li lang="en">'.'pagestyle.'. $abbr_css_small .'</li>'."\n";
-      $output .= '      <li lang="en">'.'images'.'</li>'."\n";
-      $output .= '    </ol>'."\n";
-      $output .= '  </li>'."\n";
-      $output .= '  <li>'. t('Edit the !abbr_php and !abbr_css code in the files.', array('!abbr_php' => $abbr_php, '!abbr_css' => $abbr_css)) .' '. t('Example:') .' '. t('Image links, not in a list') .': '. t('Change the following elements:') .' <del>&#060;ul&#062;/&#060;/ul&#062;</del> '. t('to') .': <ins>&#060;p&#062;/&#060;/p&#062;</ins><br /> <del>&#060;li&#062;&#060;/li&#062;</del> '. t('to') .': <ins>&#060;span class="display_hidden"&#062;&#160;&#124;&#160;&#060;/span&#062;</ins>.<br /><span class="info">'. t('!abbr_wcag/!abbr_bitv 10.5: Adjacent hyperlinks have to be separated by printable characters surrounded by spaces.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</span> <span class="warning">'. t('Warning') .': '. t('Not for: !abbr_wcag/!abbr_bitv 13.6! Links are not in a list.', array('!abbr_wcag' => $abbr_wcag, '!abbr_bitv' => $abbr_bitv)) .'</span></p>'."\n";
-      $output .= '  <li>'. t('Edit the images. Create your own icons. The source file is in the directory:') .' "<em lang="en">/images/source/pagestyle.'. $abbr_xcf_small .'</em>". '.  t('!abbr_png images are for new browsers and !abbr_gif images for old browsers (!internet_explorer 6).', array('!abbr_png' => $abbr_png, '!abbr_gif' => $abbr_gif, '!internet_explorer' => '<em lang="en">Internet Explorer</em>')) .'</li>'."\n";
-      $output .= '</ol>'."\n";
-      // Drupal version specific end
-
-      $output .= '<h4>'. t('Download Themes') .'</h4>'."\n";
-      $output .= '<p>'. t('Edited templates are available from the developers website:') .' '. $link_ps .'</p>'."\n";
-      $output .= '<hr />'."\n";
-      $output .= '<h3>'. t('Screenshots') .'</h3>'."\n";
-      $output .= '<p><img src="'. $path_pagestyle .'/images/pagestyle.png" alt="'. t('Page Style') .' '. t('Screenshots') .'." />'.'</p>'."\n";
-      $output .= '<hr />'."\n";
-      return $output;
-    break;
-  }
-}
-
-/**
  * Builds and returns the pagestyle settings form.
  *
  * @ingroup forms
