Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/node/views_handler_argument_node_type.inc | ||
---|---|---|
9 | 9 |
* Argument handler to accept a node type. |
10 | 10 |
*/ |
11 | 11 |
class views_handler_argument_node_type extends views_handler_argument_string { |
12 |
function construct() { |
|
12 |
|
|
13 |
/** |
|
14 |
* {@inheritdoc} |
|
15 |
*/ |
|
16 |
public function construct() { |
|
13 | 17 |
parent::construct('type'); |
14 | 18 |
} |
15 | 19 |
|
... | ... | |
17 | 21 |
* Override the behavior of summary_name(). Get the user friendly version |
18 | 22 |
* of the node type. |
19 | 23 |
*/ |
20 |
function summary_name($data) { |
|
24 |
public function summary_name($data) {
|
|
21 | 25 |
return $this->node_type($data->{$this->name_alias}); |
22 | 26 |
} |
23 | 27 |
|
... | ... | |
25 | 29 |
* Override the behavior of title(). Get the user friendly version of the |
26 | 30 |
* node type. |
27 | 31 |
*/ |
28 |
function title() { |
|
32 |
public function title() {
|
|
29 | 33 |
return $this->node_type($this->argument); |
30 | 34 |
} |
31 | 35 |
|
32 |
function node_type($type) { |
|
36 |
/** |
|
37 |
* Get the friendly version of a content type's name. |
|
38 |
* |
|
39 |
* @param string $type |
|
40 |
* The content type to check. |
|
41 |
* |
|
42 |
* @return string |
|
43 |
* The system friendly version of a content type's name. |
|
44 |
*/ |
|
45 |
public function node_type($type) { |
|
33 | 46 |
$output = node_type_get_name($type); |
34 | 47 |
if (empty($output)) { |
35 | 48 |
$output = t('Unknown content type'); |
36 | 49 |
} |
37 | 50 |
return check_plain($output); |
38 | 51 |
} |
52 |
|
|
39 | 53 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules