You are here

function bueditor_admin in BUEditor 6.2

Same name and namespace in other branches
  1. 5 bueditor.module \bueditor_admin()
  2. 6 bueditor.admin.inc \bueditor_admin()
  3. 7 admin/bueditor.admin.inc \bueditor_admin()

Admin main page.

2 string references to 'bueditor_admin'
bueditor_admin_form in admin/bueditor.admin.inc
Admin form.
bueditor_menu in ./bueditor.module
Implementation of hook_menu().

File

admin/bueditor.admin.inc, line 13

Code

function bueditor_admin() {
  bueditor_eop();
  $editors = bueditor_editors('all');
  $token = drupal_get_token(date('ymd'));
  $header = array(
    t('Editor name'),
    t('Operations'),
  );
  $rows = array();
  foreach ($editors as $eid => $editor) {
    $rows[] = array(
      check_plain($editor->name),
      l(t('Edit'), 'admin/settings/bueditor/' . $eid) . ' | ' . l(t('Delete'), 'admin/settings/bueditor/' . $eid . '/delete', array(
        'attributes' => array(
          'class' => 'eop-delete',
        ),
      )) . ' | ' . l(t('Copy'), 'admin/settings/bueditor', array(
        'attributes' => array(
          'class' => 'eop-copy',
          'name' => 'Copy of ' . $editor->name,
        ),
        'query' => array(
          'eop' => 'copy',
          'eid' => $eid,
          'token' => $token,
        ),
      )) . ' | ' . l(t('Export'), 'admin/settings/bueditor', array(
        'attributes' => array(
          'class' => 'eop-export',
        ),
        'query' => array(
          'eop' => 'export',
          'eid' => $eid,
          'token' => $token,
        ),
      )),
    );
  }
  $rows[] = array(
    array(
      'data' => l(t('Add new editor'), 'admin/settings/bueditor/new') . ' | ' . l(t('Import editor'), 'admin/settings/bueditor/import') . ' | ' . l(t('Add the default editor'), 'admin/settings/bueditor', array(
        'attributes' => array(
          'class' => 'eop-add-default',
          'name' => 'default editor',
        ),
        'query' => array(
          'eop' => 'add_default',
          'token' => $token,
        ),
      )),
      'colspan' => 2,
    ),
  );
  $output = '<h2 class="title">' . t('Available editors') . '</h2>';
  $output .= theme('table', $header, $rows, array(
    'id' => 'available-editors-list',
  ));
  $output .= drupal_get_form('bueditor_admin_form');
  return $output;
}