Completed
Pull Request — master (#2571)
by Christian
11:55
created
drupal/sites/all/themes/zen/zen-internals/template.comment.inc 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -13,46 +13,46 @@
 block discarded – undo
13 13
  *   The name of the template being rendered ("comment" in this case.)
14 14
  */
15 15
 function _zen_preprocess_comment(&$vars, $hook) {
16
-  // In Drupal 7, $date has been renamed to $created.
17
-  $vars['created'] = $vars['date'];
16
+    // In Drupal 7, $date has been renamed to $created.
17
+    $vars['created'] = $vars['date'];
18 18
 
19
-  // If comment subjects are disabled, don't display them.
20
-  if (variable_get('comment_subject_field_' . $vars['node']->type, 1) == 0) {
19
+    // If comment subjects are disabled, don't display them.
20
+    if (variable_get('comment_subject_field_' . $vars['node']->type, 1) == 0) {
21 21
     $vars['title'] = '';
22
-  }
22
+    }
23 23
 
24
-  // New comment.
25
-  if ($vars['comment']->new) {
24
+    // New comment.
25
+    if ($vars['comment']->new) {
26 26
     $vars['classes_array'][] = 'comment-new';
27
-  }
28
-  // Add an "unpublished" flag.
29
-  if ($vars['comment']->status == COMMENT_NOT_PUBLISHED) {
27
+    }
28
+    // Add an "unpublished" flag.
29
+    if ($vars['comment']->status == COMMENT_NOT_PUBLISHED) {
30 30
     $vars['unpublished'] = TRUE;
31 31
     $vars['classes_array'][] = $vars['status'];
32
-  }
33
-  else {
32
+    }
33
+    else {
34 34
     $vars['unpublished'] = FALSE;
35
-  }
36
-  // Zebra striping.
37
-  if ($vars['id'] == 1) {
35
+    }
36
+    // Zebra striping.
37
+    if ($vars['id'] == 1) {
38 38
     $vars['classes_array'][] = 'first';
39
-  }
40
-  if ($vars['id'] == $vars['node']->comment_count) {
39
+    }
40
+    if ($vars['id'] == $vars['node']->comment_count) {
41 41
     $vars['classes_array'][] = 'last';
42
-  }
43
-  $vars['classes_array'][] = $vars['zebra'];
44
-  if ($vars['comment']->uid == 0) {
42
+    }
43
+    $vars['classes_array'][] = $vars['zebra'];
44
+    if ($vars['comment']->uid == 0) {
45 45
     // Comment is by an anonymous user.
46 46
     $vars['classes_array'][] = 'comment-by-anonymous';
47
-  }
48
-  else {
47
+    }
48
+    else {
49 49
     if ($vars['comment']->uid == $vars['node']->uid) {
50
-      // Comment is by the node author.
51
-      $vars['classes_array'][] = 'comment-by-node-author';
50
+        // Comment is by the node author.
51
+        $vars['classes_array'][] = 'comment-by-node-author';
52 52
     }
53 53
     if ($vars['comment']->uid == $GLOBALS['user']->uid) {
54
-      // Comment was posted by current user.
55
-      $vars['classes_array'][] = 'comment-by-viewer';
54
+        // Comment was posted by current user.
55
+        $vars['classes_array'][] = 'comment-by-viewer';
56
+    }
56 57
     }
57
-  }
58 58
 }
Please login to merge, or discard this patch.
drupal/sites/all/themes/zen/template.php 1 patch
Indentation   +242 added lines, -242 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // Auto-rebuild the theme registry during theme development.
15 15
 if (theme_get_setting('zen_rebuild_registry')) {
16
-  drupal_rebuild_theme_registry();
16
+    drupal_rebuild_theme_registry();
17 17
 }
18 18
 
19 19
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
  * Implements HOOK_theme().
22 22
  */
23 23
 function zen_theme(&$existing, $type, $theme, $path) {
24
-  // When #341140 is fixed, replace _zen_path() with drupal_get_path().
25
-  include_once './' . _zen_path() . '/zen-internals/template.theme-registry.inc';
26
-  return _zen_theme($existing, $type, $theme, $path);
24
+    // When #341140 is fixed, replace _zen_path() with drupal_get_path().
25
+    include_once './' . _zen_path() . '/zen-internals/template.theme-registry.inc';
26
+    return _zen_theme($existing, $type, $theme, $path);
27 27
 }
28 28
 
29 29
 /**
@@ -35,33 +35,33 @@  discard block
 block discarded – undo
35 35
  *   A string containing the breadcrumb output.
36 36
  */
37 37
 function zen_breadcrumb($breadcrumb) {
38
-  // Determine if we are to display the breadcrumb.
39
-  $show_breadcrumb = theme_get_setting('zen_breadcrumb');
40
-  if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {
38
+    // Determine if we are to display the breadcrumb.
39
+    $show_breadcrumb = theme_get_setting('zen_breadcrumb');
40
+    if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {
41 41
 
42 42
     // Optionally get rid of the homepage link.
43 43
     $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home');
44 44
     if (!$show_breadcrumb_home) {
45
-      array_shift($breadcrumb);
45
+        array_shift($breadcrumb);
46 46
     }
47 47
 
48 48
     // Return the breadcrumb with separators.
49 49
     if (!empty($breadcrumb)) {
50
-      $breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');
51
-      $trailing_separator = $title = '';
52
-      if (theme_get_setting('zen_breadcrumb_title')) {
50
+        $breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');
51
+        $trailing_separator = $title = '';
52
+        if (theme_get_setting('zen_breadcrumb_title')) {
53 53
         if ($title = drupal_get_title()) {
54
-          $trailing_separator = $breadcrumb_separator;
54
+            $trailing_separator = $breadcrumb_separator;
55 55
         }
56
-      }
57
-      elseif (theme_get_setting('zen_breadcrumb_trailing')) {
56
+        }
57
+        elseif (theme_get_setting('zen_breadcrumb_trailing')) {
58 58
         $trailing_separator = $breadcrumb_separator;
59
-      }
60
-      return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator$title</div>";
59
+        }
60
+        return '<div class="breadcrumb">' . implode($breadcrumb_separator, $breadcrumb) . "$trailing_separator$title</div>";
61 61
     }
62
-  }
63
-  // Otherwise, return an empty string.
64
-  return '';
62
+    }
63
+    // Otherwise, return an empty string.
64
+    return '';
65 65
 }
66 66
 
67 67
 /**
@@ -90,27 +90,27 @@  discard block
 block discarded – undo
90 90
  *   A string containing an unordered list of links.
91 91
  */
92 92
 function zen_links($links, $attributes = array('class' => 'links'), $heading = '') {
93
-  global $language;
94
-  $output = '';
93
+    global $language;
94
+    $output = '';
95 95
 
96
-  if (count($links) > 0) {
96
+    if (count($links) > 0) {
97 97
     // Treat the heading first if it is present to prepend it to the
98 98
     // list of links.
99 99
     if (!empty($heading)) {
100
-      if (is_string($heading)) {
100
+        if (is_string($heading)) {
101 101
         // Prepare the array that will be used when the passed heading
102 102
         // is a string.
103 103
         $heading = array(
104
-          'text' => $heading,
105
-          // Set the default level of the heading.
106
-          'level' => 'h2',
104
+            'text' => $heading,
105
+            // Set the default level of the heading.
106
+            'level' => 'h2',
107 107
         );
108
-      }
109
-      $output .= '<' . $heading['level'];
110
-      if (!empty($heading['class'])) {
108
+        }
109
+        $output .= '<' . $heading['level'];
110
+        if (!empty($heading['class'])) {
111 111
         $output .= drupal_attributes(array('class' => $heading['class']));
112
-      }
113
-      $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>';
112
+        }
113
+        $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>';
114 114
     }
115 115
 
116 116
     $output .= '<ul'. drupal_attributes($attributes) .'>';
@@ -119,89 +119,89 @@  discard block
 block discarded – undo
119 119
     $i = 1;
120 120
 
121 121
     foreach ($links as $key => $link) {
122
-      $class = $key;
122
+        $class = $key;
123 123
 
124
-      // Add first, last and active classes to the list of links to help out themers.
125
-      if ($i == 1) {
124
+        // Add first, last and active classes to the list of links to help out themers.
125
+        if ($i == 1) {
126 126
         $class .= ' first';
127
-      }
128
-      if ($i == $num_links) {
127
+        }
128
+        if ($i == $num_links) {
129 129
         $class .= ' last';
130
-      }
131
-      if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))
130
+        }
131
+        if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))
132 132
           && (empty($link['language']) || $link['language']->language == $language->language)) {
133 133
         $class .= ' active';
134
-      }
135
-      $output .= '<li'. drupal_attributes(array('class' => $class)) .'>';
134
+        }
135
+        $output .= '<li'. drupal_attributes(array('class' => $class)) .'>';
136 136
 
