1
|
<?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
|
/**
|
14
|
* Validates if argument is a valid Feed node.
|
15
|
*/
|
16
|
public function validate_argument($argument) {
|
17
|
$node = node_load($argument);
|
18
|
if ($node) {
|
19
|
$importer_id = feeds_get_importer_id($node->type);
|
20
|
if ($importer_id) {
|
21
|
return TRUE;
|
22
|
}
|
23
|
}
|
24
|
return FALSE;
|
25
|
}
|
26
|
|
27
|
}
|