You are here

function bueditor_eop in BUEditor 7

Same name and namespace in other branches
  1. 6.2 admin/bueditor.admin.inc \bueditor_eop()

Prepare and execute if there is any valid editor operation that doesn't require form submission.

1 call to bueditor_eop()
bueditor_admin in admin/bueditor.admin.inc
Admin main page.

File

admin/bueditor.admin.inc, line 778

Code

function bueditor_eop() {
  if (!isset($_GET['eop']) || !isset($_GET['token'])) {

    //Add editor name prompt for copy and add_default operations.

    //Confirm editor deletion without going to the confirmation page.
    return drupal_add_js(drupal_get_path('module', 'bueditor') . '/admin/bueditor.eop.js', array(
      'preprocess' => FALSE,
    ));
  }
  if (drupal_valid_token($_GET['token'], date('ymd'))) {
    $editors = bueditor_editors('all');
    $eop = $_GET['eop'];
    $name = isset($_GET['name']) ? check_plain($_GET['name']) : '';
    $editor = isset($_GET['eid']) && isset($editors[$_GET['eid']]) ? $editors[$_GET['eid']] : NULL;
    if ($eop == 'add_default') {
      bueditor_eop_add_default($name);
    }
    elseif ($editor) {
      switch ($eop) {
        case 'copy':
          bueditor_eop_copy($editor, $name);
          break;
        case 'delete':
          bueditor_eop_delete($editor);
          break;
        case 'export':
          bueditor_eop_export($editor);
          break;
      }
    }
  }
  drupal_goto('admin/config/content/bueditor');
}