137
-      if (isset($link['href'])) {
137
+        if (isset($link['href'])) {
138 138
         // Pass in $link as $options, they share the same keys.
139 139
         $output .= l($link['title'], $link['href'], $link);
140
-      }
141
-      else if (!empty($link['title'])) {
140
+        }
141
+        else if (!empty($link['title'])) {
142 142
         // Some links are actually not links, but we wrap these in <span> for adding title and class attributes
143 143
         if (empty($link['html'])) {
144
-          $link['title'] = check_plain($link['title']);
144
+            $link['title'] = check_plain($link['title']);
145 145
         }
146 146
         $span_attributes = '';
147 147
         if (isset($link['attributes'])) {
148
-          $span_attributes = drupal_attributes($link['attributes']);
148
+            $span_attributes = drupal_attributes($link['attributes']);
149 149
         }
150 150
         $output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>';
151
-      }
151
+        }
152 152
 
153
-      $i++;
154
-      $output .= "</li>\n";
153
+        $i++;
154
+        $output .= "</li>\n";
155 155
     }
156 156
 
157 157
     $output .= '</ul>';
158
-  }
158
+    }
159 159
 
160
-  return $output;
160
+    return $output;
161 161
 }
162 162
 
163 163
 /**
164 164
  * Implements theme_menu_item_link()
165 165
  */
166 166
 function zen_menu_item_link($link) {
167
-  if (empty($link['localized_options'])) {
167
+    if (empty($link['localized_options'])) {
168 168
     $link['localized_options'] = array();
169
-  }
169
+    }
170 170
 
171
-  // If an item is a LOCAL TASK, render it as a tab
172
-  if ($link['type'] & MENU_IS_LOCAL_TASK) {
171
+    // If an item is a LOCAL TASK, render it as a tab
172
+    if ($link['type'] & MENU_IS_LOCAL_TASK) {
173 173
     $link['title'] = '<span class="tab">' . check_plain($link['title']) . '</span>';
174 174
     $link['localized_options']['html'] = TRUE;
175
-  }
175
+    }
176 176
 
177
-  return l($link['title'], $link['href'], $link['localized_options']);
177
+    return l($link['title'], $link['href'], $link['localized_options']);
178 178
 }
179 179
 
180 180
 /**
181 181
  * Duplicate of theme_menu_local_tasks() but adds clearfix to tabs.
182 182
  */
183 183
 function zen_menu_local_tasks() {
184
-  $output = '';
184
+    $output = '';
185 185
 
186
-  // CTools requires a different set of local task functions.
187
-  if (module_exists('ctools')) {
186
+    // CTools requires a different set of local task functions.
187
+    if (module_exists('ctools')) {
188 188
     ctools_include('menu');
189 189
     $primary = ctools_menu_primary_local_tasks();
190 190
     $secondary = ctools_menu_secondary_local_tasks();
191
-  }
192
-  else {
191
+    }
192
+    else {
193 193
     $primary = menu_primary_local_tasks();
194 194
     $secondary = menu_secondary_local_tasks();
195
-  }
195
+    }
196 196
 
197
-  if ($primary) {
197
+    if ($primary) {
198 198
     $output .= '<ul class="tabs primary clearfix">' . $primary . '</ul>';
199
-  }
200
-  if ($secondary) {
199
+    }
200
+    if ($secondary) {
201 201
     $output .= '<ul class="tabs secondary clearfix">' . $secondary . '</ul>';
202
-  }
202
+    }
203 203
 
204
-  return $output;
204
+    return $output;
205 205
 }
206 206
 
207 207
 /**
@@ -218,32 +218,32 @@  discard block
 block discarded – undo
218 218
  * @see zen_show_blocks_discovery()
219 219
  */
220 220
 function zen_blocks($region, $show_blocks = NULL) {
221
-  // Since Drupal 6 doesn't pass $show_blocks to theme_blocks, we manually call
222
-  // theme('blocks', NULL, $show_blocks) so that this function can remember the
223
-  // value on later calls.
224
-  static $render_sidebars = TRUE;
225
-  if (!is_null($show_blocks)) {
221
+    // Since Drupal 6 doesn't pass $show_blocks to theme_blocks, we manually call
222
+    // theme('blocks', NULL, $show_blocks) so that this function can remember the
223
+    // value on later calls.
224
+    static $render_sidebars = TRUE;
225
+    if (!is_null($show_blocks)) {
226 226
     $render_sidebars = $show_blocks;
227
-  }
227
+    }
228 228
 
229
-  // If zen_blocks was called with a NULL region, its likely we were just
230
-  // setting the $render_sidebars static variable.
231
-  if ($region) {
229
+    // If zen_blocks was called with a NULL region, its likely we were just
230
+    // setting the $render_sidebars static variable.
231
+    if ($region) {
232 232
     $output = '';
233 233
 
234 234
     // If $renders_sidebars is FALSE, don't render any region whose name begins
235 235
     // with "sidebar_".
236 236
     if ($render_sidebars || (strpos($region, 'sidebar_') !== 0)) {
237
-      // Allow context module to set blocks.
238
-      if (function_exists('context_blocks')) {
237
+        // Allow context module to set blocks.
238
+        if (function_exists('context_blocks')) {
239 239
         $output = context_blocks($region);
240
-      }
241
-      else {
240
+        }
241
+        else {
242 242
         foreach (block_list($region) as $key => $block) {
243
-          // $key == module_delta
244
-          $output .= theme('block', $block);
243
+            // $key == module_delta
244
+            $output .= theme('block', $block);
245
+        }
245 246
         }
246
-      }
247 247
     }
248 248
 
249 249
     // Add any content assigned to this region through drupal_set_content() calls.
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
     // Set the theme hook suggestions.
256 256
     $hook = array('region_' . $region);
257 257
     if (strpos($region, 'sidebar_') === 0) {
258
-      $hook[] = 'region_sidebar';
258
+        $hook[] = 'region_sidebar';
259 259
     }
260 260
     $hook[] = 'region';
261 261
     return $output ? theme($hook, $elements) : '';
262
-  }
262
+    }
263 263
 }
264 264
 
265 265
 /**
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
  * @see zen_blocks()
272 272
  */
273 273
 function zen_show_blocks_discovery(&$vars) {
274
-  if ($vars['show_blocks'] == FALSE) {
274
+    if ($vars['show_blocks'] == FALSE) {
275 275
     // Allow zen_blocks() to statically cache the $show_blocks variable. A TRUE
276 276
     // value is assumed, so we only need to override when $show_blocks is FALSE.
277 277
     theme('blocks', NULL, FALSE);
278
-  }
278
+    }
279 279
 }
