You are here

function contemplate_admin in Content Templates (Contemplate) 5

Same name and namespace in other branches
  1. 6 contemplate.module \contemplate_admin()
  2. 7 contemplate.module \contemplate_admin()

Admin page... list out the node types

1 call to contemplate_admin()
contemplate_edit_type in ./contemplate.module

File

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

Code

function contemplate_admin() {
  $destination = drupal_get_destination();
  contemplate_refresh_files();
  $types = node_get_types();
  $templates = contemplate_get_templates();
  foreach ($types as $type) {
    $rows[] = array(
      $type->name,
      l($templates[$type->type] ? t('edit template') : t('create template'), 'admin/content/templates/' . $type->type),
      $templates[$type->type] ? l(t('delete template'), 'admin/content/templates/' . $type->type . '/delete', array(), $destination) : '',
    );
  }
  $header = array(
    t('content type'),
    '',
  );
  $output .= theme("table", $header, $rows);
  return $output;
}