1 |
41cc1b08
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Contains the 'Feeds node id' argument validator plugin.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Validates whether an argument is a valid Feed node.
|
10 |
|
|
*/
|
11 |
|
|
class feeds_views_plugin_argument_validate_feed_nid extends views_plugin_argument_validate {
|
12 |
|
|
/**
|
13 |
|
|
* Validates if argument is a valid Feed node.
|
14 |
|
|
*/
|
15 |
|
|
public function validate_argument($argument) {
|
16 |
|
|
$node = node_load($argument);
|
17 |
|
|
if ($node) {
|
18 |
|
|
$importer_id = feeds_get_importer_id($node->type);
|
19 |
|
|
if ($importer_id) {
|
20 |
|
|
return TRUE;
|
21 |
|
|
}
|
22 |
|
|
}
|
23 |
|
|
return FALSE;
|
24 |
|
|
}
|
25 |
|
|
} |