Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/plugins/content_types/forum_mark_read.inc | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* @file |
|
4 |
* Mark read. |
|
5 |
*/ |
|
2 | 6 |
|
3 | 7 |
/** |
4 | 8 |
* Plugins are described by creating a $plugin array which will be used |
... | ... | |
17 | 21 |
/** |
18 | 22 |
* Render the content. |
19 | 23 |
*/ |
20 |
function advanced_forum_forum_mark_read_content_type_render($subtype, $conf, $panel_args, $context) { |
|
24 |
function advanced_forum_forum_mark_read_content_type_render( |
|
25 |
$subtype, |
|
26 |
$conf, |
|
27 |
$panel_args, |
|
28 |
$context |
|
29 |
) { |
|
21 | 30 |
if (!empty($context) && empty($context->data)) { |
22 | 31 |
return; |
23 | 32 |
} |
24 | 33 |
|
25 |
if (empty($context)) { |
|
26 |
$tid = 0; |
|
27 |
} |
|
28 |
else { |
|
34 |
$tid = 0; |
|
35 |
if (!empty($context)) { |
|
29 | 36 |
$tid = $context->data->tid; |
30 | 37 |
} |
31 | 38 |
|
... | ... | |
33 | 40 |
$block->module = 'forum-mark-read'; |
34 | 41 |
$block->delta = $tid; |
35 | 42 |
|
36 |
$block->title = ''; // by default this has no title. |
|
43 |
// By default this has no title. |
|
44 |
$block->title = ''; |
|
37 | 45 |
_advanced_forum_add_files(); |
38 | 46 |
|
39 | 47 |
$mar_link = advanced_forum_get_mark_read_link($tid); |
40 |
$block->content = (empty($mar_link)) ? '' : '<div class="forum-mark-read">' . advanced_forum_get_mark_read_link($tid) . '</div>'; |
|
48 |
$block->content = (empty($mar_link)) ? '' : '<div class="forum-mark-read">' . advanced_forum_get_mark_read_link( |
|
49 |
$tid |
|
50 |
) . '</div>'; |
|
41 | 51 |
|
42 | 52 |
return $block; |
43 | 53 |
} |
... | ... | |
45 | 55 |
/** |
46 | 56 |
* Returns an edit form for the custom type. |
47 | 57 |
*/ |
48 |
function advanced_forum_forum_mark_read_content_type_edit_form($form, &$form_state) { |
|
58 |
function advanced_forum_forum_mark_read_content_type_edit_form( |
|
59 |
$form, |
|
60 |
&$form_state |
|
61 |
) { |
|
49 | 62 |
return $form; |
50 | 63 |
} |
51 | 64 |
|
52 |
function advanced_forum_forum_mark_read_content_type_edit_form_submit($form, &$form_state) { |
|
65 |
/** |
|
66 |
* Submit callback. |
|
67 |
*/ |
|
68 |
function advanced_forum_forum_mark_read_content_type_edit_form_submit( |
|
69 |
$form, |
|
70 |
&$form_state |
|
71 |
) { |
|
53 | 72 |
// Copy everything from our defaults. |
54 | 73 |
foreach (array_keys($form_state['plugin']['defaults']) as $key) { |
55 | 74 |
$form_state['conf'][$key] = $form_state['values'][$key]; |
56 | 75 |
} |
57 | 76 |
} |
58 | 77 |
|
59 |
function advanced_forum_forum_mark_read_content_type_admin_title($subtype, $conf, $context) { |
|
78 |
/** |
|
79 |
* Callback for admin title. |
|
80 |
*/ |
|
81 |
function advanced_forum_forum_mark_read_content_type_admin_title( |
|
82 |
$subtype, |
|
83 |
$conf, |
|
84 |
$context |
|
85 |
) { |
|
60 | 86 |
return t('"@s" mark read', array('@s' => $context->identifier)); |
61 | 87 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules