function contemplate_edit_type in Content Templates (Contemplate) 7
Same name and namespace in other branches
- 5 contemplate.module \contemplate_edit_type()
- 6 contemplate.module \contemplate_edit_type()
1 string reference to 'contemplate_edit_type'
- contemplate_menu in ./
contemplate.module - Implements hook_menu().
File
- ./
contemplate.module, line 480 - 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,
)), PASS_THROUGH);
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/structure/types/templates'), $type_crumb);
drupal_set_breadcrumb($breadcrumbs);
}
if (arg(5) == 'delete') {
return drupal_get_form('contemplate_delete_type_form', $type);
}
else {
contemplate_refresh_files();
return drupal_get_form('contemplate_edit_type_form', $type->type);
}
}