Completed
Pull Request — master (#1821)
by Christian
15:34 queued 05:15
created
default/boinc/modules/contrib/views/plugins/views_plugin_display_page.inc 1 patch
Switch Indentation   +228 added lines, -228 removed lines patch added patch discarded remove patch
@@ -100,21 +100,21 @@  discard block
 block discarded – undo
100 100
       }
101 101
 
102 102
       switch ($menu['type']) {
103
-        case 'none':
104
-        default:
105
-          $items[$path]['type'] = MENU_CALLBACK;
106
-          break;
107
-        case 'normal':
108
-          $items[$path]['type'] = MENU_NORMAL_ITEM;
109
-          // Insert item into the proper menu
110
-          $items[$path]['menu_name'] = $menu['name'];
111
-          break;
112
-        case 'tab':
113
-          $items[$path]['type'] = MENU_LOCAL_TASK;
114
-          break;
115
-        case 'default tab':
116
-          $items[$path]['type'] = MENU_DEFAULT_LOCAL_TASK;
117
-          break;
103
+      case 'none':
104
+      default:
105
+        $items[$path]['type'] = MENU_CALLBACK;
106
+        break;
107
+      case 'normal':
108
+        $items[$path]['type'] = MENU_NORMAL_ITEM;
109
+        // Insert item into the proper menu
110
+        $items[$path]['menu_name'] = $menu['name'];
111
+        break;
112
+      case 'tab':
113
+        $items[$path]['type'] = MENU_LOCAL_TASK;
114
+        break;
115
+      case 'default tab':
116
+        $items[$path]['type'] = MENU_DEFAULT_LOCAL_TASK;
117
+        break;
118 118
       }
119 119
 
120 120
       // If this is a 'default' tab, check to see if we have to create teh
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
               'menu_name' => $tab_options['name'],
145 145
             );
146 146
             switch ($tab_options['type']) {
147
-              default:
148
-              case 'normal':
149
-                $items[$default_path]['type'] = MENU_NORMAL_ITEM;
150
-                break;
151
-              case 'tab':
152
-                $items[$default_path]['type'] = MENU_LOCAL_TASK;
153
-                break;
147
+            default:
148
+            case 'normal':
149
+              $items[$default_path]['type'] = MENU_NORMAL_ITEM;
150
+              break;
151
+            case 'tab':
152
+              $items[$default_path]['type'] = MENU_LOCAL_TASK;
153
+              break;
154 154
             }
155 155
             if (isset($tab_options['weight'])) {
156 156
               $items[$default_path]['weight'] = intval($tab_options['weight']);
@@ -221,17 +221,17 @@  discard block
 block discarded – undo
221 221
       $menu = array('type' => 'none');
222 222
     }
223 223
     switch($menu['type']) {
224
-      case 'none':
225
-      default:
226
-        $menu_str = t('No menu');
227
-        break;
228
-      case 'normal':
229
-        $menu_str = t('Normal: @title', array('@title' => $menu['title']));
230
-        break;
231
-      case 'tab':
232
-      case 'default tab':
233
-        $menu_str = t('Tab: @title', array('@title' => $menu['title']));
234
-        break;
224
+    case 'none':
225
+    default:
226
+      $menu_str = t('No menu');
227
+      break;
228
+    case 'normal':
229
+      $menu_str = t('Normal: @title', array('@title' => $menu['title']));
230
+      break;
231
+    case 'tab':
232
+    case 'default tab':
233
+      $menu_str = t('Tab: @title', array('@title' => $menu['title']));
234
+      break;
235 235
     }
236 236
 