280 280
 
281 281
 /**
@@ -287,25 +287,25 @@  discard block
 block discarded – undo
287 287
  *   The name of the template being rendered.
288 288
  */
289 289
 function zen_preprocess(&$vars, $hook) {
290
-  // In D6, the page.tpl uses a different variable name to hold the classes.
291
-  $key = ($hook == 'page' || $hook == 'maintenance_page') ? 'body_classes' : 'classes';
290
+    // In D6, the page.tpl uses a different variable name to hold the classes.
291
+    $key = ($hook == 'page' || $hook == 'maintenance_page') ? 'body_classes' : 'classes';
292 292
 
293
-  // Create a D7-standard classes_array variable.
294
-  if (array_key_exists($key, $vars)) {
293
+    // Create a D7-standard classes_array variable.
294
+    if (array_key_exists($key, $vars)) {
295 295
     // Views (and possibly other modules) have templates with a $classes
296 296
     // variable that isn't a string, so we leave those variables alone.
297 297
     if (is_string($vars[$key])) {
298
-      $vars['classes_array'] = explode(' ', $hook . ' ' . $vars[$key]);
299
-      unset($vars[$key]);
298
+        $vars['classes_array'] = explode(' ', $hook . ' ' . $vars[$key]);
299
+        unset($vars[$key]);
300
+    }
300 301
     }
301
-  }
302
-  else {
302
+    else {
303 303
     $vars['classes_array'] = array($hook);
304
-  }
305
-  // Add support for Skinr
306
-  if (!empty($vars['skinr']) && array_key_exists('classes_array', $vars)) {
304
+    }
305
+    // Add support for Skinr
306
+    if (!empty($vars['skinr']) && array_key_exists('classes_array', $vars)) {
307 307
     $vars['classes_array'][] = $vars['skinr'];
308
-  }
308
+    }
309 309
 }
310 310
 
311 311
 /**
@@ -317,82 +317,82 @@  discard block
 block discarded – undo
317 317
  *   The name of the template being rendered ("page" in this case.)
318 318
  */
319 319
 function zen_preprocess_page(&$vars, $hook) {
320
-  // If the user is silly and enables Zen as the theme, add some styles.
321
-  if ($GLOBALS['theme'] == 'zen') {
320
+    // If the user is silly and enables Zen as the theme, add some styles.
321
+    if ($GLOBALS['theme'] == 'zen') {
322 322
     include_once './' . _zen_path() . '/zen-internals/template.zen.inc';
323 323
     _zen_preprocess_page($vars, $hook);
324
-  }
325
-  // Add conditional stylesheets.
326
-  elseif (!module_exists('conditional_styles')) {
324
+    }
325
+    // Add conditional stylesheets.
326
+    elseif (!module_exists('conditional_styles')) {
327 327
     $language = $GLOBALS['language']->direction == LANGUAGE_RTL ? '_rtl' : '';
328 328
     $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'] . $language, '');
329 329
     $vars['styles'] .= $vars['conditional_styles'];
330
-  }
330
+    }
331 331
 
332
-  // Classes for body element. Allows advanced theming based on context
333
-  // (home page, node of certain type, etc.)
334
-  // Remove the mostly useless page-ARG0 class.
335
-  if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. drupal_strtolower(arg(0))), $vars['classes_array'])) {
332
+    // Classes for body element. Allows advanced theming based on context
333
+    // (home page, node of certain type, etc.)
334
+    // Remove the mostly useless page-ARG0 class.
335
+    if ($index = array_search(preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', 'page-'. drupal_strtolower(arg(0))), $vars['classes_array'])) {
336 336
     unset($vars['classes_array'][$index]);
337
-  }
338
-  if (!$vars['is_front']) {
337
+    }
338
+    if (!$vars['is_front']) {
339 339
     // Add unique class for each page.
340 340
     $path = drupal_get_path_alias($_GET['q']);
341 341
     $vars['classes_array'][] = drupal_html_class('page-' . $path);
342 342
     // Add unique class for each website section.
343 343
     list($section, ) = explode('/', $path, 2);
344 344
     if (arg(0) == 'node') {
345
-      if (arg(1) == 'add') {
345
+        if (arg(1) == 'add') {
346 346
         $section = 'node-add';
347
-      }
348
-      elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
347
+        }
348
+        elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
349 349
         $section = 'node-' . arg(2);
350
-      }
350
+        }
351 351
     }
352 352
     $vars['classes_array'][] = drupal_html_class('section-' . $section);
353
-  }
354
-  if (theme_get_setting('zen_wireframes')) {
353
+    }
354
+    if (theme_get_setting('zen_wireframes')) {
355 355
     $vars['classes_array'][] = 'with-wireframes'; // Optionally add the wireframes style.
356
-  }
357
-  // We need to re-do the $layout and body classes because
358
-  // template_preprocess_page() assumes sidebars are named 'left' and 'right'.
359
-  $vars['layout'] = 'none';
360
-  if (!empty($vars['sidebar_first'])) {
356
+    }
357
+    // We need to re-do the $layout and body classes because
358
+    // template_preprocess_page() assumes sidebars are named 'left' and 'right'.
359
+    $vars['layout'] = 'none';
360
+    if (!empty($vars['sidebar_first'])) {
361 361
     $vars['layout'] = 'first';
362
-  }
363
-  if (!empty($vars['sidebar_second'])) {
362
+    }
363
+    if (!empty($vars['sidebar_second'])) {
364 364
     $vars['layout'] = ($vars['layout'] == 'first') ? 'both' : 'second';
365
-  }
366
-  // If the layout is 'none', then template_preprocess_page() will already have
367
-  // set a 'no-sidebars' class since it won't find a 'left' or 'right' sidebar.
368
-  if ($vars['layout'] != 'none') {
365
+    }
366
+    // If the layout is 'none', then template_preprocess_page() will already have
367
+    // set a 'no-sidebars' class since it won't find a 'left' or 'right' sidebar.
368
+    if ($vars['layout'] != 'none') {
369 369
     // Remove the incorrect 'no-sidebars' class.
370 370
     if ($index = array_search('no-sidebars', $vars['classes_array'])) {
371
-      unset($vars['classes_array'][$index]);
371
+        unset($vars['classes_array'][$index]);
372 372
     }
373 373
     // Set the proper layout body classes.
374 374
     if ($vars['layout'] == 'both') {
375
-      $vars['classes_array'][] = 'two-sidebars';
375
+        $vars['classes_array'][] = 'two-sidebars';
376 376
     }
377 377
     else {
378
-      $vars['classes_array'][] = 'one-sidebar';
379
-      $vars['classes_array'][] = 'sidebar-' . $vars['layout'];
378
+        $vars['classes_array'][] = 'one-sidebar';
379
+        $vars['classes_array'][] = 'sidebar-' . $vars['layout'];
380
+    }
380 381
     }
381
-  }
382
-  // Store the menu item since it has some useful information.
383
-  $vars['menu_item'] = menu_get_item();
384
-  switch ($vars['menu_item']['page_callback']) {
382
+    // Store the menu item since it has some useful information.
383
+    $vars['menu_item'] = menu_get_item();
384
+    switch ($vars['menu_item']['page_callback']) {
385 385
     case 'views_page':
386 386
       // Is this a Views page?
387 387
       $vars['classes_array'][] = 'page-views';
388
-      break;
388
+        break;
389 389
     case 'page_manager_page_execute':
390 390
     case 'page_manager_node_view':
391 391
     case 'page_manager_contact_site':
392 392
       // Is this a Panels page?
393 393
       $vars['classes_array'][] = 'page-panels';
394
-      break;
395
-  }
394
+        break;
395
+    }
396 396
 }
