You are here

function bueditor_menu in BUEditor 5

Same name and namespace in other branches
  1. 6.2 bueditor.module \bueditor_menu()
  2. 6 bueditor.module \bueditor_menu()
  3. 7 bueditor.module \bueditor_menu()

Implementation of hook_menu().

File

./bueditor.module, line 6

Code

function bueditor_menu($may_cache) {
  $items = array();
  $path = 'admin/settings/bueditor';
  if ($may_cache) {
    $items[] = array(
      'path' => $path,
      'title' => 'BUEditor',
      'access' => user_access('administer site configuration'),
      'callback' => 'bueditor_admin',
      'description' => t('Customize your text editor.'),
    );
  }
  else {
    if (arg(2) == 'bueditor' && arg(1) == 'settings' && arg(0) == 'admin') {
      $editors = bueditor_editors('all');
      foreach ($editors as $eid => $editor) {
        $items[] = array(
          'path' => $path . '/' . $eid,
          'title' => $editor->name,
          'callback' => 'bueditor_get_form_editor',
        );
        $items[] = array(
          'path' => $path . '/' . $eid . '/delete',
          'title' => t('Delete'),
          'callback' => 'bueditor_confirm_delete',
        );
      }
      $items[] = array(
        'path' => $path . '/new',
        'title' => t('Add new editor'),
        'callback' => 'bueditor_get_form_editor',
      );
    }
  }
  return $items;
}