You are here

function imce_admin_theme in IMCE 6

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

Admin form themed.

1 string reference to 'imce_admin_theme'
imce_theme in ./imce.module
Implementation of hook_theme().

File

inc/admin.inc, line 103

Code

function imce_admin_theme($form = array()) {
  $u1p = imce_user1_profile();
  $header = array(
    t('User role'),
    t('Assigned profile'),
  );
  $keys = array(
    'name',
    'pid',
  );
  $rows[0] = array(
    t('user #1'),
    $u1p['name'],
  );
  $info = '';
  if ($form['#weighted']) {
    $header[] = t('Weight');
    $keys[] = 'weight';
    $rows[0][] = t('n/a');
    $info = t('For users who have <strong>multiple roles</strong>, <strong>weight</strong> property will determine the assigned profile. 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.');
  }
  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-profile assignments') . '</h2>';
  $output .= theme('table', $header, $rows);
  $output .= '<div class="form-item"><div class="description">' . t('Assign profiles to user roles.') . ' ' . $info . '</div></div>';
  $output .= drupal_render($form['common']);
  $output .= drupal_render($form);
  return $output;
}