237 237
     if (strlen($menu_str) > 16) {
@@ -258,176 +258,176 @@  discard block
 block discarded – undo
258 258
     parent::options_form($form, $form_state);
259 259
 
260 260
     switch ($form_state['section']) {
261
-      case 'path':
262
-        $form['#title'] .= t('The menu path or URL of this view');
263
-        $form['#help_topic'] = 'path';
264
-        $form['path'] = array(
265
-          '#type' => 'textfield',
266
-          '#description' => t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for arguments: For example, "node/%/feed".'),
267
-          '#default_value' => $this->get_option('path'),
261
+    case 'path':
262
+      $form['#title'] .= t('The menu path or URL of this view');
263
+      $form['#help_topic'] = 'path';
264
+      $form['path'] = array(
265
+        '#type' => 'textfield',
266
+        '#description' => t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for arguments: For example, "node/%/feed".'),
267
+        '#default_value' => $this->get_option('path'),
268 268
 	  '#field_prefix' => '<span dir="ltr">' . url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
269 269
 	  '#field_suffix' => '</span>&lrm;',
270 270
 	  '#attributes' => array('dir'=>'ltr'),
271
-        );
272
-        break;
273
-      case 'menu':
274
-        $form['#title'] .= t('Menu item entry');
275
-        $form['#help_topic'] = 'menu';
276
-        $form['menu'] = array(
277
-          '#prefix' => '<div class="clear-block">',
278
-          '#suffix' => '</div>',
279
-          '#tree' => TRUE,
280
-        );
281
-        $menu = $this->get_option('menu');
282
-        if (empty($menu)) {
283
-          $menu = array('type' => 'none', 'title' => '', 'weight' => 0);
284
-        }
285
-        $form['menu']['type'] = array(
286
-          '#prefix' => '<div class="views-left-30">',
287
-          '#suffix' => '</div>',
288
-          '#title' => t('Type'),
289
-          '#type' => 'radios',
290
-          '#options' => array(
291
-            'none' => t('No menu entry'),
292
-            'normal' => t('Normal menu entry'),
293
-            'tab' => t('Menu tab'),
294
-            'default tab' => t('Default menu tab')
295
-          ),
296
-          '#default_value' => $menu['type'],
297
-        );
298
-        $form['menu']['title'] = array(
299
-          '#prefix' => '<div class="views-left-50">',
300
-          '#title' => t('Title'),
301
-          '#type' => 'textfield',
302
-          '#default_value' => $menu['title'],
303
-          '#description' => t('If set to normal or tab, enter the text to use for the menu item.'),
304
-          '#process' => array('views_process_dependency'),
305
-          '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
306
-        );
307
-        $form['menu']['description'] = array(
308
-          '#title' => t('Description'),
309
-          '#type' => 'textfield',
310
-          '#default_value' => $menu['description'],
311
-          '#description' => t("If set to normal or tab, enter the text to use for the menu item's description."),
312
-          '#process' => array('views_process_dependency'),
313
-          '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
314
-        );
315
-        $form['menu']['name-warning'] = array(
316
-          '#type' => 'markup',
317
-          '#prefix' => '<div class="warning">',
318
-          '#value' => t("Warning: Changing this item's menu will not work reliably in Drupal 6.4 or earlier. Please upgrade your copy of Drupal at !url.", array('!url' => l('drupal.org', 'http://drupal.org/project/Drupal+project'))),
319
-          '#suffix' => '</div>',
271
+      );
272
+      break;
273
+    case 'menu':
274
+      $form['#title'] .= t('Menu item entry');
275
+      $form['#help_topic'] = 'menu';
276
+      $form['menu'] = array(
277
+        '#prefix' => '<div class="clear-block">',
278
+        '#suffix' => '</div>',
279
+        '#tree' => TRUE,
280
+      );
281
+      $menu = $this->get_option('menu');
282
+      if (empty($menu)) {
283
+        $menu = array('type' => 'none', 'title' => '', 'weight' => 0);
284
+      }
285
+      $form['menu']['type'] = array(
286
+        '#prefix' => '<div class="views-left-30">',
287
+        '#suffix' => '</div>',
288
+        '#title' => t('Type'),
289
+        '#type' => 'radios',
290
+        '#options' => array(
291
+          'none' => t('No menu entry'),
292
+          'normal' => t('Normal menu entry'),
293
+          'tab' => t('Menu tab'),
294
+          'default tab' => t('Default menu tab')
295
+        ),
296
+        '#default_value' => $menu['type'],
297
+      );
298
+      $form['menu']['title'] = array(
299
+        '#prefix' => '<div class="views-left-50">',
300
+        '#title' => t('Title'),
301
+        '#type' => 'textfield',
302
+        '#default_value' => $menu['title'],
303
+        '#description' => t('If set to normal or tab, enter the text to use for the menu item.'),
304
+        '#process' => array('views_process_dependency'),
305
+        '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
306
+      );
307
+      $form['menu']['description'] = array(
308
+        '#title' => t('Description'),
309
+        '#type' => 'textfield',
310
+        '#default_value' => $menu['description'],
311
+        '#description' => t("If set to normal or tab, enter the text to use for the menu item's description."),
312
+        '#process' => array('views_process_dependency'),
313
+        '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
314
+      );
315
+      $form['menu']['name-warning'] = array(
316
+        '#type' => 'markup',
317
+        '#prefix' => '<div class="warning">',
318
+        '#value' => t("Warning: Changing this item's menu will not work reliably in Drupal 6.4 or earlier. Please upgrade your copy of Drupal at !url.", array('!url' => l('drupal.org', 'http://drupal.org/project/Drupal+project'))),
319
+        '#suffix' => '</div>',
320
+        '#process' => array('views_process_dependency'),
321
+        '#dependency' => array('radio:menu[type]' => array('normal')),
322
+        '#access' => version_compare(VERSION, '6.5', '<'),
323
+      );
324
+
325
+      // Only display the menu selector if menu module is enabled.
326
+      if (module_exists('menu')) {
327
+        $form['menu']['name'] = array(
328
+          '#title' => t('Menu'),
329
+          '#type' => 'select',
330
+          '#options' => menu_get_menus(),
331
+          '#default_value' => $menu['name'],
332
+          '#description' => t('Insert item into an available menu.'), //
320 333
           '#process' => array('views_process_dependency'),
321 334
           '#dependency' => array('radio:menu[type]' => array('normal')),
322
-          '#access' => version_compare(VERSION, '6.5', '<'),
323 335
         );
324
-
325
-        // Only display the menu selector if menu module is enabled.
326
-        if (module_exists('menu')) {
327
-          $form['menu']['name'] = array(
328
-            '#title' => t('Menu'),
329
-            '#type' => 'select',
330
-            '#options' => menu_get_menus(),
331
-            '#default_value' => $menu['name'],
332
-            '#description' => t('Insert item into an available menu.'), //
333
-            '#process' => array('views_process_dependency'),
334
-            '#dependency' => array('radio:menu[type]' => array('normal')),
335
-          );
336
-        }
337
-        else {
338
-          $form['menu']['name'] = array(
339
-            '#type' => 'value',
340
-            '#value' => $menu['name'],
341
-          );
342
-          $form['menu']['markup'] = array(
343
-            '#value' => t('Menu selection requires the activation of menu module.'),
344
-          );
345
-        }
346
-        $form['menu']['weight'] = array(
347
-          '#suffix' => '</div>',
348
-          '#title' => t('Weight'),
349
-          '#type' => 'textfield',
350
-          '#default_value' => isset($menu['weight']) ? $menu['weight'] : 0,
351
-          '#description' => t('The lower the weight the higher/further left it will appear.'),
352
-          '#process' => array('views_process_dependency'),
353
-          '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
336
+      }
337
+      else {
338
+        $form['menu']['name'] = array(
339
+          '#type' => 'value',
340
+          '#value' => $menu['name'],
354 341
         );
355
-        break;
356
-      case 'tab_options':
357
-        $form['#title'] .= t('Default tab options');
358
-        $tab_options = $this->get_option('tab_options');
359
-        if (empty($tab_options)) {
360
-          $tab_options = array('type' => 'none', 'title' => '', 'weight' => 0);
361
-        }
362
-
363
-        $form['tab_markup'] = array(
364
-          '#prefix' => '<div class="form-item description">',
365
-          '#suffix' => '</div>',
366
-          '#value' => t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.'),
342
+        $form['menu']['markup'] = array(
343
+          '#value' => t('Menu selection requires the activation of menu module.'),
367 344
         );
345
+      }
346
+      $form['menu']['weight'] = array(
347
+        '#suffix' => '</div>',
348
+        '#title' => t('Weight'),
349
+        '#type' => 'textfield',
350
+        '#default_value' => isset($menu['weight']) ? $menu['weight'] : 0,
351
+        '#description' => t('The lower the weight the higher/further left it will appear.'),
352
+        '#process' => array('views_process_dependency'),
353
+        '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
354
+      );
355
+      break;
356
+    case 'tab_options':
357
+      $form['#title'] .= t('Default tab options');
358
+      $tab_options = $this->get_option('tab_options');
359
+      if (empty($tab_options)) {
360
+        $tab_options = array('type' => 'none', 'title' => '', 'weight' => 0);
361
+      }
368 362
 
369
-        $form['tab_options'] = array(
370
-          '#prefix' => '<div class="clear-block">',
371
-          '#suffix' => '</div>',
372
-          '#tree' => TRUE,
373
-        );
374
-        $form['tab_options']['type'] = array(
375
-          '#prefix' => '<div class="views-left-25">',
376
-          '#suffix' => '</div>',
377
-          '#title' => t('Parent menu item'),
378
-          '#type' => 'radios',
379
-          '#options' => array('none' => t('Already exists'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')),
380
-          '#default_value' => $tab_options['type'],
381
-        );
382
-        $form['tab_options']['title'] = array(
383
-          '#prefix' => '<div class="views-left-75">',
384
-          '#title' => t('Title'),
385
-          '#type' => 'textfield',
386
-          '#default_value' => $tab_options['title'],
387
-          '#description' => t('If creating a parent menu item, enter the title of the item.'),
363
+      $form['tab_markup'] = array(
364
+        '#prefix' => '<div class="form-item description">',
365
+        '#suffix' => '</div>',
366
+        '#value' => t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.'),
367
+      );
368
+
369
+      $form['tab_options'] = array(
370
+        '#prefix' => '<div class="clear-block">',
371
+        '#suffix' => '</div>',
372
+        '#tree' => TRUE,
373
+      );
374
+      $form['tab_options']['type'] = array(
375
+        '#prefix' => '<div class="views-left-25">',
376
+        '#suffix' => '</div>',
377
+        '#title' => t('Parent menu item'),
378
+        '#type' => 'radios',
379
+        '#options' => array('none' => t('Already exists'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')),
380
+        '#default_value' => $tab_options['type'],
381
+      );
382
+      $form['tab_options']['title'] = array(
383
+        '#prefix' => '<div class="views-left-75">',
384
+        '#title' => t('Title'),
385
+        '#type' => 'textfield',
386
+        '#default_value' => $tab_options['title'],
387
+        '#description' => t('If creating a parent menu item, enter the title of the item.'),
388
+        '#process' => array('views_process_dependency'),
389
+        '#dependency' => array('radio:tab_options[type]' => array('normal', 'tab')),
390
+      );
391
+      $form['tab_options']['description'] = array(
392
+        '#title' => t('Description'),
393
+        '#type' => 'textfield',
394
+        '#default_value' => $tab_options['description'],
395
+        '#description' => t('If creating a parent menu item, enter the description of the item.'),
396
+        '#process' => array('views_process_dependency'),
397
+        '#dependency' => array('radio:tab_options[type]' => array('normal', 'tab')),
398
+      );
399
+      // Only display the menu selector if menu module is enabled.
400
+      if (module_exists('menu')) {
401
+        $form['tab_options']['name'] = array(
402
+          '#title' => t('Menu'),
403
+          '#type' => 'select',
404
+          '#options' => menu_get_menus(),
405
+          '#default_value' => $tab_options['name'],
406
+          '#description' => t('Insert item into an available menu.'),
388 407
           '#process' => array('views_process_dependency'),
389
-          '#dependency' => array('radio:tab_options[type]' => array('normal', 'tab')),
408
+          '#dependency' => array('radio:tab_options[type]' => array('normal')),
390 409
         );
391
-        $form['tab_options']['description'] = array(
392
-          '#title' => t('Description'),
393
-          '#type' => 'textfield',
394
-          '#default_value' => $tab_options['description'],
395
-          '#description' => t('If creating a parent menu item, enter the description of the item.'),
396
-          '#process' => array('views_process_dependency'),
397
-          '#dependency' => array('radio:tab_options[type]' => array('normal', 'tab')),
410
+      }
411
+      else {
412
+        $form['tab_options']['name'] = array(
413
+          '#type' => 'value',
414
+          '#value' => $tab_options['name'],
398 415
         );
399
-        // Only display the menu selector if menu module is enabled.
400
-        if (module_exists('menu')) {
401
-          $form['tab_options']['name'] = array(
402
-            '#title' => t('Menu'),
403
-            '#type' => 'select',
404
-            '#options' => menu_get_menus(),
405
-            '#default_value' => $tab_options['name'],
406
-            '#description' => t('Insert item into an available menu.'),
407
-            '#process' => array('views_process_dependency'),
408
-            '#dependency' => array('radio:tab_options[type]' => array('normal')),
409
-          );
410
-        }
411
-        else {
412
-          $form['tab_options']['name'] = array(
413
-            '#type' => 'value',
414
-            '#value' => $tab_options['name'],
415
-          );
416
-          $form['tab_options']['markup'] = array(
417
-            '#value' => t('Menu selection requires the activation of menu module.'),
418
-          );
419
-        }
420
-        $form['tab_options']['weight'] = array(
421
-          '#suffix' => '</div>',
422
-          '#title' => t('Tab weight'),
423
-          '#type' => 'textfield',
424
-          '#default_value' => $tab_options['weight'],
425
-          '#size' => 5,
426
-          '#description' => t('If the parent menu item is a tab, enter the weight of the tab. The lower the number, the more to the left it will be.'),
427
-          '#process' => array('views_process_dependency'),
428
-          '#dependency' => array('radio:tab_options[type]' => array('tab')),
416
+        $form['tab_options']['markup'] = array(
417
+          '#value' => t('Menu selection requires the activation of menu module.'),
429 418
         );
430
-        break;
419
+      }
420
+      $form['tab_options']['weight'] = array(
421
+        '#suffix' => '</div>',
422
+        '#title' => t('Tab weight'),
423
+        '#type' => 'textfield',
424
+        '#default_value' => $tab_options['weight'],
425
+        '#size' => 5,
426
+        '#description' => t('If the parent menu item is a tab, enter the weight of the tab. The lower the number, the more to the left it will be.'),
427
+        '#process' => array('views_process_dependency'),
428
+        '#dependency' => array('radio:tab_options[type]' => array('tab')),
429
+      );
430
+      break;
431 431
     }
432 432
   }
433 433
 
@@ -435,37 +435,37 @@  discard block
 block discarded – undo
435 435
     // It is very important to call the parent function here:
436 436
     parent::options_validate($form, $form_state);
437 437
     switch ($form_state['section']) {
438
-      case 'path':
439
-        if (strpos($form_state['values']['path'], '$arg') !== FALSE) {
440
-          form_error($form['path'], t('"$arg" is no longer supported. Use % instead.'));
441
-        }
438
+    case 'path':
439
+      if (strpos($form_state['values']['path'], '$arg') !== FALSE) {
440
+        form_error($form['path'], t('"$arg" is no longer supported. Use % instead.'));
441
+      }
442 442
 
443
-        if (strpos($form_state['values']['path'], '%') === 0) {
444
-          form_error($form['path'], t('"%" may not be used for the first segment of a path.'));
445
-        }
443
+      if (strpos($form_state['values']['path'], '%') === 0) {
444
+        form_error($form['path'], t('"%" may not be used for the first segment of a path.'));
445
+      }
446 446
 
447
-        // automatically remove '/' from path.
448
-        $form_state['values']['path'] = trim($form_state['values']['path'], '/');
447
+      // automatically remove '/' from path.
448
+      $form_state['values']['path'] = trim($form_state['values']['path'], '/');
449 449
 
450
-        break;
451
-      case 'menu':
452
-        $path = $this->get_option('path');
453
-        if ($form_state['values']['menu']['type'] == 'normal' && strpos($path, '%') !== FALSE) {
454
-          form_error($form['menu']['type'], t('Views cannot create normal menu items for paths with a % in them.'));
455
-        }
450
+      break;
451
+    case 'menu':
452
+      $path = $this->get_option('path');
453
+      if ($form_state['values']['menu']['type'] == 'normal' && strpos($path, '%') !== FALSE) {
454
+        form_error($form['menu']['type'], t('Views cannot create normal menu items for paths with a % in them.'));
455
+      }
456 456
 
457
-        if ($form_state['values']['menu']['type'] == 'default tab' || $form_state['values']['menu']['type'] == 'tab') {
458
-          $bits = explode('/', $path);
459
-          $last = array_pop($bits);
460
-          if ($last == '%') {
461
-            form_error($form['menu']['type'], t('A display whose path ends with a % cannot be a tab.'));
462
-          }
457
+      if ($form_state['values']['menu']['type'] == 'default tab' || $form_state['values']['menu']['type'] == 'tab') {
458
+        $bits = explode('/', $path);
459
+        $last = array_pop($bits);
460
+        if ($last == '%') {
461
+          form_error($form['menu']['type'], t('A display whose path ends with a % cannot be a tab.'));
463 462
         }
463
+      }
464 464
 
465
-        if ($form_state['values']['menu']['type'] != 'none' && empty($form_state['values']['menu']['title'])) {
466
-          form_error($form['menu']['title'], t('Title is required for this menu type.'));
467
-        }
468
-        break;
465
+      if ($form_state['values']['menu']['type'] != 'none' && empty($form_state['values']['menu']['title'])) {
466
+        form_error($form['menu']['title'], t('Title is required for this menu type.'));
467
+      }
468
+      break;
469 469
     }
470 470
   }
471 471
 
@@ -473,19 +473,19 @@  discard block
 block discarded – undo
473 473
     // It is very important to call the parent function here:
474 474
     parent::options_submit($form, $form_state);
475 475
     switch ($form_state['section']) {
476
-      case 'path':
477
-        $this->set_option('path', $form_state['values']['path']);
478
-        break;
479
-      case 'menu':
480
-        $this->set_option('menu', $form_state['values']['menu']);
481
-        // send ajax form to options page if we use it.
482
-        if ($form_state['values']['menu']['type'] == 'default tab') {
483
-          views_ui_add_form_to_stack('display', $this->view, $this->display->id, array('tab_options'));
484
-        }
485
-        break;
486
-      case 'tab_options':
487
-        $this->set_option('tab_options', $form_state['values']['tab_options']);
488
-        break;
476
+    case 'path':
477
+      $this->set_option('path', $form_state['values']['path']);
478
+      break;
479
+    case 'menu':
480
+      $this->set_option('menu', $form_state['values']['menu']);
481
+      // send ajax form to options page if we use it.
482
+      if ($form_state['values']['menu']['type'] == 'default tab') {
483
+        views_ui_add_form_to_stack('display', $this->view, $this->display->id, array('tab_options'));
484
+      }
485
+      break;
486
+    case 'tab_options':
487
+      $this->set_option('tab_options', $form_state['values']['tab_options']);
488
+      break;
489 489
     }
490 490
   }
491 491
 
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/views/modules/search.views_convert.inc 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@
 block discarded – undo
7 7
 
8 8
 function search_views_convert($display, $type, &$view, $field, $id = NULL) {
9 9
   switch ($type) {
10
-    case 'filter':
11
-      switch ($field['tablename']) {
12
-        case 'temp_search_results':
13
-          switch ($field['field']) {
14
-            case 'word':
15
-              $view->set_item_option($display, 'filter', $id, 'table', 'search_index');
16
-              $view->set_item_option($display, 'filter', $id, 'field', 'keys');
17
-              break;
18
-          }
19
-          break;
10
+  case 'filter':
11
+    switch ($field['tablename']) {
12
+    case 'temp_search_results':
13
+    switch ($field['field']) {
14
+    case 'word':
15
+    $view->set_item_option($display, 'filter', $id, 'table', 'search_index');
16
+    $view->set_item_option($display, 'filter', $id, 'field', 'keys');
17
+    break;
18
+    }
19
+        break;
20 20
       }
21 21
       break;
22 22
   }
Please login to merge, or discard this patch.
modules/contrib/views/modules/profile/views_handler_field_profile_date.inc 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,18 +22,18 @@
 block discarded – undo
22 22
     $value = unserialize($value->{$this->field_alias});
23 23
     $format = $this->options['date_format'];
24 24
     switch ($format) {
25
-      case 'custom':
26
-        $format = $this->options['custom_date_format'];
27
-        break;
28
-      case 'small':
29
-        $format = variable_get('date_format_short', 'm/d/Y - H:i');
30
-        break;
31
-      case 'medium':
32
-        $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
33
-        break;
34
-      case 'large':
35
-        $format = variable_get('date_format_long', 'l, F j, Y - H:i');
36
-        break;
25
+    case 'custom':
26
+      $format = $this->options['custom_date_format'];
27
+      break;
28
+    case 'small':
29
+      $format = variable_get('date_format_short', 'm/d/Y - H:i');
30
+      break;
31
+    case 'medium':
32
+      $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
33
+      break;
34
+    case 'large':
35
+      $format = variable_get('date_format_long', 'l, F j, Y - H:i');
36
+      break;
37 37
     }
38 38
 
39 39
     // Note: Avoid PHP's date() because it does not handle dates before
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/views/modules/node.views_convert.inc 1 patch
Switch Indentation   +155 added lines, -155 removed lines patch added patch discarded remove patch
@@ -14,168 +14,168 @@
 block discarded – undo
14 14
  */
15 15
 function node_views_convert($display, $type, &$view, $field, $id = NULL) {
16 16
   switch ($type) {
17
-    case 'field':
18
-      switch ($field['tablename']) {
19
-        case 'node':
20
-          switch ($field['field']) {
21
-            case 'title':
22
-              if ($field['options'] != 'no_link') {
23
-                $view->set_item_option($display, 'field', $id, 'link_to_node', TRUE);
24
-              }
25
-              break;
26
-            case 'created':
27
-            case 'changed':
28
-              $handlers = array(
29
-                'views_handler_field_date_small' => 'small',
30
-                'views_handler_field_date' => 'medium',
31
-                'views_handler_field_date_large' => 'large',
32
-                'views_handler_field_date_custom' => 'custom',
33
-                'views_handler_field_since' => 'time ago',
34
-              );
35
-              $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
36
-              if (!empty($field['options'])) {
37
-                $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
38
-              }
39
-              break;
40
-            case 'body':
41
-              $field['field'] = $field['handler'] == 'views_handler_field_teaser' ? 'teaser' : $field['field'];
42
-              $view->set_item_option($display, 'field', $id, 'field', $field['field']);
43
-              $view->set_item_option($display, 'field', $id, 'table', 'node_revisions');
44
-              break;
45
-            case 'link':
46
-            case 'edit':
47
-            case 'delete':
48
-            case 'view':
49
-              $field['field'] = $field['field'] == 'link' ? 'view_node' : "$field[field]_node";
50
-              $view->set_item_option($display, 'field', $id, 'field', $field['field']);
51
-              if (!empty($field['options'])) {
52
-                $view->set_item_option($display, 'field', $id, 'text', $field['options']);
53
-              }
54
-              break;
55
-          }
56
-          break;
17
+  case 'field':
18
+    switch ($field['tablename']) {
19
+    case 'node':
20
+    switch ($field['field']) {
21
+    case 'title':
22
+    if ($field['options'] != 'no_link') {
23
+    $view->set_item_option($display, 'field', $id, 'link_to_node', TRUE);
24
+    }
25
+    break;
26
+    case 'created':
27
+    case 'changed':
28
+    $handlers = array(
29
+    'views_handler_field_date_small' => 'small',
30
+    'views_handler_field_date' => 'medium',
31
+    'views_handler_field_date_large' => 'large',
32
+    'views_handler_field_date_custom' => 'custom',
33
+    'views_handler_field_since' => 'time ago',
34
+    );
35
+    $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
36
+    if (!empty($field['options'])) {
37
+    $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
38
+    }
39
+    break;
40
+    case 'body':
41
+    $field['field'] = $field['handler'] == 'views_handler_field_teaser' ? 'teaser' : $field['field'];
42
+    $view->set_item_option($display, 'field', $id, 'field', $field['field']);
43
+    $view->set_item_option($display, 'field', $id, 'table', 'node_revisions');
44
+    break;
45
+    case 'link':
46
+    case 'edit':
47
+    case 'delete':
48
+    case 'view':
49
+    $field['field'] = $field['field'] == 'link' ? 'view_node' : "$field[field]_node";
50
+    $view->set_item_option($display, 'field', $id, 'field', $field['field']);
51
+    if (!empty($field['options'])) {
52
+    $view->set_item_option($display, 'field', $id, 'text', $field['options']);
53
+    }
54
+    break;
55
+    }
56
+        break;
57 57
       }
58 58
       break;
59
-    case 'filter':
60
-      switch ($field['tablename']) {
61
-        case 'node':
62
-          switch ($field['field']) {
63
-            case 'type':
64
-              $operators = array('OR' => 'in', 'NOR' => 'not in');
65
-              $view->set_item_option($display, 'filter', $id, 'operator', $operators[$field['operator']]);
66
-              break;
67
-            case 'anon':
68
-              $item = $view->get_item($display, 'filter', $id);
69
-              $item['value'] = array(0);
70
-              $item['table'] = 'users';
71
-              $item['field'] = 'uid';
72
-              $view->set_item($display, 'filter', $id, $item);
73
-              break;
74
-            case 'currentuid':
75
-              $operators = array('=' => TRUE, '!=' => FALSE);
76
-              $item = $view->get_item($display, 'filter', $id);
77
-              $item['value'] = $operators[$field['operator']];
78
-              $item['table'] = 'users';
79
-              $item['field'] = 'uid_current';
80
-              $view->set_item($display, 'filter', $id, $item);
81
-              break;
82
-            case 'currentuidtouched':
83
-              $view->set_item_option($display, 'filter', $id, 'value', '=');
84
-              $view->set_item_option($display, 'filter', $id, 'field', 'uid_touch');
85
-              break;
86
-            case 'distinct':
87
-              $view->display_handler->set_option('distinct', $field['operator'] == '=' && $field['value'] == 'distinct');
88
-              $view->set_item($display, 'filter', $id, NULL);
89
-              break;
90
-            case 'title':
91
-              $item = $view->get_item($display, 'filter', $id);
92
-              $item['operator'] = $field['operator'];
93
-              $item['case'] = FALSE;
94
-              $view->set_item($display, 'filter', $id, $item);
95
-              break;
96
-            case 'created':
97
-            case 'changed':
98
-              $item = $view->get_item($display, 'filter', $id);
99
-              $item['operator'] = $field['operator'];
100
-              $item['value'] = array(
101
-                'type' => $field['value'] == 'now' ? 'offset' : 'date',
102
-                'value' => $field['value'],
103
-              );
104
-              if (!empty($field['options'])) {
105
-                $item['value']['value'] = intval($field['options']) .' seconds';
106
-              }
107
-              $view->set_item($display, 'filter', $id, $item);
108
-              break;
109
-            case 'body':
110
-              $item = $view->get_item($display, 'filter', $id);
111
-              $item['operator'] = $field['operator'];
112
-              $item['case'] = FALSE;
113
-              $item['table'] = 'node_revisions';
114
-              $view->set_item($display, 'filter', $id, $item);
115
-              break;
116
-          }
117
-          break;
118
-        case 'history':
119
-          switch ($field['field']) {
120
-            case 'timestamp':
121
-              $view->set_item_option($display, 'filter', $id, 'table', 'history_user');
122
-              break;
123
-          }
124
-          break;
125
-      }
59
+  case 'filter':
60
+    switch ($field['tablename']) {
61
+    case 'node':
62
+    switch ($field['field']) {
63
+    case 'type':
64
+    $operators = array('OR' => 'in', 'NOR' => 'not in');
65
+    $view->set_item_option($display, 'filter', $id, 'operator', $operators[$field['operator']]);
66
+    break;
67
+    case 'anon':
68
+    $item = $view->get_item($display, 'filter', $id);
69
+    $item['value'] = array(0);
70
+    $item['table'] = 'users';
71
+    $item['field'] = 'uid';
72
+    $view->set_item($display, 'filter', $id, $item);
73
+    break;
74
+    case 'currentuid':
75
+    $operators = array('=' => TRUE, '!=' => FALSE);
76
+    $item = $view->get_item($display, 'filter', $id);
77
+    $item['value'] = $operators[$field['operator']];
78
+    $item['table'] = 'users';
79
+    $item['field'] = 'uid_current';
80
+    $view->set_item($display, 'filter', $id, $item);
81
+    break;
82
+    case 'currentuidtouched':
83
+    $view->set_item_option($display, 'filter', $id, 'value', '=');
84
+    $view->set_item_option($display, 'filter', $id, 'field', 'uid_touch');
85
+    break;
86
+    case 'distinct':
87
+    $view->display_handler->set_option('distinct', $field['operator'] == '=' && $field['value'] == 'distinct');
88
+    $view->set_item($display, 'filter', $id, NULL);
89
+    break;
90
+    case 'title':
91
+    $item = $view->get_item($display, 'filter', $id);
92
+    $item['operator'] = $field['operator'];
93
+    $item['case'] = FALSE;
94
+    $view->set_item($display, 'filter', $id, $item);
95
+    break;
96
+    case 'created':
97
+    case 'changed':
98
+    $item = $view->get_item($display, 'filter', $id);
99
+    $item['operator'] = $field['operator'];
100
+    $item['value'] = array(
101
+    'type' => $field['value'] == 'now' ? 'offset' : 'date',
102
+    'value' => $field['value'],
103
+    );
104
+    if (!empty($field['options'])) {
105
+    $item['value']['value'] = intval($field['options']) .' seconds';
106
+    }
107
+    $view->set_item($display, 'filter', $id, $item);
108
+    break;
109
+    case 'body':
110
+    $item = $view->get_item($display, 'filter', $id);
111
+    $item['operator'] = $field['operator'];
112
+    $item['case'] = FALSE;
113
+    $item['table'] = 'node_revisions';
114
+    $view->set_item($display, 'filter', $id, $item);
115
+    break;
116
+    }
117
+        break;
118
+    case 'history':
119
+      switch ($field['field']) {
120
+      case 'timestamp':
121
+      $view->set_item_option($display, 'filter', $id, 'table', 'history_user');
126 122
       break;
127
-    case 'sort':
128
-      switch ($field['tablename']) {
129
-        case 'node':
130
-          switch ($field['field']) {
131
-            case 'created':
132
-            case 'changed':
133
-              $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
134
-              $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
135
-              break;
136
-            case 'random':
137
-              $view->set_item_option($display, 'sort', $id, 'table', 'views');
138
-              break;
139
-          }
123
+      }
140 124
           break;
141 125
       }
142 126
       break;
143
-    case 'argument':
144
-      $options = $field['argoptions'];
145
-      switch ($field['type']) {
146
-        case 'nodetype':
147
-          $view->add_item($display, 'argument', 'node', 'type', $options, $field['id']);
148
-          break;
149
-        case 'nodeletter':
150
-          if (!empty($field['options'])) {
151
-            $options['glossary'] = TRUE;
152
-            $options['limit'] = $field['options'];
153
-          }
154
-          $options['case'] = 'upper';
155
-          $view->add_item($display, 'argument', 'node', 'title', $options, $field['id']);
156
-          break;
157
-        case 'year':
158
-          $view->add_item($display, 'argument', 'node', 'created_year', $options, $field['id']);
159
-          break;
160
-        case 'month':
161
-          $view->add_item($display, 'argument', 'node', 'created_month', $options, $field['id']);
162
-          break;
163
-        case 'week':
164
-          $view->add_item($display, 'argument', 'node', 'created_week', $options, $field['id']);
165
-          break;
166
-        case 'monthyear':
167
-          $view->add_item($display, 'argument', 'node', 'created_year_month', $options, $field['id']);
168
-          break;
169
-        case 'fulldate':
170
-          $view->add_item($display, 'argument', 'node', 'created_fulldate', $options, $field['id']);
171
-          break;
172
-        case 'nid':
173
-          if (!empty($field['options'])) {
174
-            $options['not'] = TRUE;
175
-          }
176
-          $view->add_item($display, 'argument', 'node', 'nid', $options, $field['id']);
177
-          break;
127
+  case 'sort':
128
+    switch ($field['tablename']) {
129
+    case 'node':
130
+    switch ($field['field']) {
131
+    case 'created':
132
+    case 'changed':
133
+    $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
134
+    $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
135
+    break;
136
+    case 'random':
137
+    $view->set_item_option($display, 'sort', $id, 'table', 'views');
138
+    break;
139
+    }
140
+        break;
178 141
       }
179 142
       break;
143
+  case 'argument':
144
+    $options = $field['argoptions'];
145
+    switch ($field['type']) {
146
+    case 'nodetype':
147
+    $view->add_item($display, 'argument', 'node', 'type', $options, $field['id']);
148
+    break;
149
+    case 'nodeletter':
150
+    if (!empty($field['options'])) {
151
+    $options['glossary'] = TRUE;
152
+    $options['limit'] = $field['options'];
153
+    }
154
+    $options['case'] = 'upper';
155
+    $view->add_item($display, 'argument', 'node', 'title', $options, $field['id']);
156
+    break;
157
+    case 'year':
158
+    $view->add_item($display, 'argument', 'node', 'created_year', $options, $field['id']);
159
+    break;
160
+    case 'month':
161
+    $view->add_item($display, 'argument', 'node', 'created_month', $options, $field['id']);
162
+    break;
163
+    case 'week':
164
+    $view->add_item($display, 'argument', 'node', 'created_week', $options, $field['id']);
165
+    break;
166
+    case 'monthyear':
167
+    $view->add_item($display, 'argument', 'node', 'created_year_month', $options, $field['id']);
168
+    break;
169
+    case 'fulldate':
170
+    $view->add_item($display, 'argument', 'node', 'created_fulldate', $options, $field['id']);
171
+    break;
172
+    case 'nid':
173
+    if (!empty($field['options'])) {
174
+    $options['not'] = TRUE;
175
+    }
176
+    $view->add_item($display, 'argument', 'node', 'nid', $options, $field['id']);
177
+    break;
178
+    }
179
+      break;
180 180
   }
181 181
 }
Please login to merge, or discard this patch.
modules/contrib/views/modules/node/views_plugin_argument_validate_node.inc 1 patch
Switch Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -60,62 +60,62 @@
 block discarded – undo
60 60
     $type = isset($this->argument->options['validate_argument_nid_type']) ? $this->argument->options['validate_argument_nid_type'] : 'nid';
61 61
 
62 62
     switch ($type) {
63
-      case 'nid':
64
-        if (!is_numeric($argument)) {
65
-          return FALSE;
66
-        }
67
-        $node = node_load($argument);
68
-        if (!$node) {
63
+    case 'nid':
64
+      if (!is_numeric($argument)) {
65
+        return FALSE;
66
+      }
67
+      $node = node_load($argument);
68
+      if (!$node) {
69
+        return FALSE;
70
+      }
71
+
72
+      if (!empty($this->argument->options['validate_argument_node_access'])) {
73
+        if (!node_access('view', $node)) {
69 74
           return FALSE;
70 75
         }
76
+      }
71 77
 
72
-        if (!empty($this->argument->options['validate_argument_node_access'])) {
73
-          if (!node_access('view', $node)) {
74
-            return FALSE;
75
-          }
76
-        }
78
+      // Save the title() handlers some work.
79
+      $this->argument->validated_title = check_plain($node->title);
77 80
 
78
-        // Save the title() handlers some work.
79
-        $this->argument->validated_title = check_plain($node->title);
81
+      if (empty($types)) {
82
+        return TRUE;
83
+      }
80 84
 
81
-        if (empty($types)) {
82
-          return TRUE;
83
-        }
85
+      return isset($types[$node->type]);
86
+    break;
87
+    case 'nids':
88
+      $nids = new stdClass();
89
+      $nids->value = array($argument);
90
+      $nids = views_break_phrase($argument, $nids);
91
+      if ($nids->value == -1) {
92
+        return FALSE;
93
+      }
84 94
 
85
-        return isset($types[$node->type]);
86
-      break;
87
-      case 'nids':
88
-        $nids = new stdClass();
89
-        $nids->value = array($argument);
90
-        $nids = views_break_phrase($argument, $nids);
91
-        if ($nids->value == -1) {
92
-          return FALSE;
93
-        }
95
+      $placeholders = implode(', ', array_fill(0, sizeof($nids->value), '%d'));
94 96
 
95
-        $placeholders = implode(', ', array_fill(0, sizeof($nids->value), '%d'));
97
+      $test = drupal_map_assoc($nids->value);
98
+      $titles = array();
96 99
 
97
-        $test = drupal_map_assoc($nids->value);
98
-        $titles = array();
100
+      $result = db_query("SELECT * FROM {node} WHERE nid IN ($placeholders)", $nids->value);
101
+      while ($node = db_fetch_object($result)) {
102
+        if ($types && empty($types[$node->type])) {
103
+          return FALSE;
104
+        }
99 105
 
100
-        $result = db_query("SELECT * FROM {node} WHERE nid IN ($placeholders)", $nids->value);
101
-        while ($node = db_fetch_object($result)) {
102
-          if ($types && empty($types[$node->type])) {
106
+        if (!empty($this->argument->options['validate_argument_node_access'])) {
107
+          if (!node_access('view', $node)) {
103 108
             return FALSE;
104 109
           }
105
-
106
-          if (!empty($this->argument->options['validate_argument_node_access'])) {
107
-            if (!node_access('view', $node)) {
108
-              return FALSE;
109
-            }
110
-          }
111
-
112
-          $titles[] = check_plain($node->title);
113
-          unset($test[$node->nid]);
114 110
         }
115 111
 
116
-        $this->argument->validated_title = implode($nids->operator == 'or' ? ' + ' : ', ', $titles);
117
-        // If this is not empty, we did not find a nid.
118
-        return empty($test);
112
+        $titles[] = check_plain($node->title);
113
+        unset($test[$node->nid]);
114
+      }
115
+
116
+      $this->argument->validated_title = implode($nids->operator == 'or' ? ' + ' : ', ', $titles);
117
+      // If this is not empty, we did not find a nid.
118
+      return empty($test);
119 119
     }
120 120
   }
121 121
 }
Please login to merge, or discard this patch.
boinc/modules/contrib/views/modules/node/views_plugin_row_node_rss.inc 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -121,18 +121,18 @@
 block discarded – undo
121 121
 
122 122
     // Prepare the item description
123 123
     switch ($item_length) {
124
-      case 'fulltext':
125
-        $item->description = $node->body;
126
-        break;
127
-      case 'teaser':
128
-        $item->description = $node->teaser;
129
-        if (!empty($item->readmore)) {
130
-          $item->description .= '<p>' . l(t('read more'), 'node/' . $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . '</p>';
131
-        }
132
-        break;
133
-      case 'title':
134
-        $item->description = '';
135
-        break;
124
+    case 'fulltext':
125
+      $item->description = $node->body;
126
+      break;
127
+    case 'teaser':
128
+      $item->description = $node->teaser;
129
+      if (!empty($item->readmore)) {
130
+        $item->description .= '<p>' . l(t('read more'), 'node/' . $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . '</p>';
131
+      }
132
+      break;
133
+    case 'title':
134
+      $item->description = '';
135
+      break;
136 136
     }
137 137
 
138 138
     return theme($this->theme_functions(), $this->view, $this->options, $item);
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/views/modules/comment.views_convert.inc 1 patch
Switch Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -14,116 +14,116 @@
 block discarded – undo
14 14
  */
15 15
 function comment_views_convert($display, $type, &$view, $field, $id = NULL) {
16 16
   switch ($type) {
17
-    case 'field':
18
-      switch ($field['tablename']) {
19
-        case 'comments':
20
-          switch ($field['field']) {
21
-            case 'subject':
22
-              if ($field['options'] = 'nolink') {
23
-                $view->set_item_option($display, 'field', $id, 'link_to_comment', FALSE);
24
-              }
25
-              break;
26
-            case 'cid':
27
-              $view->set_item_option($display, 'field', $id, 'link_to_comment', FALSE);
28
-              break;
29
-            case 'timestamp':
30
-              $handlers = array(
31
-                'views_handler_field_date_small' => 'small',
32
-                'views_handler_field_date' => 'medium',
33
-                'views_handler_field_date_large' => 'large',
34
-                'views_handler_field_date_custom' => 'custom',
35
-                'views_handler_field_since' => 'time ago',
36
-              );
37
-              $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
38
-              if (!empty($field['options'])) {
39
-                $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
40
-              }
41
-              break;
42
-            case 'add':
43
-              $view->set_item_option($display, 'field', $id, 'field', 'replyto_comment');
44
-              break;
45
-          }
46
-          break;
47
-        case 'node_comment_statistics':
48
-          switch ($field['field']) {
49
-            case 'last_comment_timestamp':
50
-              $handlers = array(
51
-                'views_handler_field_date_small' => 'small',
52
-                'views_handler_field_date' => 'medium',
53
-                'views_handler_field_date_large' => 'large',
54
-                'views_handler_field_date_custom' => 'custom',
55
-                'views_handler_field_since' => 'time ago',
56
-              );
57
-              $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
58
-              if (!empty($field['options'])) {
59
-                $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
60
-              }
61
-              break;
62
-            case 'last_changed':
63
-              $handlers = array(
64
-                'views_handler_field_date_small' => 'small',
65
-                'views_handler_field_date' => 'medium',
66
-                'views_handler_field_date_large' => 'large',
67
-                'views_handler_field_date_custom' => 'custom',
68
-                'views_handler_field_since' => 'time ago',
69
-              );
70
-              $item = $view->get_item($display, 'field', $id);
71
-              $item['date_format'] = $handlers[$field['handler']];
72
-              if (!empty($field['options'])) {
73
-                $item['custom_date_format'] = $field['options'];
74
-              }
75
-              $item['field'] = 'last_updated';
76
-              $view->set_item($display, 'field', $id, $item);
77
-              break;
78
-          }
79
-          break;
17
+  case 'field':
18
+    switch ($field['tablename']) {
19
+    case 'comments':
20
+    switch ($field['field']) {
21
+    case 'subject':
22
+    if ($field['options'] = 'nolink') {
23
+    $view->set_item_option($display, 'field', $id, 'link_to_comment', FALSE);
24
+    }
25
+    break;
26
+    case 'cid':
27
+    $view->set_item_option($display, 'field', $id, 'link_to_comment', FALSE);
28
+    break;
29
+    case 'timestamp':
30
+    $handlers = array(
31
+    'views_handler_field_date_small' => 'small',
32
+    'views_handler_field_date' => 'medium',
33
+    'views_handler_field_date_large' => 'large',
34
+    'views_handler_field_date_custom' => 'custom',
35
+    'views_handler_field_since' => 'time ago',
36
+    );
37
+    $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
38
+    if (!empty($field['options'])) {
39
+    $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
40
+    }
41
+    break;
42
+    case 'add':
43
+    $view->set_item_option($display, 'field', $id, 'field', 'replyto_comment');
44
+    break;
45
+    }
46
+        break;
47
+    case 'node_comment_statistics':
48
+      switch ($field['field']) {
49
+      case 'last_comment_timestamp':
50
+      $handlers = array(
51
+      'views_handler_field_date_small' => 'small',
52
+      'views_handler_field_date' => 'medium',
53
+      'views_handler_field_date_large' => 'large',
54
+      'views_handler_field_date_custom' => 'custom',
55
+      'views_handler_field_since' => 'time ago',
56
+      );
57
+      $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
58
+      if (!empty($field['options'])) {
59
+      $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
80 60
       }
81 61
       break;
82
-    case 'filter':
83
-      switch ($field['tablename']) {
84
-        case 'node_comment_statistics':
85
-          switch ($field['field']) {
86
-            case 'comment_count':
87
-              $view->set_item_option($display, 'filter', $id, 'operator', $field['operator']);
88
-              break;
89
-            case 'last_changed':
90
-              $field['field'] = 'last_updated';
91
-            case 'last_comment_timestamp':
92
-              $item = $view->get_item($display, 'filter', $id);
93
-              $item['operator'] = $field['operator'];
94
-              $item['value'] = array(
95
-                'type' => $field['value'] == 'now' ? 'offset' : 'date',
96
-                'value' => $field['value'],
97
-              );
98
-              if (!empty($field['options'])) {
99
-                $item['value']['value'] = intval($field['options']) .' seconds';
100
-              }
101
-              $item['field'] = $field['field'];
102
-              $view->set_item($display, 'filter', $id, $item);
103
-              break;
104
-          }
105
-          break;
62
+      case 'last_changed':
63
+      $handlers = array(
64
+      'views_handler_field_date_small' => 'small',
65
+      'views_handler_field_date' => 'medium',
66
+      'views_handler_field_date_large' => 'large',
67
+      'views_handler_field_date_custom' => 'custom',
68
+      'views_handler_field_since' => 'time ago',
69
+      );
70
+      $item = $view->get_item($display, 'field', $id);
71
+      $item['date_format'] = $handlers[$field['handler']];
72
+      if (!empty($field['options'])) {
73
+      $item['custom_date_format'] = $field['options'];
106 74
       }
75
+      $item['field'] = 'last_updated';
76
+      $view->set_item($display, 'field', $id, $item);
107 77
       break;
108
-    case 'sort':
109
-      switch ($field['tablename']) {
110
-        case 'comments':
111
-          switch ($field['field']) {
112
-            case 'timestamp':
113
-              $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
114
-              $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
115
-              break;
116
-          }
78
+      }
117 79
           break;
118
-        case 'node_comment_statistics':
119
-          switch ($field['field']) {
120
-            case 'last_changed':
121
-              $view->set_item_option($display, 'sort', $id, 'field', 'last_updated');
122
-            case 'last_comment_timestamp':
123
-              $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
124
-              $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
125
-              break;
126
-          }
80
+      }
81
+      break;
82
+  case 'filter':
83
+    switch ($field['tablename']) {
84
+    case 'node_comment_statistics':
85
+    switch ($field['field']) {
86
+    case 'comment_count':
87
+    $view->set_item_option($display, 'filter', $id, 'operator', $field['operator']);
88
+    break;
89
+    case 'last_changed':
90
+    $field['field'] = 'last_updated';
91
+    case 'last_comment_timestamp':
92
+    $item = $view->get_item($display, 'filter', $id);
93
+    $item['operator'] = $field['operator'];
94
+    $item['value'] = array(
95
+    'type' => $field['value'] == 'now' ? 'offset' : 'date',
96
+    'value' => $field['value'],
97
+    );
98
+    if (!empty($field['options'])) {
99
+    $item['value']['value'] = intval($field['options']) .' seconds';
100
+    }
101
+    $item['field'] = $field['field'];
102
+    $view->set_item($display, 'filter', $id, $item);
103
+    break;
104
+    }
105
+        break;
106
+      }
107
+      break;
108
+  case 'sort':
109
+    switch ($field['tablename']) {
110
+    case 'comments':
111
+    switch ($field['field']) {
112
+    case 'timestamp':
113
+    $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
114
+    $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
115
+    break;
116
+    }
117
+        break;
118
+    case 'node_comment_statistics':
119
+      switch ($field['field']) {
120
+      case 'last_changed':
121
+      $view->set_item_option($display, 'sort', $id, 'field', 'last_updated');
122
+      case 'last_comment_timestamp':
123
+      $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
124
+      $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
125
+      break;
126
+      }
127 127
           break;
128 128
       }
129 129
       break;
Please login to merge, or discard this patch.
default/boinc/modules/contrib/views/modules/statistics.views_convert.inc 1 patch
Switch Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -14,37 +14,37 @@
 block discarded – undo
14 14
  */
15 15
 function statistics_views_convert($display, $type, &$view, $field, $id = NULL) {
16 16
   switch ($type) {
17
-    case 'field':
18
-      switch ($field['tablename']) {
19
-        case 'node_counter':
20
-          switch ($field['field']) {
21
-            case 'timestamp':
22
-              $handlers = array(
23
-                'views_handler_field_date_small' => 'small',
24
-                'views_handler_field_date' => 'medium',
25
-                'views_handler_field_date_large' => 'large',
26
-                'views_handler_field_date_custom' => 'custom',
27
-                'views_handler_field_since' => 'time ago',
28
-              );
29
-              $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
30
-              if (!empty($field['options'])) {
31
-                $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
32
-              }
33
-              break;
34
-          }
35
-          break;
17
+  case 'field':
18
+    switch ($field['tablename']) {
19
+    case 'node_counter':
20
+    switch ($field['field']) {
21
+    case 'timestamp':
22
+    $handlers = array(
23
+    'views_handler_field_date_small' => 'small',
24
+    'views_handler_field_date' => 'medium',
25
+    'views_handler_field_date_large' => 'large',
26
+    'views_handler_field_date_custom' => 'custom',
27
+    'views_handler_field_since' => 'time ago',
28
+    );
29
+    $view->set_item_option($display, 'field', $id, 'date_format', $handlers[$field['handler']]);
30
+    if (!empty($field['options'])) {
31
+    $view->set_item_option($display, 'field', $id, 'custom_date_format', $field['options']);
32
+    }
33
+    break;
34
+    }
35
+        break;
36 36
       }
37 37
       break;
38
-    case 'sort':
39
-      switch ($field['tablename']) {
40
-        case 'node_counter':
41
-          switch ($field['field']) {
42
-            case 'timestamp':
43
-              $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
44
-              $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
45
-              break;
46
-          }
47
-          break;
38
+  case 'sort':
39
+    switch ($field['tablename']) {
40
+    case 'node_counter':
41
+    switch ($field['field']) {
42
+    case 'timestamp':
43
+    $field['options'] = $field['options'] == 'normal' ? 'second' : $field['options'];
44
+    $view->set_item_option($display, 'sort', $id, 'granularity', $field['options']);
45
+    break;
46
+    }
47
+        break;
48 48
       }
49 49
       break;
50 50
   }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/views/modules/profile.views.inc 1 patch
Switch Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -101,116 +101,116 @@
 block discarded – undo
101 101
 
102 102
   // Add fields specific to the profile type.
103 103
   switch ($field->type) {
104
-    case 'textfield':
105
-      $data += array(
106
-        'help' => t('Profile textfield'),
107
-        'field' => array(
108
-          'handler' => 'views_handler_field_user',
109
-          'click sortable' => TRUE,
110
-        ),
111
-        'sort' => array(
112
-          'handler' => 'views_handler_sort',
113
-        ),
114
-        'filter' => array(
115
-          'handler' => 'views_handler_filter_string',
116
-        ),
117
-        'argument' => array(
118
-          'handler' => 'views_handler_argument_string',
119
-        ),
120
-      );
121
-
122
-      break;
123
-    case 'textarea':
124
-      $data += array(
125
-        'help' => t('Profile textarea'),
126
-        'field' => array(
127
-          'handler' => 'views_handler_field_markup',
128
-          'format' => FILTER_FORMAT_DEFAULT,
129
-        ),
130
-        'sort' => array(
131
-          'handler' => 'views_handler_sort',
132
-        ),
133
-        'filter' => array(
134
-          'handler' => 'views_handler_filter_string',
135
-        ),
136
-      );
137
-
138
-      break;
139
-    case 'checkbox':
140
-      $data += array(
141
-        'help' => t('Profile checkbox'),
142
-        'field' => array(
143
-          'handler' => 'views_handler_field_boolean',
144
-          'click sortable' => TRUE,
145
-        ),
146
-        'sort' => array(
147
-          'handler' => 'views_handler_sort',
148
-        ),
149
-        'filter' => array(
150
-          'handler' => 'views_handler_filter_boolean_operator',
151
-          'accept null' => TRUE,
152
-        ),
153
-        // @todo there ought to be a boolean argument handler
154
-      );
155
-
156
-      break;
157
-    case 'url':
158
-      $data += array(
159
-        'help' => t('Profile URL'),
160
-        'field' => array(
161
-          'handler' => 'views_handler_field_url',
162
-          'click sortable' => TRUE,
163
-        ),
164
-        'sort' => array(
165
-          'handler' => 'views_handler_sort',
166
-        ),
167
-        'filter' => array(
168
-          'handler' => 'views_handler_filter_string',
169
-        ),
170
-      );
171
-
172
-      break;
173
-    case 'selection':
174
-      $data += array(
175
-        'help' => t('Profile selection'),
176
-        'field' => array(
177
-          'handler' => 'views_handler_field',
178
-          'click sortable' => TRUE,
179
-        ),
180
-        'sort' => array(
181
-          'handler' => 'views_handler_sort',
182
-        ),
183
-        'filter' => array(
184
-          'handler' => 'views_handler_filter_profile_selection',
185
-          'fid' => $field->fid,
186
-        ),
187
-        'argument' => array(
188
-          'handler' => 'views_handler_argument_string',
189
-        ),
190
-      );
191
-
192
-      break;
193
-    case 'list':
194
-      $data += array(
195
-        'help' => t('Profile freeform list %field-name.', array('%field-name' => $field->title)),
196
-        'field' => array(
197
-          'handler' => 'views_handler_field_profile_list',
198
-        ),
199
-        'filter' => array(
200
-          'handler' => 'views_handler_filter_string',
201
-        ),
202
-      );
203
-
204
-      break;
205
-    case 'date':
206
-      $data += array(
207
-        'help' => t('Profile date %field-name.', array('%field-name' => $field->title)),
208
-        'field' => array(
209
-          'handler' => 'views_handler_field_profile_date',
210
-        ),
211
-      );
104
+  case 'textfield':
105
+    $data += array(
106
+      'help' => t('Profile textfield'),
107
+      'field' => array(
108
+        'handler' => 'views_handler_field_user',
109
+        'click sortable' => TRUE,
110
+      ),
111
+      'sort' => array(
112
+        'handler' => 'views_handler_sort',
113
+      ),
114
+      'filter' => array(
115
+        'handler' => 'views_handler_filter_string',
116
+      ),
117
+      'argument' => array(
118
+        'handler' => 'views_handler_argument_string',
119
+      ),
120
+    );
121
+
122
+    break;
123
+  case 'textarea':
124
+    $data += array(
125
+      'help' => t('Profile textarea'),
126
+      'field' => array(
127
+        'handler' => 'views_handler_field_markup',
128
+        'format' => FILTER_FORMAT_DEFAULT,
129
+      ),
130
+      'sort' => array(
131
+        'handler' => 'views_handler_sort',
132
+      ),
133
+      'filter' => array(
134
+        'handler' => 'views_handler_filter_string',
135
+      ),
136
+    );
137
+
138
+    break;
139
+  case 'checkbox':
140
+    $data += array(
141
+      'help' => t('Profile checkbox'),
142
+      'field' => array(
143
+        'handler' => 'views_handler_field_boolean',
144
+        'click sortable' => TRUE,
145
+      ),
146
+      'sort' => array(
147
+        'handler' => 'views_handler_sort',
148
+      ),
149
+      'filter' => array(
150
+        'handler' => 'views_handler_filter_boolean_operator',
151
+        'accept null' => TRUE,
152
+      ),
153
+      // @todo there ought to be a boolean argument handler
154
+    );
155
+
156
+    break;
157
+  case 'url':
158
+    $data += array(
159
+      'help' => t('Profile URL'),
160
+      'field' => array(
161
+        'handler' => 'views_handler_field_url',
162
+        'click sortable' => TRUE,
163
+      ),
164
+      'sort' => array(
165
+        'handler' => 'views_handler_sort',
166
+      ),
167
+      'filter' => array(
168
+        'handler' => 'views_handler_filter_string',
169
+      ),
170
+    );
171
+
172
+    break;
173
+  case 'selection':
174
+    $data += array(
175
+      'help' => t('Profile selection'),
176
+      'field' => array(
177
+        'handler' => 'views_handler_field',
178
+        'click sortable' => TRUE,
179
+      ),
180
+      'sort' => array(
181
+        'handler' => 'views_handler_sort',
182
+      ),
183
+      'filter' => array(
184
+        'handler' => 'views_handler_filter_profile_selection',
185
+        'fid' => $field->fid,
186
+      ),
187
+      'argument' => array(
188
+        'handler' => 'views_handler_argument_string',
189
+      ),
190
+    );
191
+
192
+    break;
193
+  case 'list':
194
+    $data += array(
195
+      'help' => t('Profile freeform list %field-name.', array('%field-name' => $field->title)),
196
+      'field' => array(
197
+        'handler' => 'views_handler_field_profile_list',
198
+      ),
199
+      'filter' => array(
200
+        'handler' => 'views_handler_filter_string',
201
+      ),
202
+    );
203
+
204
+    break;
205
+  case 'date':
206
+    $data += array(
207
+      'help' => t('Profile date %field-name.', array('%field-name' => $field->title)),
208
+      'field' => array(
209
+        'handler' => 'views_handler_field_profile_date',
210
+      ),
211
+    );
212 212
 
213
-      break;
213
+    break;
214 214
   }
215 215
 
216 216
   // @todo: add access control to hidden fields.
Please login to merge, or discard this patch.