1 |
e5e66f93
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
class PanelizerEntityComment extends PanelizerEntityDefault {
|
13 |
|
|
public $views_table = 'comment';
|
14 |
|
|
public $uses_page_manager = FALSE;
|
15 |
|
|
|
16 |
|
|
public function entity_access($op, $entity) {
|
17 |
|
|
if ($op == 'edit') {
|
18 |
|
|
return comment_access($op, $entity);
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
if ($op == 'view') {
|
23 |
|
|
return TRUE;
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
return FALSE;
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
public function entity_save($entity) {
|
33 |
|
|
comment_save($entity);
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
public function settings_form(&$form, &$form_state) {
|
37 |
|
|
parent::settings_form($form, $form_state);
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
public function entity_identifier($entity) {
|
41 |
|
|
return t('This comment');
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
public function entity_bundle_label() {
|
45 |
|
|
return t('Comment node type');
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
function get_default_display($bundle, $view_mode) {
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
return parent::get_default_display($bundle, $view_mode);
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
public function hook_default_page_manager_handlers(&$handlers) {
|
61 |
|
|
$handler = new stdClass;
|
62 |
|
|
$handler->disabled = FALSE;
|
63 |
|
|
$handler->api_version = 1;
|
64 |
|
|
$handler->name = 'comment_view_panelizer';
|
65 |
|
|
$handler->task = 'comment_view';
|
66 |
|
|
$handler->subtask = '';
|
67 |
|
|
$handler->handler = 'panelizer_node';
|
68 |
|
|
$handler->weight = -100;
|
69 |
|
|
$handler->conf = array(
|
70 |
|
|
'title' => t('Comment panelizer'),
|
71 |
|
|
'context' => 'argument_entity_id:comment_1',
|
72 |
|
|
'access' => array(),
|
73 |
|
|
);
|
74 |
|
|
$handlers['comment_view_panelizer'] = $handler;
|
75 |
|
|
|
76 |
|
|
return $handlers;
|
77 |
|
|
}
|
78 |
|
|
} |