Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/comment/views_plugin_row_comment_rss.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Contains the comment RSS row style plugin.
|
|
5 |
* Definition of views_plugin_row_comment_rss.
|
|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
9 | 9 |
* Plugin which formats the comments as RSS items. |
10 | 10 |
*/ |
11 | 11 |
class views_plugin_row_comment_rss extends views_plugin_row { |
12 |
var $base_table = 'comment'; |
|
13 |
var $base_field = 'cid'; |
|
14 | 12 |
|
15 |
function option_definition() { |
|
13 |
/** |
|
14 |
* {@inheritdoc} |
|
15 |
*/ |
|
16 |
public $base_table = 'comment'; |
|
17 |
|
|
18 |
/** |
|
19 |
* {@inheritdoc} |
|
20 |
*/ |
|
21 |
public $base_field = 'cid'; |
|
22 |
|
|
23 |
/** |
|
24 |
* {@inheritdoc} |
|
25 |
*/ |
|
26 |
public function option_definition() { |
|
16 | 27 |
$options = parent::option_definition(); |
17 | 28 |
|
18 | 29 |
$options['item_length'] = array('default' => 'default'); |
... | ... | |
21 | 32 |
return $options; |
22 | 33 |
} |
23 | 34 |
|
24 |
function options_form(&$form, &$form_state) { |
|
35 |
/** |
|
36 |
* {@inheritdoc} |
|
37 |
*/ |
|
38 |
public function options_form(&$form, &$form_state) { |
|
25 | 39 |
parent::options_form($form, $form_state); |
26 | 40 |
|
27 | 41 |
$form['item_length'] = array( |
... | ... | |
37 | 51 |
); |
38 | 52 |
} |
39 | 53 |
|
40 |
|
|
41 |
function pre_render($result) { |
|
54 |
/** |
|
55 |
* {@inheritdoc} |
|
56 |
*/ |
|
57 |
public function pre_render($result) { |
|
42 | 58 |
$cids = array(); |
43 | 59 |
$nids = array(); |
44 | 60 |
|
... | ... | |
59 | 75 |
* Return the main options, which are shown in the summary title |
60 | 76 |
* |
61 | 77 |
* @see views_plugin_row_node_rss::options_form_summary_options() |
62 |
* @todo: Maybe provide a views_plugin_row_rss_entity and reuse this method
|
|
78 |
* @todo Maybe provide a views_plugin_row_rss_entity and reuse this method |
|
63 | 79 |
* in views_plugin_row_comment|node_rss.inc |
64 | 80 |
*/ |
65 |
function options_form_summary_options() { |
|
81 |
public function options_form_summary_options() {
|
|
66 | 82 |
$entity_info = entity_get_info('node'); |
67 | 83 |
$options = array(); |
68 | 84 |
if (!empty($entity_info['view modes'])) { |
... | ... | |
75 | 91 |
return $options; |
76 | 92 |
} |
77 | 93 |
|
78 |
|
|
79 |
function render($row) { |
|
94 |
/** |
|
95 |
* {@inheritdoc} |
|
96 |
*/ |
|
97 |
public function render($row) { |
|
80 | 98 |
global $base_url; |
81 | 99 |
|
82 | 100 |
$cid = $row->{$this->field_alias}; |
... | ... | |
89 | 107 |
$item_length = variable_get('feed_item_length', 'teaser'); |
90 | 108 |
} |
91 | 109 |
|
92 |
// Load the specified comment and its associated node:
|
|
110 |
// Load the specified comment and its associated node.
|
|
93 | 111 |
$comment = $this->comments[$cid]; |
94 | 112 |
if (empty($comment) || empty($this->nodes[$comment->nid])) { |
95 | 113 |
return; |
... | ... | |
149 | 167 |
'row' => $item |
150 | 168 |
)); |
151 | 169 |
} |
170 |
|
|
152 | 171 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules