Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/includes/advanced_forum_preprocess_forum_list.inc | ||
---|---|---|
5 | 5 |
* Holds the contents of a preprocess function moved into its own file |
6 | 6 |
* to ease memory requirements and having too much code in one file. |
7 | 7 |
*/ |
8 |
|
|
9 |
/** |
|
10 |
* Preprocess forum list. |
|
11 |
*/ |
|
8 | 12 |
function _advanced_forum_preprocess_forum_list(&$variables) { |
9 | 13 |
advanced_forum_add_template_suggestions("forum_list", $variables); |
10 | 14 |
|
11 |
// Added variable for default collapsed configuration |
|
15 |
// Added variable for default collapsed configuration.
|
|
12 | 16 |
$variables['collapsed_main_list'] = variable_get('advanced_forum_default_collapsed_list', array()); |
13 | 17 |
|
14 | 18 |
// Add needed items for the collapsible containers. |
... | ... | |
99 | 103 |
$table_counter = 0; |
100 | 104 |
} |
101 | 105 |
|
102 |
// workaround for container-less forums on main page
|
|
106 |
// Workaround for container-less forums on main page.
|
|
103 | 107 |
$depth_offset = 0; |
104 | 108 |
foreach ($items as $id => $item) { |
105 | 109 |
// Get a handle on the parent of this item. |
... | ... | |
179 | 183 |
// container. Start a new generic one. We need a tid so just grab |
180 | 184 |
// the tid of the current forum for it. |
181 | 185 |
$table_counter++; |
182 |
if (!isset($tables[$table_counter]['table_info'])) |
|
186 |
if (!isset($tables[$table_counter]['table_info'])) {
|
|
183 | 187 |
$tables[$table_counter]['table_info'] = new stdClass(); |
188 |
} |
|
184 | 189 |
$tables[$table_counter]['table_info']->name = t('Forums'); |
185 | 190 |
$tables[$table_counter]['table_info']->description = ''; |
186 | 191 |
$tables[$table_counter]['table_info']->tid = $item->tid; |
187 | 192 |
|
188 | 193 |
// Reset the striping. |
189 | 194 |
advanced_forum_stripe(TRUE); |
190 |
$depth_offset = 1; |
|
191 | 195 |
} |
196 |
$depth_offset = 1; |
|
192 | 197 |
|
193 | 198 |
// Set the variable to control the row striping. |
194 | 199 |
$item->zebra = advanced_forum_stripe(); |
... | ... | |
230 | 235 |
unset($variables['zebra']); |
231 | 236 |
} |
232 | 237 |
|
238 |
/** |
|
239 |
* Forum stripe. |
|
240 |
*/ |
|
233 | 241 |
function advanced_forum_stripe($reset = FALSE) { |
234 | 242 |
static $stripe = 'odd'; |
235 | 243 |
|
... | ... | |
362 | 370 |
unset($forum->last_post); |
363 | 371 |
$forum->last_post = theme('forum_submitted', array('topic' => $last_post)); |
364 | 372 |
|
365 |
// Display forum images using Field API |
|
373 |
// Display forum images using Field API.
|
|
366 | 374 |
$entity = entity_load('taxonomy_term', array($forum->tid)); |
367 | 375 |
$field_name = variable_get('advanced_forum_forum_image_field', ''); |
368 | 376 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules