function bueditor_admin in BUEditor 7
Same name and namespace in other branches
- 5 bueditor.module \bueditor_admin()
- 6.2 admin/bueditor.admin.inc \bueditor_admin()
- 6 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 - Implements hook_menu().
File
- admin/
bueditor.admin.inc, line 13
Code
function bueditor_admin() {
bueditor_eop();
$path = 'admin/config/content/bueditor';
$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'), $path . '/' . $eid) . ' | ' . l(t('Delete'), $path . '/' . $eid . '/delete', array(
'attributes' => array(
'class' => array(
'eop-delete',
),
),
)) . ' | ' . l(t('Copy'), $path, array(
'attributes' => array(
'class' => array(
'eop-copy',
),
'name' => 'Copy of ' . $editor->name,
),
'query' => array(
'eop' => 'copy',
'eid' => $eid,
'token' => $token,
),
)) . ' | ' . l(t('Export'), $path, array(
'attributes' => array(
'class' => array(
'eop-export',
),
),
'query' => array(
'eop' => 'export',
'eid' => $eid,
'token' => $token,
),
)),
);
}
$rows[] = array(
array(
'data' => l(t('Add new editor'), $path . '/new') . ' | ' . l(t('Import editor'), $path . '/import') . ' | ' . l(t('Add the default editor'), $path, array(
'attributes' => array(
'class' => array(
'eop-add-default',
),
'name' => 'default editor',
),
'query' => array(
'eop' => 'add_default',
'token' => $token,
),
)),
'colspan' => 2,
),
);
$output['title'] = array(
'#markup' => '<h2 class="title">' . t('Available editors') . '</h2>',
);
$output['table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#attributes' => array(
'id' => 'available-editors-list',
),
);
$output['form'] = drupal_get_form('bueditor_admin_form');
return $output;
}