You are here

function theme_wysiwyg_template_overview in Wysiwyg API template plugin 7.2

Returns HTML for the wysiwyg template order form.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.

File

./wysiwyg_template.admin.inc, line 83
Administrative page callbacks for the Wysiwyg Template module.

Code

function theme_wysiwyg_template_overview($variables) {
  $form = $variables['form'];
  $rows = array();
  $header = array(
    t('Name'),
    t('Weight'),
    t('Description'),
    t('Limited to content types'),
    array(
      'data' => t('Operations'),
      'colspan' => 3,
    ),
  );
  foreach (element_children($form['wysiwyg_templates']) as $name) {
    $title = $form['wysiwyg_templates'][$name]['#template']->title;
    $row = array();
    $row[] = check_plain($title);
    $row[] = drupal_render($form['wysiwyg_templates'][$name]['weight']);
    $row[] = check_plain($form['wysiwyg_templates'][$name]['#template']->description);
    $row[] = check_plain(implode(', ', $form['wysiwyg_templates'][$name]['#template']->content_types));
    $row[] = l(t('edit'), 'admin/config/content/wysiwyg-templates/' . $name . '/edit');
    $row[] = l(t('export'), 'admin/config/content/wysiwyg-templates/' . $name . '/export');
    $row[] = l(t('delete'), 'admin/config/content/wysiwyg-templates/' . $name . '/delete');
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  drupal_add_tabledrag('wysiwyg-templates', 'order', 'sibling', 'template-weight');
  $output = '<p>' . t('The Wysiwyg Template module allows you to create templates to be used with a Wysiwyg editor of your choice. The template button for the editor will need to be enabled from the !profiles settings. The currently supported editors are FCK Editor, CK Editor and TinyMCE.', array(
    '!profiles' => l(t('WYSIWYG Profile'), 'admin/config/content/filters'),
  )) . '</p>';
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'wysiwyg-templates',
    ),
  ));
  $output .= drupal_render_children($form);
  return $output;
}