You are here

function messaging_template_admin_overview in Messaging 6.3

1 string reference to 'messaging_template_admin_overview'
messaging_template_menu in messaging_template/messaging_template.module
Implementation of hook_menu()

File

messaging_template/messaging_template.admin.inc, line 57
Messaging Framework - Admin UI

Code

function messaging_template_admin_overview() {
  $output = '';

  // List message groups
  $templates = messaging_template_info();

  // Check fallbacks and get root templates for tree-like display
  $root = array();
  foreach ($templates as $name => $info) {
    if (!$info['enabled']) {
      continue;
    }
    if ($fallback = messaging_template_fallback($name)) {
      $templates[$fallback]['children'][] = $name;
    }
    else {
      $root[] = $name;
    }
  }

  // Now build table which will have some indentation
  $rows = messaging_template_admin_tree($root, $templates);
  $header = array(
    t('Template'),
    t('Parts'),
  );

  //array(t('Message groups'), t('Description'), t('Parts'));
  $output .= theme('table', $header, $rows);

  // List sending methods
  $rows = array();
  messaging_method_list();
  foreach (messaging_method_info() as $method => $method_info) {
    $rows[] = array(
      '<strong>' . $method_info['name'] . '</strong>',
      !empty($method_info['description']) ? $method_info['description'] : '',
    );
  }
  $output .= theme('box', t('Sending methods'), theme('table', NULL, $rows));
  return $output;
}