You are here

function bueditor_admin_theme in BUEditor 6

Same name and namespace in other branches
  1. 6.2 admin/bueditor.admin.inc \bueditor_admin_theme()
  2. 7 admin/bueditor.admin.inc \bueditor_admin_theme()

Admin form themed.

1 string reference to 'bueditor_admin_theme'
bueditor_theme in ./bueditor.module
Implementation of hook_theme().

File

./bueditor.admin.inc, line 46

Code

function bueditor_admin_theme($form = array()) {
  $header = array(
    t('User role'),
    t('Assigned editor'),
    t('Alternative editor'),
  );
  $keys = array(
    'name',
    'editor',
    'alt',
  );
  $info = '';
  if ($form['#weighted']) {
    $header[] = t('Weight');
    $keys[] = 'weight';
    $info = '<br />' . t('For users who have <strong>multiple roles</strong>, <strong>weight</strong> property will determine the assigned editor. Lighter roles that are placed upper will take the precedence. So, an administrator role should be placed over other roles by having a smaller weight, ie. -10.');
  }
  $rows = array();
  foreach (element_children($form['roles']) as $rid) {
    $cells = array();
    foreach ($keys as $key) {
      $cells[] = drupal_render($form['roles'][$rid][$key]);
    }
    $rows[] = $cells;
  }
  $output = '<h2 class="title">' . t('Role-editor assignments') . '</h2>';
  $output .= theme('table', $header, $rows);
  $output .= '<div class="form-item"><div class="description">' . t('Assign editors to user roles.') . '<br />' . t('Alternative editor makes it possible to use different editors for different textareas or different editors on diffrent pages. You just have to configure visibility settings for each editor.') . $info . '</div></div>';
  $output .= drupal_render($form);
  return $output;
}