Projet

Général

Profil

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

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

1
<?php
2

    
3
/**
4
 * @file
5
 * Argument handler for importer ids.
6
 */
7

    
8
/**
9
 *
10
 */
11
class feeds_views_handler_argument_importer_id extends views_handler_argument_string {
12

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

    
29
}