397 397
 
398 398
 /**
@@ -404,17 +404,17 @@  discard block
 block discarded – undo
404 404
  *   The name of the template being rendered ("maintenance_page" in this case.)
405 405
  */
406 406
 function zen_preprocess_maintenance_page(&$vars, $hook) {
407
-  // If Zen is the maintenance theme, add some styles.
408
-  if ($GLOBALS['theme'] == 'zen') {
407
+    // If Zen is the maintenance theme, add some styles.
408
+    if ($GLOBALS['theme'] == 'zen') {
409 409
     include_once './' . _zen_path() . '/zen-internals/template.zen.inc';
410 410
     _zen_preprocess_page($vars, $hook);
411
-  }
412
-  // Add conditional stylesheets.
413
-  elseif (!module_exists('conditional_styles')) {
411
+    }
412
+    // Add conditional stylesheets.
413
+    elseif (!module_exists('conditional_styles')) {
414 414
     $language = $GLOBALS['language']->direction == LANGUAGE_RTL ? '_rtl' : '';
415 415
     $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'] . $language, '');
416 416
     $vars['styles'] .= $vars['conditional_styles'];
417
-  }
417
+    }
418 418
 }
419 419
 
420 420
 /**
@@ -426,67 +426,67 @@  discard block
 block discarded – undo
426 426
  *   The name of the template being rendered ("node" in this case.)
427 427
  */
428 428
 function zen_preprocess_node(&$vars, $hook) {
429
-  // Create the build_mode variable.
430
-  switch ($vars['node']->build_mode) {
429
+    // Create the build_mode variable.
430
+    switch ($vars['node']->build_mode) {
431 431
     case NODE_BUILD_NORMAL:
432 432
       if ($vars['node']->build_mode === NODE_BUILD_NORMAL) {
433 433
         $vars['build_mode'] = $vars['teaser'] ? 'teaser' : 'full';
434
-      }
435
-      else {
434
+        }
435
+        else {
436 436
         $vars['build_mode'] = $vars['node']->build_mode;
437
-      }
438
-      break;
437
+        }
438
+        break;
439 439
     case NODE_BUILD_PREVIEW:
440 440
       $vars['build_mode'] = 'preview';
441
-      break;
441
+        break;
442 442
     case NODE_BUILD_SEARCH_INDEX:
443 443
       $vars['build_mode'] = 'search_index';
444
-      break;
444
+        break;
445 445
     case NODE_BUILD_SEARCH_RESULT:
446 446
       $vars['build_mode'] = 'search_result';
447
-      break;
447
+        break;
448 448
     case NODE_BUILD_RSS:
449 449
       $vars['build_mode'] = 'rss';
450
-      break;
450
+        break;
451 451
     case NODE_BUILD_PRINT:
452 452
       $vars['build_mode'] = 'print';
453
-      break;
453
+        break;
454 454
     default:
455 455
       $vars['build_mode'] = $vars['node']->build_mode;
456
-  }
456
+    }
457 457
 
458
-  // Create the user_picture variable.
459
-  $vars['user_picture'] = $vars['picture'];
458
+    // Create the user_picture variable.
459
+    $vars['user_picture'] = $vars['picture'];
460 460
 
461
-  // Create the Drupal 7 $display_submitted variable.
462
-  $vars['display_submitted'] = theme_get_setting('toggle_node_info_' . $vars['node']->type);
461
+    // Create the Drupal 7 $display_submitted variable.
462
+    $vars['display_submitted'] = theme_get_setting('toggle_node_info_' . $vars['node']->type);
463 463
 
464
-  // Special classes for nodes.
465
-  // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc.
466
-  $vars['classes_array'][] = drupal_html_class('node-type-' . $vars['type']);
467
-  if ($vars['promote']) {
464
+    // Special classes for nodes.
465
+    // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc.
466
+    $vars['classes_array'][] = drupal_html_class('node-type-' . $vars['type']);
467
+    if ($vars['promote']) {
468 468
     $vars['classes_array'][] = 'node-promoted';
469
-  }
470
-  if ($vars['sticky']) {
469
+    }
470
+    if ($vars['sticky']) {
471 471
     $vars['classes_array'][] = 'node-sticky';
472
-  }
473
-  if (!$vars['status']) {
472
+    }
473
+    if (!$vars['status']) {
474 474
     $vars['classes_array'][] = 'node-unpublished';
475 475
     $vars['unpublished'] = TRUE;
476
-  }
477
-  else {
476
+    }
477
+    else {
478 478
     $vars['unpublished'] = FALSE;
479
-  }
480
-  if ($vars['uid'] && $vars['uid'] == $GLOBALS['user']->uid) {
479
+    }
480
+    if ($vars['uid'] && $vars['uid'] == $GLOBALS['user']->uid) {
481 481
     $vars['classes_array'][] = 'node-by-viewer'; // Node is authored by current user.
482
-  }
483
-  if ($vars['teaser']) {
482
+    }
483
+    if ($vars['teaser']) {
484 484
     $vars['classes_array'][] = 'node-teaser'; // Node is displayed as teaser.
485
-  }
486
-  if (isset($vars['preview'])) {
485
+    }
486
+    if (isset($vars['preview'])) {
487 487
     $vars['classes_array'][] = 'node-preview';
488
-  }
489
-  $vars['classes_array'][] = 'build-mode-' . $vars['build_mode'] ;
488
+    }
489
+    $vars['classes_array'][] = 'build-mode-' . $vars['build_mode'] ;
490 490
 }
491 491
 
492 492
 /**
@@ -498,8 +498,8 @@  discard block
 block discarded – undo
498 498
  *   The name of the template being rendered ("comment" in this case.)
499 499
  */
500 500
 function zen_preprocess_comment(&$vars, $hook) {
501
-  include_once './' . _zen_path() . '/zen-internals/template.comment.inc';
502
-  _zen_preprocess_comment($vars, $hook);
501
+    include_once './' . _zen_path() . '/zen-internals/template.comment.inc';
502
+    _zen_preprocess_comment($vars, $hook);
503 503
 }
504 504
 
505 505
 /**
@@ -511,18 +511,18 @@  discard block
 block discarded – undo
511 511
  * @see region.tpl.php
512 512
  */
513 513
 function zen_preprocess_region(&$vars, $hook) {
514
-  // Create the $content variable that templates expect.
515
-  $vars['content'] = $vars['elements']['#children'];
516
-  $vars['region'] = $vars['elements']['#region'];
514
+    // Create the $content variable that templates expect.
515
+    $vars['content'] = $vars['elements']['#children'];
516
+    $vars['region'] = $vars['elements']['#region'];
517 517
 
518
-  // Setup the default classes.
519
-  $vars['classes_array'] = array('region', 'region-' . str_replace('_', '-', $vars['region']));
518
+    // Setup the default classes.
519
+    $vars['classes_array'] = array('region', 'region-' . str_replace('_', '-', $vars['region']));
520 520
 
521
-  // Sidebar regions get a couple extra classes.
522
-  if (strpos($vars['region'], 'sidebar_') === 0) {
521
+    // Sidebar regions get a couple extra classes.
522
+    if (strpos($vars['region'], 'sidebar_') === 0) {
523 523
     $vars['classes_array'][] = 'column';
524 524
     $vars['classes_array'][] = 'sidebar';
525
-  }
525
+    }
526 526
 }
527 527
 
528 528
 /**
@@ -534,36 +534,36 @@  discard block
 block discarded – undo
534 534
  *   The name of the template being rendered ("block" in this case.)
535 535
  */
536 536
 function zen_preprocess_block(&$vars, $hook) {
537
-  $block = $vars['block'];
537
+    $block = $vars['block'];
538 538
 
539
-  // Drupal 7 uses a $content variable instead of $block->content.
540
-  $vars['content'] = $block->content;
541
-  // Drupal 7 should use a $title variable instead of $block->subject.
542
-  $vars['title'] = $block->subject;
539
+    // Drupal 7 uses a $content variable instead of $block->content.
540
+    $vars['content'] = $block->content;
541
+    // Drupal 7 should use a $title variable instead of $block->subject.
542
+    $vars['title'] = $block->subject;
543 543
 
544
-  // Special classes for blocks.
545
-  $vars['classes_array'][] = 'block-' . $block->module;
546
-  // Classes describing the position of the block within the region.
547
-  if ($vars['block_id'] == 1) {
544
+    // Special classes for blocks.
545
+    $vars['classes_array'][] = 'block-' . $block->module;
546
+    // Classes describing the position of the block within the region.
547
+    if ($vars['block_id'] == 1) {
548 548
     $vars['classes_array'][] = 'first';
549
-  }
550
-  if (!function_exists('context_blocks') && count(block_list($vars['block']->region)) == $vars['block_id']) {
549
+    }
550
+    if (!function_exists('context_blocks') && count(block_list($vars['block']->region)) == $vars['block_id']) {
551 551
     $vars['classes_array'][] = 'last';
552
-  }
553
-  $vars['classes_array'][] = 'region-' . $vars['block_zebra'];
554
-  $vars['classes_array'][] = $vars['zebra'];
555
-  $vars['classes_array'][] = 'region-count-' . $vars['block_id'];
556
-  $vars['classes_array'][] = 'count-' . $vars['id'];
552
+    }
553
+    $vars['classes_array'][] = 'region-' . $vars['block_zebra'];
554
+    $vars['classes_array'][] = $vars['zebra'];
555
+    $vars['classes_array'][] = 'region-count-' . $vars['block_id'];
556
+    $vars['classes_array'][] = 'count-' . $vars['id'];
557 557
 
558
-  // Create the block ID.
559
-  $vars['block_html_id'] = 'block-' . $block->module . '-' . $block->delta;
558
+    // Create the block ID.
559
+    $vars['block_html_id'] = 'block-' . $block->module . '-' . $block->delta;
560 560
 
561
-  $vars['edit_links_array'] = array();
562
-  if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) {
561
+    $vars['edit_links_array'] = array();
562
+    if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) {
563 563
     include_once './' . _zen_path() . '/zen-internals/template.block-editing.inc';
564 564
     zen_preprocess_block_editing($vars, $hook);
565 565
     $vars['classes_array'][] = 'with-block-editing';
566
-  }
566
+    }
567 567
 }
568 568
 
569 569
 /**
@@ -575,10 +575,10 @@  discard block
 block discarded – undo
575 575
  *   The name of the template being rendered.
576 576
  */
577 577
 function zen_process(&$vars, $hook) {
578
-  // Don't clobber Views 3 classes.
579
-  if (array_key_exists('classes_array', $vars) && !array_key_exists('classes', $vars)) {
578
+    // Don't clobber Views 3 classes.
579
+    if (array_key_exists('classes_array', $vars) && !array_key_exists('classes', $vars)) {
580 580
     $vars['classes'] = implode(' ', $vars['classes_array']);
581
-  }
581
+    }
582 582
 }
583 583
 
584 584
 /**
@@ -590,22 +590,22 @@  discard block
 block discarded – undo
590 590
  *   The name of the template being rendered ("block" in this case.)
591 591
  */
592 592
 function zen_process_block(&$vars, $hook) {
593
-  $vars['edit_links'] = !empty($vars['edit_links_array']) ? '<div class="edit">' . implode(' ', $vars['edit_links_array']) . '</div>' : '';
593
+    $vars['edit_links'] = !empty($vars['edit_links_array']) ? '<div class="edit">' . implode(' ', $vars['edit_links_array']) . '</div>' : '';
594 594
 }
595 595
 
596 596
 if (!function_exists('drupal_html_class')) {
597
-  /**
598
-   * Prepare a string for use as a valid class name.
599
-   *
600
-   * Do not pass one string containing multiple classes as they will be
601
-   * incorrectly concatenated with dashes, i.e. "one two" will become "one-two".
602
-   *
603
-   * @param $class
604
-   *   The class name to clean.
605
-   * @return
606
-   *   The cleaned class name.
607
-   */
608
-  function drupal_html_class($class) {
597
+    /**
598
+     * Prepare a string for use as a valid class name.
599
+     *
600
+     * Do not pass one string containing multiple classes as they will be
601
+     * incorrectly concatenated with dashes, i.e. "one two" will become "one-two".
602
+     *
603
+     * @param $class
604
+     *   The class name to clean.
605
+     * @return
606
+     *   The cleaned class name.
607
+     */
608
+    function drupal_html_class($class) {
609 609
     // By default, we filter using Drupal's coding standards.
610 610
     $class = strtr(drupal_strtolower($class), array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''));
611 611
 
@@ -623,19 +623,19 @@  discard block
 block discarded – undo
623 623
     $class = preg_replace('/[^\x{002D}\x{0030}-\x{0039}\x{0041}-\x{005A}\x{005F}\x{0061}-\x{007A}\x{00A1}-\x{FFFF}]/u', '', $class);
624 624
 
625 625
     return $class;
626
-  }
626
+    }
627 627
 } /* End of drupal_html_class conditional definition. */
628 628
 
629 629
 if (!function_exists('drupal_html_id')) {
630
-  /**
631
-   * Prepare a string for use as a valid HTML ID and guarantee uniqueness.
632
-   *
633
-   * @param $id
634
-   *   The ID to clean.
635
-   * @return
636
-   *   The cleaned ID.
637
-   */
638
-  function drupal_html_id($id) {
630
+    /**
631
+     * Prepare a string for use as a valid HTML ID and guarantee uniqueness.
632
+     *
633
+     * @param $id
634
+     *   The ID to clean.
635
+     * @return
636
+     *   The cleaned ID.
637
+     */
638
+    function drupal_html_id($id) {
639 639
     $id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
640 640
 
641 641
     // As defined in http://www.w3.org/TR/html4/types.html#type-name, HTML IDs can
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
     $id = preg_replace('/[^A-Za-z0-9\-_]/', '', $id);
648 648
 
649 649
     return $id;
650
-  }
650
+    }
651 651
 } /* End of drupal_html_id conditional definition. */
652 652
 
653 653
 /**
@@ -657,12 +657,12 @@  discard block
 block discarded – undo
657 657
  * replace _zen_path() with drupal_get_path('theme', 'zen').
658 658
  */
659 659
 function _zen_path() {
660
-  static $path = FALSE;
661
-  if (!$path) {
660
+    static $path = FALSE;
661
+    if (!$path) {
662 662
     $matches = drupal_system_listing('zen\.info$', 'themes', 'name', 0);
663 663
     if (!empty($matches['zen']->filename)) {
664
-      $path = dirname($matches['zen']->filename);
664
+        $path = dirname($matches['zen']->filename);
665
+    }
665 666
     }
666
-  }
667
-  return $path;
667
+    return $path;
668 668
 }
