Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/plugins/content_types/forum_statistics.inc | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* @file |
|
4 |
* Forum statistics. |
|
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_statistics_content_type_render($subtype, $conf, $panel_args, $context) { |
|
24 |
function advanced_forum_forum_statistics_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-secondary-links'; |
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 |
$block->content = theme('advanced_forum_statistics'); |
... | ... | |
44 | 52 |
/** |
45 | 53 |
* Returns an edit form for the custom type. |
46 | 54 |
*/ |
47 |
function advanced_forum_forum_statistics_content_type_edit_form($form, &$form_state) { |
|
55 |
function advanced_forum_forum_statistics_content_type_edit_form( |
|
56 |
$form, |
|
57 |
&$form_state |
|
58 |
) { |
|
48 | 59 |
return $form; |
49 | 60 |
} |
50 | 61 |
|
51 |
function advanced_forum_forum_statistics_content_type_edit_form_submit($form, &$form_state) { |
|
62 |
/** |
|
63 |
* Submit callback. |
|
64 |
*/ |
|
65 |
function advanced_forum_forum_statistics_content_type_edit_form_submit( |
|
66 |
$form, |
|
67 |
&$form_state |
|
68 |
) { |
|
52 | 69 |
// Copy everything from our defaults. |
53 | 70 |
foreach (array_keys($form_state['plugin']['defaults']) as $key) { |
54 | 71 |
$form_state['conf'][$key] = $form_state['values'][$key]; |
55 | 72 |
} |
56 | 73 |
} |
57 | 74 |
|
58 |
function advanced_forum_forum_statistics_content_type_admin_title($subtype, $conf, $context) { |
|
75 |
/** |
|
76 |
* Callback for admin title. |
|
77 |
*/ |
|
78 |
function advanced_forum_forum_statistics_content_type_admin_title( |
|
79 |
$subtype, |
|
80 |
$conf, |
|
81 |
$context |
|
82 |
) { |
|
59 | 83 |
return t('"@s" statistics', array('@s' => $context->identifier)); |
60 | 84 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules