You are here

function _wysiwyg_admin in Wysiwyg 5

Callback handler for admin pages; menu callback.

@todo Move into hook_menu(), resp. FAPI functions.

1 call to _wysiwyg_admin()
wysiwyg_admin in ./wysiwyg.module
Callback handler for admin pages; menu callback.

File

./wysiwyg.admin.inc, line 13
Integrate Wysiwyg editors into Drupal.

Code

function _wysiwyg_admin($arg = '', $format = '') {
  switch ($arg) {
    case 'edit':
      if ($profile = wysiwyg_load_profile($format)) {
        $breadcrumb = array();
        $breadcrumb[] = array(
          'path' => 'admin',
          'title' => t('administer'),
        );
        $breadcrumb[] = array(
          'path' => 'admin/settings',
          'title' => t('Site configuration'),
        );
        $breadcrumb[] = array(
          'path' => 'admin/settings/wysiwyg/profile',
          'title' => t('Wysiwyg profiles'),
        );
        $breadcrumb[] = array(
          'path' => 'admin/settings/wysiwyg/profile/edit',
        );
        menu_set_location($breadcrumb);
        return drupal_get_form('wysiwyg_profile_form', $profile);
      }
      break;
    case 'delete':
      return drupal_get_form('wysiwyg_profile_delete_confirm', $format);
    case '':
      return drupal_get_form('wysiwyg_profile_overview');
  }
  drupal_goto('admin/settings/wysiwyg/profile');
}