Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/plugins/content_types/forum_topic_list_sort.inc | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* @file |
|
4 |
* Forum topic sort. |
|
5 |
*/ |
|
2 | 6 |
|
3 | 7 |
/** |
4 | 8 |
* Plugins are described by creating a $plugin array which will be used |
... | ... | |
8 | 12 |
'single' => TRUE, |
9 | 13 |
'title' => t('Forum topic list sort widget'), |
10 | 14 |
'icon' => 'icon_forum.png', |
11 |
'description' => t('A small select widget to change the sort order of the forum topic list'), |
|
15 |
'description' => t( |
|
16 |
'A small select widget to change the sort order of the forum topic list' |
|
17 |
), |
|
12 | 18 |
'required context' => new ctools_context_required(t('Forum'), 'forum'), |
13 | 19 |
'category' => t('Forum'), |
14 | 20 |
'defaults' => array(), |
... | ... | |
17 | 23 |
/** |
18 | 24 |
* Render the content. |
19 | 25 |
*/ |
20 |
function advanced_forum_forum_topic_list_sort_content_type_render($subtype, $conf, $panel_args, $context) { |
|
26 |
function advanced_forum_forum_topic_list_sort_content_type_render( |
|
27 |
$subtype, |
|
28 |
$conf, |
|
29 |
$panel_args, |
|
30 |
$context |
|
31 |
) { |
|
21 | 32 |
if (!empty($context) && empty($context->data)) { |
22 | 33 |
return; |
23 | 34 |
} |
24 | 35 |
|
25 |
if (empty($context)) { |
|
26 |
$tid = 0; |
|
27 |
} |
|
28 |
else { |
|
36 |
$tid = 0; |
|
37 |
if (!empty($context)) { |
|
29 | 38 |
$tid = $context->data->tid; |
30 | 39 |
} |
31 | 40 |
|
... | ... | |
37 | 46 |
$block->module = 'forum-secondary-links'; |
38 | 47 |
$block->delta = $tid; |
39 | 48 |
|
40 |
$block->title = ''; // by default this has no title. |
|
49 |
// By default this has no title. |
|
50 |
$block->title = ''; |
|
41 | 51 |
_advanced_forum_add_files(); |
42 | 52 |
|
43 | 53 |
$block->content = advanced_forum_forum_topic_list_sort(); |
... | ... | |
48 | 58 |
/** |
49 | 59 |
* Returns an edit form for the custom type. |
50 | 60 |
*/ |
51 |
function advanced_forum_forum_topic_list_sort_content_type_edit_form($form, &$form_state) { |
|
61 |
function advanced_forum_forum_topic_list_sort_content_type_edit_form( |
|
62 |
$form, |
|
63 |
&$form_state |
|
64 |
) { |
|
52 | 65 |
return $form; |
53 | 66 |
} |
54 | 67 |
|
55 |
function advanced_forum_forum_topic_list_sort_content_type_edit_form_submit($form, &$form_state) { |
|
68 |
/** |
|
69 |
* Submit callback. |
|
70 |
*/ |
|
71 |
function advanced_forum_forum_topic_list_sort_content_type_edit_form_submit( |
|
72 |
$form, |
|
73 |
&$form_state |
|
74 |
) { |
|
56 | 75 |
// Copy everything from our defaults. |
57 | 76 |
foreach (array_keys($form_state['plugin']['defaults']) as $key) { |
58 | 77 |
$form_state['conf'][$key] = $form_state['values'][$key]; |
59 | 78 |
} |
60 | 79 |
} |
61 | 80 |
|
62 |
function advanced_forum_forum_topic_list_sort_content_type_admin_title($subtype, $conf, $context) { |
|
81 |
/** |
|
82 |
* Callback for admin title. |
|
83 |
*/ |
|
84 |
function advanced_forum_forum_topic_list_sort_content_type_admin_title( |
|
85 |
$subtype, |
|
86 |
$conf, |
|
87 |
$context |
|
88 |
) { |
|
63 | 89 |
return t('"@s" topic list sort widget', array('@s' => $context->identifier)); |
64 | 90 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules