You are here

function views_ui::add_template_page in Views (for Drupal 7) 7.3

File

plugins/export_ui/views_ui.class.php, line 404
Contains the CTools Export UI integration code.

Class

views_ui
CTools Export UI class handler for Views UI.

Code

function add_template_page($js, $input, $name, $step = NULL) {
  $templates = views_get_all_templates();
  if (empty($templates[$name])) {
    return MENU_NOT_FOUND;
  }
  $template = $templates[$name];

  // The template description probably describes the template, not the view
  // that will be created from it, but users aren't that likely to touch it.
  if (!empty($template->description)) {
    unset($template->description);
  }
  $template->is_template = TRUE;
  $template->type = t('Default');
  $output = $this
    ->clone_page($js, $input, $template, $step);
  drupal_set_title(t('Create view from template @template', array(
    '@template' => $template
      ->get_human_name(),
  )));
  return $output;
}