You are here

function pagestyle_white_black in Page Style 5

Same name and namespace in other branches
  1. 6 includes/pagestyle.block.inc \pagestyle_white_black()
  2. 7 includes/pagestyle.block.inc \pagestyle_white_black()

Menu callback; Set the pagestyle to White/Black, then redirects to the previous page.

7 string references to 'pagestyle_white_black'
pagestyle_admin_settings in includes/pagestyle.admin.inc
Builds and returns the pagestyle settings form.
pagestyle_block_form_options in includes/pagestyle.block.inc
Returns an array of available values for the select element in the block page style.
pagestyle_menu in ./pagestyle.module
Implement hook_menu().
pagestyle_print_html in ./pagestyle.module
Print HTMl code in the head
pagestyle_uninstall in ./pagestyle.install
Implement hook_uninstall().

... See full list

File

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

Code

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();
}