You are here

function wysiwyg_menu in Wysiwyg 5.2

Same name and namespace in other branches
  1. 5 wysiwyg.module \wysiwyg_menu()
  2. 6.2 wysiwyg.module \wysiwyg_menu()
  3. 6 wysiwyg.module \wysiwyg_menu()
  4. 7.2 wysiwyg.module \wysiwyg_menu()

Implementation of hook_menu().

File

./wysiwyg.module, line 11
Integrate client-side editors with Drupal.

Code

function wysiwyg_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/wysiwyg',
      'title' => t('Wysiwyg'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'wysiwyg_profile_overview',
      ),
      'description' => t('Configure client-side editors.'),
      'access' => user_access('administer filters'),
    );
    $items[] = array(
      'path' => 'wysiwyg',
      'callback' => 'wysiwyg_dialog',
      'access' => user_access('access content'),
      'type' => MENU_CALLBACK,
    );
    return $items;
  }
  if (strpos($_GET['q'], 'admin/settings/wysiwyg') !== FALSE) {
    require_once drupal_get_path('module', 'wysiwyg') . '/wysiwyg.admin.inc';
    if ($profile = wysiwyg_profile_load(arg(4))) {
      $items[] = array(
        'path' => "admin/settings/wysiwyg/profile/{$profile->format}/edit",
        'title' => t('Edit'),
        'callback' => 'drupal_get_form',
        'callback arguments' => array(
          'wysiwyg_profile_form',
          $profile,
        ),
        'access' => user_access('administer filters'),
        'type' => MENU_LOCAL_TASK,
      );
      $items[] = array(
        'path' => "admin/settings/wysiwyg/profile/{$profile->format}/delete",
        'title' => t('Remove'),
        'callback' => 'drupal_get_form',
        'callback arguments' => array(
          'wysiwyg_profile_delete_confirm',
          $profile,
        ),
        'access' => user_access('administer filters'),
        'type' => MENU_LOCAL_TASK,
        'weight' => 10,
      );
    }
  }
  elseif (arg(0) == 'wysiwyg') {
    require_once drupal_get_path('module', 'wysiwyg') . '/wysiwyg.dialog.inc';
  }
  return $items;
}