You are here

function fckeditor_profile_overview in FCKeditor - WYSIWYG HTML editor 6.2

Same name and namespace in other branches
  1. 5.2 fckeditor.module \fckeditor_profile_overview()
  2. 6 fckeditor.module \fckeditor_profile_overview()

Controller for fckeditor profiles.

1 call to fckeditor_profile_overview()
fckeditor_admin_main in ./fckeditor.admin.inc
Main administrative page

File

./fckeditor.admin.inc, line 110
FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben

Code

function fckeditor_profile_overview() {
  $output = '';
  $profiles = fckeditor_profile_load();
  if ($profiles) {
    $access_fckeditor_roles = user_roles(FALSE, 'access fckeditor');
    $header = array(
      t('Profile'),
      t('Roles'),
      t('Operations'),
    );
    foreach ($profiles as $p) {
      $rids = $p->rids;
      if ($p->name !== 'FCKeditor Global Profile') {
        foreach (array_keys($p->rids) as $rid) {
          if (!isset($access_fckeditor_roles[$rid])) {
            unset($rids[$rid]);
          }
        }
        $rows[] = array(
          array(
            'data' => $p->name,
            'valign' => 'top',
          ),
          array(
            'data' => implode("<br />\n", $rids),
          ),
          array(
            'data' => l(t('edit'), 'admin/settings/fckeditor/edit/' . rawurlencode($p->name)) . ' ' . l(t('clone'), 'admin/settings/fckeditor/clone/' . rawurlencode($p->name)) . ' ' . l(t('delete'), 'admin/settings/fckeditor/delete/' . rawurlencode($p->name)),
            'valign' => 'top',
          ),
        );
      }
    }
    $output .= '<h3>' . t('Profiles') . '</h3>';
    $output .= theme('table', $header, $rows);
    $output .= '<p>' . l(t('Create new profile'), 'admin/settings/fckeditor/add') . '</p>';
  }
  else {
    drupal_set_message(t('No profiles found. Click here to !createlink.', array(
      '!createlink' => l(t('create a new profile'), 'admin/settings/fckeditor/add'),
    )));
  }
  $rows = array();
  if (!isset($profiles['FCKeditor Global Profile'])) {
    drupal_set_message(t('Global profile not found. Click here to !createlink.', array(
      '!createlink' => l(t('create the global profile'), 'admin/settings/fckeditor/addg'),
    )));
  }
  else {
    $output .= '<h3>' . t('Global settings') . '</h3>';
    $rows[] = array(
      array(
        'data' => t('FCKeditor Global Profile'),
        'valign' => 'top',
      ),
      array(
        'data' => l(t('edit'), 'admin/settings/fckeditor/editg') . ' ' . l(t('delete'), 'admin/settings/fckeditor/delete/FCKeditor Global Profile'),
        'valign' => 'top',
      ),
    );
    $output .= theme('table', array(
      t('Profile'),
      t('Operations'),
    ), $rows);
  }
  return $output;
}