Révision 13c3c9b4
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/advanced_forum/includes/template_preprocess_advanced_forum_topic_list_view.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 advanced forum topic list. |
|
11 |
*/ |
|
8 | 12 |
function _template_preprocess_advanced_forum_topic_list_view(&$variables) { |
9 | 13 |
|
10 | 14 |
// Even though this isn't needed for the actual topic list view, the other |
... | ... | |
81 | 85 |
$variables['shadow'][$count] = theme('advanced_forum_shadow_topic', array( |
82 | 86 |
'title' => $row->node_title, |
83 | 87 |
'nid' => $row->nid, |
84 |
'new_forum' => empty($term->name) ? "" : $term->name |
|
88 |
'new_forum' => empty($term->name) ? "" : $term->name,
|
|
85 | 89 |
)); |
86 | 90 |
} |
87 | 91 |
else { |
... | ... | |
101 | 105 |
$variables['fields'][$field] .= ' active'; |
102 | 106 |
} |
103 | 107 |
|
104 |
// render the header labels
|
|
108 |
// Render the header labels.
|
|
105 | 109 |
if ($field == $column && empty($fields[$field]->options['exclude'])) { |
106 | 110 |
$label = check_plain(!empty($fields[$field]) ? $fields[$field]->label() : ''); |
107 | 111 |
if (empty($options['info'][$field]['sortable']) || !$fields[$field]->click_sortable()) { |
... | ... | |
151 | 155 |
} |
152 | 156 |
} |
153 | 157 |
|
154 |
// Add a CSS align class to each field if one was set |
|
158 |
// Add a CSS align class to each field if one was set.
|
|
155 | 159 |
if (!empty($options['info'][$field]['align'])) { |
156 | 160 |
$variables['fields'][$field] .= ' ' . drupal_clean_css_identifier($options['info'][$field]['align']); |
157 | 161 |
} |
158 | 162 |
|
159 | 163 |
// Render each field into its appropriate column. |
160 | 164 |
foreach ($result as $num => $row) { |
161 |
// Add field classes |
|
165 |
// Add field classes.
|
|
162 | 166 |
$variables['field_classes'][$field][$num] = ''; |
163 | 167 |
if ($fields[$field]->options['element_default_classes']) { |
164 | 168 |
$variables['field_classes'][$field][$num] = "views-field views-field-" . $variables['fields'][$field]; |
... | ... | |
210 | 214 |
$variables['row_classes'][0][] = 'views-row-first'; |
211 | 215 |
$variables['row_classes'][count($variables['row_classes']) - 1][] = 'views-row-last'; |
212 | 216 |
|
213 |
$variables['classes_array'] = array('forum-table', 'forum-table-topics'); |
|
217 |
if (!variable_get('advanced_forum_keep_classes', FALSE) || !is_array($variables['classes_array'])) { |
|
218 |
// Add in our classes overwriting existing. |
|
219 |
$variables['classes_array'] = array(); |
|
220 |
} |
|
221 |
|
|
222 |
$variables['classes_array'][] = 'forum-table forum-table-topics'; |
|
214 | 223 |
if (empty($variables['rows']) && !empty($options['empty_table'])) { |
215 | 224 |
$variables['rows'][0][0] = $view->display_handler->render_area('empty'); |
216 | 225 |
// Calculate the amounts of rows with output. |
... | ... | |
218 | 227 |
$variables['field_classes'][0][0] = 'views-empty'; |
219 | 228 |
} |
220 | 229 |
|
221 |
|
|
222 | 230 |
if (!empty($options['sticky'])) { |
223 | 231 |
drupal_add_js('misc/tableheader.js'); |
224 | 232 |
$variables['classes_array'][] = "sticky-enabled"; |
Formats disponibles : Unified diff
Weekly update of contrib modules