Projet

Général

Profil

Paste
Télécharger (601 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / feeds / views / feeds_views_handler_argument_importer_id.inc @ 76df55b7

1
<?php
2

    
3
/**
4
 * @file
5
 * Argument handler for importer ids.
6
 */
7
class feeds_views_handler_argument_importer_id extends views_handler_argument_string {
8

    
9
  /**
10
   * Argument must be a valid importer id.
11
   */
12
  function validate_arg($arg) {
13
    // By using % in URLs, arguments could be validated twice; this eases
14
    // that pain.
15
    if (isset($this->argument_validated)) {
16
      return $this->argument_validated;
17
    }
18
    $this->argument_validated = FALSE;
19
    if (in_array($arg, feeds_enabled_importers())) {
20
      $this->argument_validated = TRUE;
21
    }
22
    return $this->argument_validated;
23
  }
24
}