You are here

function captcha_get_captcha_points in CAPTCHA 7

Same name and namespace in other branches
  1. 6.2 captcha.inc \captcha_get_captcha_points()

Helper function to load all captcha points.

Return value

array of all captcha_points

2 calls to captcha_get_captcha_points()
captcha_admin_settings in ./captcha.admin.inc
Form builder function for the general CAPTCHA configuration.
captcha_admin_settings_submit in ./captcha.admin.inc
Submission function for captcha_admin_settings form.

File

./captcha.inc, line 132
General CAPTCHA functionality and helper functions.

Code

function captcha_get_captcha_points() {
  if (module_exists('ctools')) {
    ctools_include('export');
    $captcha_points = ctools_export_load_object('captcha_points', 'all');
  }
  else {
    $captcha_points = array();
    $result = db_select('captcha_points', 'cp')
      ->fields('cp')
      ->orderBy('form_id')
      ->execute();
    foreach ($result as $captcha_point) {
      $captcha_points[] = $captcha_point;
    }
  }
  return $captcha_points;
}