You are here

function contemplate_edit_type in Content Templates (Contemplate) 6

Same name and namespace in other branches
  1. 5 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 446
Create templates to customize teaser and body content.

Code

function contemplate_edit_type($type = array()) {
  if (empty($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' => $type->name,
  )));
  if (arg(0) == 'admin' && arg(1) == 'content' && arg(4) == 'template') {
    $breadcrumbs = drupal_get_breadcrumb();
    $type_crumb = array_pop($breadcrumbs);
    array_push($breadcrumbs, l(t('Templates'), 'admin/content/types/templates'), $type_crumb);
    drupal_set_breadcrumb($breadcrumbs);
  }
  if (arg(5) == 'delete') {
    return drupal_get_form('contemplate_delete_type_form', $type->type);
  }
  else {
    contemplate_refresh_files();
    return drupal_get_form('contemplate_edit_type_form', $type->type);
  }
}