You are here

function node_convert_templates in Node Convert 7

Same name and namespace in other branches
  1. 6 node_convert.module \node_convert_templates()

List of templates page callback.

2 string references to 'node_convert_templates'
node_convert_delete_template in ./node_convert.module
Delete a conversion template. This function is also called by ctools export when calls are made through ctools_export_crud_delete().
node_convert_menu in ./node_convert.module
Implements hook_menu().

File

./node_convert.admin.inc, line 13
Administration page callbacks for the node_convert module.

Code

function node_convert_templates() {
  $rows = array();
  $headers = array(
    t("Name"),
    t('Machine name'),
    t("Source type"),
    t("Dest type"),
    t("Operations"),
  );
  $templates = node_convert_load_all_templates();
  foreach ($templates as $row) {
    $can_delete = isset($row->nctid);
    $name = l($row->name, 'admin/structure/node_convert_templates/' . $row->machine_name);
    $operations = array();
    if ($can_delete) {
      $operations[] = l(t("Edit"), 'admin/structure/node_convert_templates/edit/' . $row->nctid);
      $operations[] = l(t("Delete"), 'admin/structure/node_convert_templates/delete/' . $row->nctid);
    }
    $rows[] = array(
      $name,
      $row->machine_name,
      $row->source_type,
      $row->destination_type,
      implode(' ', $operations),
    );
  }
  $output = theme('table', array(
    'header' => $headers,
    'rows' => $rows,
  ));
  return $output;
}