You are here

function contemplate_edit_type in Content Templates (Contemplate) 5

Same name and namespace in other branches
  1. 6 contemplate.module \contemplate_edit_type()
  2. 7 contemplate.module \contemplate_edit_type()
1 string reference to 'contemplate_edit_type'
contemplate_menu in ./contemplate.module
Implementation of hook_menu().

File

./contemplate.module, line 395
Create templates to customize teaser and body content.

Code

function contemplate_edit_type($type = NULL) {
  $types = node_get_types();
  if (!$types[$type]) {

    // if the argument isn't a valid node type, output admin page
    return contemplate_admin();
  }
  drupal_set_title(t('Template for %type', array(
    "%type" => $types[$type]->name,
  )));
  if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'templates' && arg(3)) {
    $breadcrumbs = drupal_get_breadcrumb();
    $breadcrumbs[] = l(t('Templates'), 'admin/content/templates');
    drupal_set_breadcrumb($breadcrumbs);
  }
  if (arg(4) == 'delete') {
    drupal_set_title(t('Are you sure you want to delete template for %type?', array(
      "%type" => $types[$type]->name,
    )));
    return drupal_get_form('contemplate_delete_type_form', $type);
  }
  contemplate_refresh_files();
  $output = drupal_get_form('contemplate_edit_type_form', $type);
  return $output;
}