You are here

function botcha_point_admin in BOTCHA Spam Prevention 7

Same name and namespace in other branches
  1. 6 botcha.pages.inc \botcha_point_admin()

Central handler for BOTCHA point administration (adding, disabling, deleting)

1 string reference to 'botcha_point_admin'
botcha_menu in ./botcha.module
Implements hook_menu().

File

./botcha.pages.inc, line 295
Implementation of botcha administration forms.

Code

function botcha_point_admin($botcha_point_form_id = NULL, $op = NULL) {
  module_load_include('inc', 'botcha');

  // if $botcha_point_form_id and action $op given: do the action
  if ($botcha_point_form_id) {
    switch ($op) {
      case 'disable':
        return drupal_get_form('botcha_point_disable_confirm', $botcha_point_form_id, FALSE);
      case 'delete':
        return drupal_get_form('botcha_point_disable_confirm', $botcha_point_form_id, TRUE);
    }

    // return edit form for BOTCHA point
    return drupal_get_form('botcha_point_admin_form', $botcha_point_form_id);
  }

  // return add form for BOTCHA point
  return drupal_get_form('botcha_point_admin_form');
}