Please login to merge, or discard this patch.
drupal/sites/all/themes/zen/theme-settings.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -15,51 +15,51 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function zen_settings($saved_settings, $subtheme_defaults = array()) {
17 17
 
18
-  // Add the form's CSS
19
-  drupal_add_css(drupal_get_path('theme', 'zen') . '/zen-internals/css/theme-settings.css', 'theme');
18
+    // Add the form's CSS
19
+    drupal_add_css(drupal_get_path('theme', 'zen') . '/zen-internals/css/theme-settings.css', 'theme');
20 20
 
21
-  // Add javascript to show/hide optional settings
22
-  drupal_add_js(drupal_get_path('theme', 'zen') . '/zen-internals/js/theme-settings.js', 'theme');
21
+    // Add javascript to show/hide optional settings
22
+    drupal_add_js(drupal_get_path('theme', 'zen') . '/zen-internals/js/theme-settings.js', 'theme');
23 23
 
24
-  // Get the default values from the .info file.
25
-  $defaults = zen_theme_get_default_settings('zen');
24
+    // Get the default values from the .info file.
25
+    $defaults = zen_theme_get_default_settings('zen');
26 26
 
27
-  // Allow a subtheme to override the default values.
28
-  $defaults = array_merge($defaults, $subtheme_defaults);
27
+    // Allow a subtheme to override the default values.
28
+    $defaults = array_merge($defaults, $subtheme_defaults);
29 29
 
30
-  // Merge the saved variables and their default values.
31
-  $settings = array_merge($defaults, $saved_settings);
30
+    // Merge the saved variables and their default values.
31
+    $settings = array_merge($defaults, $saved_settings);
32 32
 
33
-  /*
33
+    /*
34 34
    * Create the form using Forms API
35 35
    */
36
-  $form['zen-div-opening'] = array(
36
+    $form['zen-div-opening'] = array(
37 37
     '#value'         => '<div id="zen-settings">',
38
-  );
38
+    );
39 39
 
40
-  $form['zen_block_editing'] = array(
40
+    $form['zen_block_editing'] = array(
41 41
     '#type'          => 'checkbox',
42 42
     '#title'         => t('Show block editing on hover'),
43 43
     '#description'   => t('When hovering over a block, privileged users will see block editing links.'),
44 44
     '#default_value' => $settings['zen_block_editing'],
45
-  );
45
+    );
46 46
 
47
-  $form['breadcrumb'] = array(
47
+    $form['breadcrumb'] = array(
48 48
     '#type'          => 'fieldset',
49 49
     '#title'         => t('Breadcrumb settings'),
50 50
     '#attributes'    => array('id' => 'zen-breadcrumb'),
51
-  );
52
-  $form['breadcrumb']['zen_breadcrumb'] = array(
51
+    );
52
+    $form['breadcrumb']['zen_breadcrumb'] = array(
53 53
     '#type'          => 'select',
54 54
     '#title'         => t('Display breadcrumb'),
55 55
     '#default_value' => $settings['zen_breadcrumb'],
56 56
     '#options'       => array(
57
-                          'yes'   => t('Yes'),
58
-                          'admin' => t('Only in admin section'),
59
-                          'no'    => t('No'),
57
+                            'yes'   => t('Yes'),
58
+                            'admin' => t('Only in admin section'),
59
+                            'no'    => t('No'),
60 60
                         ),
61
-  );
62
-  $form['breadcrumb']['zen_breadcrumb_separator'] = array(
61
+    );
62
+    $form['breadcrumb']['zen_breadcrumb_separator'] = array(
63 63
     '#type'          => 'textfield',
64 64
     '#title'         => t('Breadcrumb separator'),
65 65
     '#description'   => t('Text only. Don’t forget to include spaces.'),
@@ -67,61 +67,61 @@  discard block
 block discarded – undo
67 67
     '#size'          => 5,
68 68
     '#maxlength'     => 10,
69 69
     '#prefix'        => '<div id="div-zen-breadcrumb-collapse">', // jquery hook to show/hide optional widgets
70
-  );
71
-  $form['breadcrumb']['zen_breadcrumb_home'] = array(
70
+    );
71
+    $form['breadcrumb']['zen_breadcrumb_home'] = array(
72 72
     '#type'          => 'checkbox',
73 73
     '#title'         => t('Show home page link in breadcrumb'),
74 74
     '#default_value' => $settings['zen_breadcrumb_home'],
75
-  );
76
-  $form['breadcrumb']['zen_breadcrumb_trailing'] = array(
75
+    );
76
+    $form['breadcrumb']['zen_breadcrumb_trailing'] = array(
77 77
     '#type'          => 'checkbox',
78 78
     '#title'         => t('Append a separator to the end of the breadcrumb'),
79 79
     '#default_value' => $settings['zen_breadcrumb_trailing'],
80 80
     '#description'   => t('Useful when the breadcrumb is placed just before the title.'),
81
-  );
82
-  $form['breadcrumb']['zen_breadcrumb_title'] = array(
81
+    );
82
+    $form['breadcrumb']['zen_breadcrumb_title'] = array(
83 83
     '#type'          => 'checkbox',
84 84
     '#title'         => t('Append the content title to the end of the breadcrumb'),
85 85
     '#default_value' => $settings['zen_breadcrumb_title'],
86 86
     '#description'   => t('Useful when the breadcrumb is not placed just before the title.'),
87 87
     '#suffix'        => '</div>', // #div-zen-breadcrumb
88
-  );
88
+    );
89 89
 
90
-  $form['themedev'] = array(
90
+    $form['themedev'] = array(
91 91
     '#type'          => 'fieldset',
92 92
     '#title'         => t('Theme development settings'),
93 93
     '#attributes'    => array('id' => 'zen-themedev'),
94
-  );
95
-  $form['themedev']['zen_rebuild_registry'] = array(
94
+    );
95
+    $form['themedev']['zen_rebuild_registry'] = array(
96 96
     '#type'          => 'checkbox',
97 97
     '#title'         => t('Rebuild theme registry on every page.'),
98 98
     '#default_value' => $settings['zen_rebuild_registry'],
99 99
     '#description'   => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')),
100 100
     '#prefix'        => '<div id="div-zen-registry"><strong>' . t('Theme registry:') . '</strong>',
101 101
     '#suffix'        => '</div>',
102
-  );
103
-  $form['themedev']['zen_layout'] = array(
102
+    );
103
+    $form['themedev']['zen_layout'] = array(
104 104
     '#type'          => 'radios',
105 105
     '#title'         => t('Layout method'),
106 106
     '#options'       => array(
107
-                          'zen-columns-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>',
108
-                          'zen-columns-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>',
107
+                            'zen-columns-liquid' => t('Liquid layout') . ' <small>(layout-liquid.css)</small>',
108
+                            'zen-columns-fixed' => t('Fixed layout') . ' <small>(layout-fixed.css)</small>',
109 109
                         ),
110 110
     '#default_value' => $settings['zen_layout'],
111
-  );
112
-  $form['themedev']['zen_wireframes'] = array(
111
+    );
112
+    $form['themedev']['zen_wireframes'] = array(
113 113
     '#type'          => 'checkbox',
114 114
     '#title'         => t('Display borders around main layout elements'),
115 115
     '#default_value' => $settings['zen_wireframes'],
116 116
     '#description'   => t('<a href="!link">Wireframes</a> are useful when prototyping a website.', array('!link' => 'http://www.boxesandarrows.com/view/html_wireframes_and_prototypes_all_gain_and_no_pain')),
117 117
     '#prefix'        => '<div id="div-zen-wireframes"><strong>' . t('Wireframes:') . '</strong>',
118 118
     '#suffix'        => '</div>',
119
-  );
119
+    );
120 120
 
121
-  $form['zen-div-closing'] = array(
121
+    $form['zen-div-closing'] = array(
122 122
     '#value'         => '</div>',
123
-  );
123
+    );
124 124
 
125
-  // Return the form
126
-  return $form;
125
+    // Return the form
126
+    return $form;
127 127
 }
Please login to merge, or discard this patch.
drupal/sites/all/themes/zen/STARTERKIT/template.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -65,13 +65,13 @@
 block discarded – undo
65 65
  * Implementation of HOOK_theme().
66 66
  */
