Projet

Général

Profil

Révision 00c2605a

Ajouté par Assos Assos il y a environ 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/captcha/captcha.install
12 12
  // Table for positions and types of the challenges.
13 13
  $schema['captcha_points'] = array(
14 14
    'description' => 'This table describes which challenges should be added to which forms.',
15
    'export' => array(
16
      'key' => 'form_id',
17
      'identifier' => 'captcha',
18
      'default hook' => 'captcha_default_points',  // Function hook name.
19
      'status' => 'mark_status',
20
      'api' => array(
21
        'owner' => 'captcha',
22
        'api' => 'captcha',  // Base name for api include files.
23
        'minimum_version' => 1,
24
        'current_version' => 1,
25
      ),
26
    ),
15 27
    'fields' => array(
16 28
      'form_id' => array(
17 29
        'description' => 'The form_id of the form to add a CAPTCHA to.',
......
134 146
 */
135 147
function captcha_install() {
136 148
  $t = get_t();
137
  // Insert some default CAPTCHA points.
138
  $form_ids = array(
139
    'contact_site_form', 'contact_personal_form',
140
    'user_register_form', 'user_pass', 'user_login', 'user_login_block',
141
    'forum_node_form',
142
  );
143
  // Add form_ids of all currently known node types too.
144
  foreach (node_type_get_names() as $type => $name) {
145
    $form_ids[] = 'comment_node_' . $type . '_form';
146
  }
147
  foreach ($form_ids as $form_id) {
148
    db_insert('captcha_points')
149
      ->fields(array(
150
        'form_id' => $form_id,
151
        'module' => NULL,
152
        'captcha_type' => NULL,
153
      ))
154
      ->execute();
155
  }
156 149

  
157 150
  // Be friendly to your users: what to do after install?
158 151
  drupal_set_message($t('You can now <a href="!captcha_admin">configure the CAPTCHA module</a> for your site.',

Formats disponibles : Unified diff