You are here

function messaging_template_admin_info in Messaging 6.4

Build template description for admin pages

1 call to messaging_template_admin_info()
messaging_template_help in messaging_template/messaging_template.module
Implementation of hook_help()

File

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

Code

function messaging_template_admin_info($template) {
  drupal_add_css(drupal_get_path('module', 'messaging_template') . '/messaging_template.css');
  $info = messaging_template_message_group($template);
  $output = '<div id="messaging-template-info" class="clear-block">';
  $output .= '<div id="template-tree">';
  $output .= messaging_template_format_tree(messaging_template_get_branch($template));
  $output .= '</div>';
  $output .= '<div id="template-description">';
  $description = t('These are the message parts for %group.', array(
    '%group' => $info['name'],
  ));
  if (!empty($info['description'])) {
    $description .= ' ' . $info['description'];
  }
  $output .= '<p>' . $description . '</p>';
  if (!empty($info['help'])) {
    $output .= '<p>' . $info['help'] . '</p>';
  }
  if (!empty($info['fallback'])) {
    $output .= '<p>' . t('The fallback template from which message parts will be taken if left blank is <a href="@template_edit">%template_name</a>', array(
      '@template_edit' => url('admin/messaging/template/edit/' . $info['fallback']),
      '%template_name' => messaging_template_message_group($info['fallback'], 'name'),
    )) . '</p>';
  }
  $output .= '</div></div>';
  return $output;
}