67 67
 function STARTERKIT_theme(&$existing, $type, $theme, $path) {
68
-  $hooks = zen_theme($existing, $type, $theme, $path);
69
-  // Add your theme hooks like this:
70
-  /*
68
+    $hooks = zen_theme($existing, $type, $theme, $path);
69
+    // Add your theme hooks like this:
70
+    /*
71 71
   $hooks['hook_name_here'] = array( // Details go here );
72 72
   */
73
-  // @TODO: Needs detailed comments. Patches welcome!
74
-  return $hooks;
73
+    // @TODO: Needs detailed comments. Patches welcome!
74
+    return $hooks;
75 75
 }
76 76
 
77 77
 /**
Please login to merge, or discard this patch.
drupal/sites/all/themes/zen/STARTERKIT/theme-settings.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -13,17 +13,17 @@  discard block
 block discarded – undo
13 13
  */
14 14
 function STARTERKIT_settings($saved_settings) {
15 15
 
16
-  // Get the default values from the .info file.
17
-  $defaults = zen_theme_get_default_settings('STARTERKIT');
16
+    // Get the default values from the .info file.
17
+    $defaults = zen_theme_get_default_settings('STARTERKIT');
18 18
 
19
-  // Merge the saved variables and their default values.
20
-  $settings = array_merge($defaults, $saved_settings);
19
+    // Merge the saved variables and their default values.
20
+    $settings = array_merge($defaults, $saved_settings);
21 21
 
22
-  /*
22
+    /*
23 23
    * Create the form using Forms API: http://api.drupal.org/api/6
24 24
    */
25
-  $form = array();
26
-  /* -- Delete this line if you want to use this setting
25
+    $form = array();
26
+    /* -- Delete this line if you want to use this setting
27 27
   $form['STARTERKIT_example'] = array(
28 28
     '#type'          => 'checkbox',
29 29
     '#title'         => t('Use this sample setting'),
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
   );
33 33
   // */
34 34
 
35
-  // Add the base theme's settings.
36
-  $form += zen_settings($saved_settings, $defaults);
35
+    // Add the base theme's settings.
36
+    $form += zen_settings($saved_settings, $defaults);
37 37
 
38
-  // Remove some of the base theme's settings.
39
-  unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet.
38
+    // Remove some of the base theme's settings.
39
+    unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet.
40 40
 
41
-  // Return the form
42
-  return $form;
41
+    // Return the form
42
+    return $form;
43 43
 }
Please login to merge, or discard this patch.
html/user/lammps.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     $ppid=$pstatus['pid'];
36 36
     $ret=`ps -o pid --no-heading --ppid $ppid`;
37 37
     //echo "parent pid is $ppid\nterninate it\n";
38
-     proc_terminate($p);
38
+        proc_terminate($p);
39 39
     // echo "child process is $ret\n";
40 40
     $pids=preg_split('/\s+/',$ret);
