You are here

function exclude_node_title_preprocess_page in Exclude Node Title 7

Same name and namespace in other branches
  1. 8 exclude_node_title.module \exclude_node_title_preprocess_page()
  2. 6 exclude_node_title.module \exclude_node_title_preprocess_page()

Implements hook_preprocess_page().

1 call to exclude_node_title_preprocess_page()
exclude_node_title_preprocess_overlay in ./exclude_node_title.module
Implements hook_preprocess_overlay().

File

./exclude_node_title.module, line 72
Primarily Drupal hooks and global API functions to exclude node titles.

Code

function exclude_node_title_preprocess_page(&$vars) {
  if (!user_access('use exclude node title') || arg(0) == 'node' && arg(1) == 'add') {
    return;
  }
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    switch (arg(2)) {
      case 'edit':
        $view_mode = 'nodeform';
        break;
      case 'delete':
        return;
      default:
        $view_mode = 'full';
        break;
    }
    _exclude_node_title_preprocess($vars, arg(1), $view_mode);
  }
  elseif (isset($vars['page']['content']['system_main']['#node_edit_form']) && $vars['page']['content']['system_main']['#node_edit_form'] == TRUE) {
    _exclude_node_title_preprocess($vars, $vars['page']['content']['system_main']['#node'], 'nodeform');
  }
}