Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/includes/advanced_forum_preprocess_node.inc | ||
---|---|---|
6 | 6 |
* to ease memory requirements and having too much code in one file. |
7 | 7 |
*/ |
8 | 8 |
|
9 |
/** |
|
10 |
* Preprocess node. |
|
11 |
*/ |
|
9 | 12 |
function _advanced_forum_preprocess_node(&$variables) { |
10 | 13 |
/* Shortcut variables */ |
11 | 14 |
$node = $variables['node']; |
... | ... | |
16 | 19 |
// We send this to a special .tpl so people can adjust it to their needs. |
17 | 20 |
advanced_forum_add_template_suggestions("post-repeated", $variables); |
18 | 21 |
} |
19 |
elseif (arg(1) == 'reply' || (arg(0) == 'node' && arg(1) == 'add') || !empty($node->in_preview) ) {
|
|
22 |
elseif (arg(1) == 'reply' || (arg(0) == 'node' && arg(1) == 'add') || !empty($node->in_preview)) { |
|
20 | 23 |
// 'reply' deals with the first post being shown when adding a comment. |
21 | 24 |
// 'node/add' is when previewing a new forum post. |
22 | 25 |
advanced_forum_add_template_suggestions("post-preview", $variables); |
23 | 26 |
} |
24 | 27 |
else { |
25 |
// Use our combined node/comment template file |
|
28 |
// Use our combined node/comment template file.
|
|
26 | 29 |
advanced_forum_add_template_suggestions("post", $variables); |
27 | 30 |
} |
28 | 31 |
|
29 | 32 |
/* Topic header */ |
30 | 33 |
$variables['top_post'] = TRUE; |
31 | 34 |
|
32 |
// Build the topic header |
|
35 |
// Build the topic header.
|
|
33 | 36 |
$variables['topic_header'] = theme('advanced_forum_topic_header', array( |
34 | 37 |
'node' => $node, |
35 | 38 |
'comment_count' => isset($variables['comment_count']) ? $variables['comment_count'] : 0, |
36 | 39 |
)); |
37 | 40 |
|
38 |
|
|
39 |
// Add in our classes merging with existing. |
|
40 |
if (!is_array($variables['classes_array'])) { |
|
41 |
if (!variable_get('advanced_forum_keep_classes', FALSE) || !is_array($variables['classes_array'])) { |
|
42 |
// Add in our classes overwriting existing. |
|
41 | 43 |
$variables['classes_array'] = array(); |
42 | 44 |
} |
43 | 45 |
|
44 |
$variables['classes_array'] = array('forum-post clearfix');
|
|
46 |
$variables['classes_array'][] = 'forum-post clearfix';
|
|
45 | 47 |
|
46 | 48 |
// Add the current language to the classes for image handling. |
47 | 49 |
global $language; |
... | ... | |
49 | 51 |
$variables['classes_array'][] = $language->language; |
50 | 52 |
} |
51 | 53 |
|
52 |
// Add the poster's UID
|
|
54 |
// Add the poster's UID.
|
|
53 | 55 |
$variables['classes_array'][] = "posted-by-$node->uid"; |
54 | 56 |
|
55 | 57 |
/* Post ID */ |
56 |
// Set the post ID for theming / targetting
|
|
58 |
// Set the post ID for theming/targetting.
|
|
57 | 59 |
$variables['post_id'] = "post-$node->nid"; |
58 | 60 |
|
59 | 61 |
/* Linked post number */ |
... | ... | |
64 | 66 |
$page_number = !empty($_GET['page']) ? $_GET['page'] : 0; |
65 | 67 |
|
66 | 68 |
// If this is the topic starting node, we need to start off the numbering. |
67 |
// variable changed from post_link to permalink to match core variable |
|
69 |
// Variable changed from post_link to permalink to match core variable. |
|
70 |
// @codingStandardsIgnoreStart |
|
68 | 71 |
$variables['permalink'] = l('#1', "node/$node->nid"); |
69 |
|
|
72 |
// @codingStandardsIgnoreEnd |
|
70 | 73 |
|
71 | 74 |
/* In reply to */ |
72 | 75 |
$variables['in_reply_to'] = ""; |
... | ... | |
100 | 103 |
|
101 | 104 |
/* Signatures */ |
102 | 105 |
if (variable_get('user_signatures', 0)) { |
103 |
$variables['signature'] = '<!--post:signature-core-' . $node->uid . '-->';
|
|
106 |
$variables['signature'] = '<!--post:signature-core-' . $node->uid . '-->'; |
|
104 | 107 |
} |
105 | 108 |
|
106 | 109 |
/* User specific node theming class */ |
... | ... | |
126 | 129 |
$variables['post_edited'] = theme('advanced_forum_post_edited', array( |
127 | 130 |
'who' => $variables['revision_uid'], |
128 | 131 |
'when' => $variables['revision_timestamp'], |
129 |
'why' => $variables['log'] |
|
132 |
'why' => $variables['log'],
|
|
130 | 133 |
)); |
131 | 134 |
} |
132 | 135 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules