You are here

function modalframe_preprocess_page in Modal Frame API 6

Same name and namespace in other branches
  1. 7 modalframe.module \modalframe_preprocess_page()

Preprocess template variables for page.tpl.php - step 2.

Now that we have altered the registry entry for theme('page'), we can tell theme() to use a different template file name when we need to render a child window.

See also

modalframe_child_js()

modalframe_theme_registry_alter()

template_preprocess_page()

template_preprocess()

theme()

File

./modalframe.module, line 86
Provides an API to render an iframe within a modal dialog based on the jQuery UI Dialog plugin.

Code

function modalframe_preprocess_page(&$variables) {
  if (!empty($GLOBALS['modalframe_page_template'])) {
    if (!isset($variables['template_files'])) {
      $variables['template_files'] = array();
    }
    $variables['template_files'][] = 'modalframe-page';

    // If a title is set we need to assure that it is filtered.
    if (isset($variables['title'])) {
      $variables['title'] = check_plain($variables['title']);
    }
  }
}