41 41
     foreach($pids as $pid){
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
     while (1) {
62 62
         $ctime=time();
63 63
         if($ctime-$stime >=2 and ! file_exists("log.1")){
64
-           if($GLOBALS["debug"]) echo "time out "."<br>";
65
-           terminate_job($p);
66
-           break;
64
+            if($GLOBALS["debug"]) echo "time out "."<br>";
65
+            terminate_job($p);
66
+            break;
67 67
         } 
68 68
         if (file_exists("log.1")) {
69 69
             list($avg_cpu, $test_steps) = calc_step_cpu("log.1");
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     }
113 113
     fclose($fd);
114 114
     //$total_steps = $loopno*$looprun;
115
-     if($GLOBALS["debug"])print "total_steps = ".$total_steps."<br>";
115
+        if($GLOBALS["debug"])print "total_steps = ".$total_steps."<br>";
116 116
     return $total_steps;
117 117
 }
118 118
 
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
         $cpu = (float)$arr[2];
148 148
         //echo "step=".$step." cpu=".$cpu."\n";
149 149
         if ($cpu==0) {
150
-           $count=0;
151
-           $start_step = $step;
150
+            $count=0;
151
+            $start_step = $step;
152 152
         } else {
153 153
             $count+=1;
154 154
             if($GLOBALS["debug"])echo "step=".$step." cpu=".$cpu."count=".$count."<br>";
155
-           if($count >= 10) {
155
+            if($count >= 10) {
156 156
                 $end_step = $step;
157 157
                 $steps = $end_step-$start_step;
158 158
                 $avg_cpu = $cpu/$steps;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         
184 184
         if(preg_match("/^\s*dump\s+(\d)\s+/", $line,$matches))
185 185
         {        
186
-             if($GLOBALS["debug"]){print "matches=";print_r($matches);}
186
+                if($GLOBALS["debug"]){print "matches=";print_r($matches);}
187 187
 
188 188
             $dump_types=(int)$matches[1];
189 189
             break;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         echo "can not open file $cmd_file\n";
199 199
         exit(-1);
200 200
     }
201
-     if($GLOBALS["debug"]) print "structure_file_size=".$structure_file_size."<br>";
201
+        if($GLOBALS["debug"]) print "structure_file_size=".$structure_file_size."<br>";
202 202
    
203 203
     $loopno=1;
204 204
     $looprun=1;
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
     }
217 217
     fclose($fd);
218 218
     if($GLOBALS["debug"]){
219
-         print "max loopno(number of loops to run)=".$loopno."<br>";
220
-         print "max looprun(steps for each loop)=".$looprun."<br>";
219
+            print "max loopno(number of loops to run)=".$loopno."<br>";
220
+            print "max looprun(steps for each loop)=".$looprun."<br>";
221 221
     }
222 222
     //$est_size = $loopno*$structure_file_size*0.8*$dump_types;
223 223
     $test_log_size = filesize("log.1");
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
             <br>Please refer to the following Error Message:<br><p>
369 369
         ";
370 370
         foreach($err_msgs as $line){
371
-             $err=$err.$line."<br>";
371
+                $err=$err.$line."<br>";
372 372
         }
373 373
         $err=$err." <p>
374 374
             <a href=sandbox.php><strong> File_Sandbox </strong></a>
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     //
394 394
     $njobs = count(file($cmdline_file_path));
395 395
     $secs_est = estimated_makespan($njobs, $info->rsc_fpops_est);
396
-     if($GLOBALS["debug"])echo "secs_est is $secs_est\n";
396
+        if($GLOBALS["debug"])echo "secs_est is $secs_est\n";
397 397
     //assume the server's flops is 1.5G and the average client's flops is 1G
398 398
     $hrs_est = number_format($secs_est*1.5/60, 2);
399 399
     //$hrs_est = number_format($secs_est, 2);
Please login to merge, or discard this patch.
html/user/get_project_config.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,11 +77,11 @@
 block discarded – undo
77 77
 }
78 78
 
79 79
 if ($disable_account_creation || defined('INVITE_CODES')) {
80
-	echo "    <account_creation_disabled/>\n";
80
+    echo "    <account_creation_disabled/>\n";
81 81
 }
82 82
 
83 83
 if (defined('INVITE_CODES')) {
84
-	echo "    <invite_code_required/>\n";
84
+    echo "    <invite_code_required/>\n";
85 85
 }
86 86
 
87 87
 echo "    <min_passwd_length>$min_passwd_length</min_passwd_length>\n";
Please login to merge, or discard this patch.
html/user/friend.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
     $friend = BoincFriend::lookup($srcid, $user->id);
139 139
     if (!$friend) error_page("Request not found");
140 140
     page_head(tra("Friend request"));
141
-	echo time_str($friend->create_time)."<p>\n";
141
+    echo time_str($friend->create_time)."<p>\n";
142 142
     $x = user_links($srcuser, BADGE_HEIGHT_MEDIUM);
143 143
     echo tra("%1 has requested friendship with you.", $x);
144 144
     if (strlen($friend->message)) {
Please login to merge, or discard this patch.
html/user/tree_threader.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
     global $app_name,$log;
32 32
 
33 33
     $timestamp = date("Y-m-d H:i",time());
34
-	// read the list of template filenames
35
-	//
36
-	$files = file("../../tree_threader_template_files");
37
-	if ($files === false) { 
34
+    // read the list of template filenames
35
+    //
36
+    $files = file("../../tree_threader_template_files");
37
+    if ($files === false) { 
38 38
         fwrite($log,"$timestamp\ttemplate file tree_threader_template_files\n");
39 39
         error("no templates file");
40 40
         
41 41
     }
42
-	$njobs = sizeof($files);
43
-	$now = time();
42
+    $njobs = sizeof($files);
43
+    $now = time();
44 44
     $batch_id = BoincBatch::insert(
45
-		"(user_id, create_time, njobs, name, app_id, state) values ($user->id, $now, $njobs, 'tree_threader batch', $app->id, ".BATCH_STATE_IN_PROGRESS.")"
45
+        "(user_id, create_time, njobs, name, app_id, state) values ($user->id, $now, $njobs, 'tree_threader batch', $app->id, ".BATCH_STATE_IN_PROGRESS.")"
46 46
     );
47 47
     if (!$batch_id) {
48 48
         $log_msg = "$timestamp\tfailed to create batch for user $user->id\n";
@@ -68,20 +68,20 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     $i = 1;
71
-	foreach ($files as $file) {
71
+    foreach ($files as $file) {
72 72
         $file = trim($file);
73 73
         $wu_name = "ICT_".$batch_id."_$i";
74 74
 
75
-		$cmd = "cd ../..; ./bin/create_work --appname $app_name --batch $batch_id --wu_name $wu_name --wu_template templates/ICT_in --result_template templates/ICT_out $seq_fname $file";
75
+        $cmd = "cd ../..; ./bin/create_work --appname $app_name --batch $batch_id --wu_name $wu_name --wu_template templates/ICT_in --result_template templates/ICT_out $seq_fname $file";
76 76
         fwrite($log, "$timestamp\t$cmd\n");
77 77
         system($cmd, $ret);
78
-		if ($ret != 0) {
78
+        if ($ret != 0) {
79 79
             fwrite($log, "can not creat job $wu_name\n");
80
-			error("can't create job");
80
+            error("can't create job");
81 81
         }
82 82
         $i++;
83
-	}
84
-	echo "<tt_reply>\n<batch_id>$batch_id</batch_id>\n</tt_reply>\n";
83
+    }
84
+    echo "<tt_reply>\n<batch_id>$batch_id</batch_id>\n</tt_reply>\n";
85 85
 }
86 86
 
87 87
 // Enumerate all the successfully completed WUs for this batch.
@@ -93,51 +93,51 @@  discard block
 block discarded – undo
93 93
 function handle_get_output($r, $batch) {
94 94
     global $log;
95 95
     $timestamp = date("Y-m-d H:i",time());
96
-	$wus = BoincWorkUnit::enum("batch=$batch->id");
97
-	$outdir = "/tmp/treeThreader_result_".$batch->id;
96
+    $wus = BoincWorkUnit::enum("batch=$batch->id");
97
+    $outdir = "/tmp/treeThreader_result_".$batch->id;
98 98
     @mkdir($outdir);
99
-	foreach ($wus as $wu) {
100
-		if (!$wu->canonical_resultid) continue;
101
-		$result = BoincResult::lookup_id($wu->canonical_resultid);
102
-		if (!$result) continue;
103
-		$paths = get_outfile_paths($result);
104
-		if (sizeof($paths) < 1) continue;
105
-
106
-		// there's only one output file
107
-		//
108
-		$path = $paths[0];
109
-
110
-		// unzip it into a directory in /tmp
111
-		//
112
-		$dir = "/tmp/$wu->name";
99
+    foreach ($wus as $wu) {
100
+        if (!$wu->canonical_resultid) continue;
101
+        $result = BoincResult::lookup_id($wu->canonical_resultid);
102
+        if (!$result) continue;
103
+        $paths = get_outfile_paths($result);
104
+        if (sizeof($paths) < 1) continue;
105
+
106
+        // there's only one output file
107
+        //
108
+        $path = $paths[0];
109
+
110
+        // unzip it into a directory in /tmp
111
+        //
112
+        $dir = "/tmp/$wu->name";
113 113
         @mkdir($dir);
114
-		$cmd = "cd $dir; unzip -q $path";
115
-		system($cmd, $ret);
116
-		if ($ret != 0) {
117
-			error("can't unzip output file");
118
-		}
119
-		$cmd = "cp $dir/Aln/* $outdir";
120
-		system($cmd, $ret);
121
-		if ($ret != 0) {
122
-			error("can't copy output files");
123
-		}
114
+        $cmd = "cd $dir; unzip -q $path";
115
+        system($cmd, $ret);
116
+        if ($ret != 0) {
117
+            error("can't unzip output file");
118
+        }
119
+        $cmd = "cp $dir/Aln/* $outdir";
120
+        system($cmd, $ret);
121
+        if ($ret != 0) {
122
+            error("can't copy output files");
123
+        }
124 124
 
125 125
         system("rm -rf $dir");
126
-	}
127
-
128
-	$cmd = "zip -r -q $outdir $outdir";
129
-	system($cmd, $ret);
130
-	if ($ret != $ret) {
131
-		error("can't zip output files");
132
-	}
133
-	$fname = "treeThreader_result_".$batch->id.".zip";
126
+    }
127
+
128
+    $cmd = "zip -r -q $outdir $outdir";
129
+    system($cmd, $ret);
130
+    if ($ret != $ret) {
131
+        error("can't zip output files");
132
+    }
133
+    $fname = "treeThreader_result_".$batch->id.".zip";
134 134
     $treeThreader_dir="treeThreaderResult";
135 135
     if(!is_dir("../../download/$treeThreader_dir"))mkdir("../../download/$treeThreader_dir");
136
-	@symlink("/tmp/$fname", "../../download/$treeThreader_dir/$fname");
136
+    @symlink("/tmp/$fname", "../../download/$treeThreader_dir/$fname");
137 137
     system("rm -fr $outdir");
138 138
     $config = simplexml_load_string(file_get_contents("../../config.xml"));
139 139
     $download_url = trim((string)$config->config->download_url);
140
-	echo "<tt_reply>\n<url>$download_url/$treeThreader_dir/$fname</url>\n</tt_reply>\n";
140
+    echo "<tt_reply>\n<url>$download_url/$treeThreader_dir/$fname</url>\n</tt_reply>\n";
141 141
     $log_msg="$timestamp\tuser $batch->user_id downloads results for batch $batch->id : $download_url/$treeThreader_dir/$fname\n";
142 142
     fwrite($log, $log_msg);
143 143
 }
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
         handle_submit($r, $user, $app);
178 178
         break;
179 179
     case 'get_output':
180
-		$batch_id = (int)$r->batch_id;
181
-		$batch = BoincBatch::lookup_id($batch_id);
182
-		if (!$batch) error("no such batch");
183
-		if ($batch->user_id != $user->id) error("not owner of batch");
184
-		handle_get_output($r, $batch);
185
-		break;
180
+        $batch_id = (int)$r->batch_id;
181
+        $batch = BoincBatch::lookup_id($batch_id);
182
+        if (!$batch) error("no such batch");
183
+        if ($batch->user_id != $user->id) error("not owner of batch");
184
+        handle_get_output($r, $batch);
185
+        break;
186 186
     default: error("bad command");
187 187
 }
188 188
 
Please login to merge, or discard this patch.