Passed
Push — master ( 8e685f...ce48d5 )
by Kevin
13:20
created
drupal/sites/default/boinc/modules/contrib/jump/jump.module 2 patches
Switch Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -49,62 +49,62 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function jump_block($op = 'list', $delta = 0, $edit = array()) {
51 51
   switch ($op) {
52
-    case 'list':
53
-      $blocks = array();
54
-      foreach (menu_get_menus() as $name => $title) {
55
-        $blocks['menu-' . $name] = array(
56
-          'info' => t('Jump menu: !menu', array('!menu' => $name))
57
-        );
58
-      }
52
+  case 'list':
53
+    $blocks = array();
54
+    foreach (menu_get_menus() as $name => $title) {
55
+      $blocks['menu-' . $name] = array(
56
+        'info' => t('Jump menu: !menu', array('!menu' => $name))
57
+      );
58
+    }
59 59
 
60
-      $vocs = taxonomy_get_vocabularies();
61
-      foreach ($vocs as $vid => $vocabulary) {
62
-        $blocks['taxo-' . $vid] = array(
63
-          'info' => t('Jump menu: !voc', array('!voc' => $vocabulary->name))
64
-        );
65
-      }
66
-      return $blocks;
67
-    case 'configure':
68
-      $form = array();
69
-      $form['block_settings']['jump_activepageinmenu_' . $delta] = array(
70
-        '#type' => 'checkbox',
71
-        '#title' => t('Show active page in jump menu.'),
72
-        '#default_value' => variable_get('jump_activepageinmenu_' . $delta, 1),
73
-        '#description' => t('This setting will force the jump menu to show the current page as the default selection in this block\'s jump menu.'),
60
+    $vocs = taxonomy_get_vocabularies();
61
+    foreach ($vocs as $vid => $vocabulary) {
62
+      $blocks['taxo-' . $vid] = array(
63
+        'info' => t('Jump menu: !voc', array('!voc' => $vocabulary->name))
74 64
       );
75
-      // Do the rest of the form additions in hook_form_alter() since we can't do ahah here.
76
-      return $form;
77
-    case 'save':
78
-      variable_set('jump_activepageinmenu_' . $delta, $edit['jump_activepageinmenu_' . $delta]);
79
-      variable_set('jump_use_js_' . $delta, $edit['jump_use_js_' . $delta]);
80
-      variable_set('jump_add_select_' . $delta, $edit['jump_add_select_' . $delta]);
81
-      variable_set('jump_add_select_text_' . $delta, $edit['jump_add_select_text_' . $delta]);
82
-      break;
83
-    case 'view':
84
-      // The first 5 characters of $delta should be one of:
85
-      //    menu-
86
-      //    taxo-
87
-      $subject = '';
88
-      $jumpmenu_type = substr($delta, 0, 4);
89
-      $jumpmenu_name = substr($delta, 5);
90
-      $active = jump_get_active_setting($delta);
91
-      if ($jumpmenu_type == 'menu') {
92
-        $form = jump_quickly($jumpmenu_name, 'menu', $active);
65
+    }
66
+    return $blocks;
67
+  case 'configure':
68
+    $form = array();
69
+    $form['block_settings']['jump_activepageinmenu_' . $delta] = array(
70
+      '#type' => 'checkbox',
71
+      '#title' => t('Show active page in jump menu.'),
72
+      '#default_value' => variable_get('jump_activepageinmenu_' . $delta, 1),
73
+      '#description' => t('This setting will force the jump menu to show the current page as the default selection in this block\'s jump menu.'),
74
+    );
75
+    // Do the rest of the form additions in hook_form_alter() since we can't do ahah here.
76
+    return $form;
77
+  case 'save':
78
+    variable_set('jump_activepageinmenu_' . $delta, $edit['jump_activepageinmenu_' . $delta]);
79
+    variable_set('jump_use_js_' . $delta, $edit['jump_use_js_' . $delta]);
80
+    variable_set('jump_add_select_' . $delta, $edit['jump_add_select_' . $delta]);
81
+    variable_set('jump_add_select_text_' . $delta, $edit['jump_add_select_text_' . $delta]);
82
+    break;
83
+  case 'view':
84
+    // The first 5 characters of $delta should be one of:
85
+    //    menu-
86
+    //    taxo-
87
+    $subject = '';
88
+    $jumpmenu_type = substr($delta, 0, 4);
89
+    $jumpmenu_name = substr($delta, 5);
90
+    $active = jump_get_active_setting($delta);
91
+    if ($jumpmenu_type == 'menu') {
92
+      $form = jump_quickly($jumpmenu_name, 'menu', $active);
93 93
 
94
-        // Use the menu label as the default block subject
95
-        $menus = menu_get_menus();
96
-        $subject = $menus[$jumpmenu_name];
97
-      }
98
-      else if ($jumpmenu_type == 'taxo') {
99
-        $form = jump_quickly($jumpmenu_name, 'taxo', $active);
94
+      // Use the menu label as the default block subject
95
+      $menus = menu_get_menus();
96
+      $subject = $menus[$jumpmenu_name];
97
+    }
98
+    else if ($jumpmenu_type == 'taxo') {
99
+      $form = jump_quickly($jumpmenu_name, 'taxo', $active);
100 100
 
101
-        // Use the vocabulary name as the default block subject
102
-        $vocab = taxonomy_vocabulary_load($jumpmenu_name);
103
-        $subject = $vocab->name;
104
-      }
105
-      if (variable_get('jump_use_js_' . $delta, 0) === 1) drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
106
-      return array('subject' => $subject, 'content' => $form);
107
-      break;
101
+      // Use the vocabulary name as the default block subject
102
+      $vocab = taxonomy_vocabulary_load($jumpmenu_name);
103
+      $subject = $vocab->name;
104
+    }
105
+    if (variable_get('jump_use_js_' . $delta, 0) === 1) drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
106
+    return array('subject' => $subject, 'content' => $form);
107
+    break;
108 108
   }
109 109
 }
110 110
 
@@ -309,52 +309,52 @@  discard block
 block discarded – undo
309 309
  */
310 310
 function jump_form_alter(&$form, $form_state, $form_id) {
311 311
   switch ($form_id) {
312
-    case 'block_admin_configure':
313
-      if ($form['module']['#value'] === 'jump' && function_exists('ahah_helper_register')) {
314
-        $delta = $form['delta']['#value'];
315
-        ahah_helper_register($form, $form_state);
316
-        $default_jump_use_js = (!isset($form_state['storage']['jump_use_js_' . $delta])) ? variable_get('jump_use_js_' . $delta, 0) : $form_state['storage']['jump_use_js_' . $delta];
317
-        $default_jump_add_select = (!isset($form_state['storage']['jump_add_select_' . $delta])) ? variable_get('jump_add_select_' . $delta, 0) : $form_state['storage']['jump_add_select_' . $delta];
312
+  case 'block_admin_configure':
313
+    if ($form['module']['#value'] === 'jump' && function_exists('ahah_helper_register')) {
314
+      $delta = $form['delta']['#value'];
315
+      ahah_helper_register($form, $form_state);
316
+      $default_jump_use_js = (!isset($form_state['storage']['jump_use_js_' . $delta])) ? variable_get('jump_use_js_' . $delta, 0) : $form_state['storage']['jump_use_js_' . $delta];
317
+      $default_jump_add_select = (!isset($form_state['storage']['jump_add_select_' . $delta])) ? variable_get('jump_add_select_' . $delta, 0) : $form_state['storage']['jump_add_select_' . $delta];
318 318
 
319
-        $form['block_settings']['jump_wrapper'] = array(
320
-          '#prefix' => '<div id="jump-wrapper">',
321
-          '#suffix' => '</div>',
322
-          '#type' => 'markup'
323
-        );
324
-        $form['block_settings']['jump_wrapper']['jump_use_js_' . $delta] = array(
319
+      $form['block_settings']['jump_wrapper'] = array(
320
+        '#prefix' => '<div id="jump-wrapper">',
321
+        '#suffix' => '</div>',
322
+        '#type' => 'markup'
323
+      );
324
+      $form['block_settings']['jump_wrapper']['jump_use_js_' . $delta] = array(
325
+        '#type' => 'checkbox',
326
+        '#title' => t('Hide the submit button and use Javascript to automatically jump to the selected menu item'),
327
+        '#default_value' => $default_jump_use_js,
328
+        '#disabled' => ($default_jump_add_select === 1) ? TRUE : FALSE,
329
+        '#ahah' => array(
330
+          'event' => 'change',
331
+          'path' => ahah_helper_path(array('block_settings', 'jump_wrapper')),
332
+          'wrapper' => 'jump-wrapper',
333
+        ),
334
+      );
335
+      if ($default_jump_use_js === 1) {
336
+        $form['block_settings']['jump_wrapper']['jump_add_select_' . $delta] = array(
325 337
           '#type' => 'checkbox',
326
-          '#title' => t('Hide the submit button and use Javascript to automatically jump to the selected menu item'),
327
-          '#default_value' => $default_jump_use_js,
328
-          '#disabled' => ($default_jump_add_select === 1) ? TRUE : FALSE,
338
+          '#title' => t('Add an empty select option into the list of options'),
339
+          '#default_value' => $default_jump_add_select,
340
+          '#weight' => 1,
329 341
           '#ahah' => array(
330 342
             'event' => 'change',
331 343
             'path' => ahah_helper_path(array('block_settings', 'jump_wrapper')),
332 344
             'wrapper' => 'jump-wrapper',
333 345
           ),
334 346
         );
335
-        if ($default_jump_use_js === 1) {
336
-          $form['block_settings']['jump_wrapper']['jump_add_select_' . $delta] = array(
337
-            '#type' => 'checkbox',
338
-            '#title' => t('Add an empty select option into the list of options'),
339
-            '#default_value' => $default_jump_add_select,
340
-            '#weight' => 1,
341
-            '#ahah' => array(
342
-              'event' => 'change',
343
-              'path' => ahah_helper_path(array('block_settings', 'jump_wrapper')),
344
-              'wrapper' => 'jump-wrapper',
345
-            ),
347
+        if ($default_jump_add_select === 1) {
348
+          $form['block_settings']['jump_wrapper']['jump_add_select_text_' . $delta] = array(
349
+            '#type' => 'textfield',
350
+            '#title' => t('Text to use for the empty select option'),
351
+            '#default_value' => variable_get('jump_add_select_text_' . $delta, t('Select Option')),
352
+            '#weight' => 2
346 353
           );
347
-          if ($default_jump_add_select === 1) {
348
-            $form['block_settings']['jump_wrapper']['jump_add_select_text_' . $delta] = array(
349
-              '#type' => 'textfield',
350
-              '#title' => t('Text to use for the empty select option'),
351
-              '#default_value' => variable_get('jump_add_select_text_' . $delta, t('Select Option')),
352
-              '#weight' => 2
353
-            );
354
-          }
355 354
         }
356 355
       }
357
-      break;
356
+    }
357
+    break;
358 358
   }
359 359
 }
360 360
 
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -52,33 +52,33 @@  discard block
 block discarded – undo
52 52
     case 'list':
53 53
       $blocks = array();
54 54
       foreach (menu_get_menus() as $name => $title) {
55
-        $blocks['menu-' . $name] = array(
55
+        $blocks['menu-'.$name] = array(
56 56
           'info' => t('Jump menu: !menu', array('!menu' => $name))
57 57
         );
58 58
       }
59 59
 
60 60
       $vocs = taxonomy_get_vocabularies();
61 61
       foreach ($vocs as $vid => $vocabulary) {
62
-        $blocks['taxo-' . $vid] = array(
62
+        $blocks['taxo-'.$vid] = array(
63 63
           'info' => t('Jump menu: !voc', array('!voc' => $vocabulary->name))
64 64
         );
65 65
       }
66 66
       return $blocks;
67 67
     case 'configure':
68 68
       $form = array();
69
-      $form['block_settings']['jump_activepageinmenu_' . $delta] = array(
69
+      $form['block_settings']['jump_activepageinmenu_'.$delta] = array(
70 70
         '#type' => 'checkbox',
71 71
         '#title' => t('Show active page in jump menu.'),
72
-        '#default_value' => variable_get('jump_activepageinmenu_' . $delta, 1),
72
+        '#default_value' => variable_get('jump_activepageinmenu_'.$delta, 1),
73 73
         '#description' => t('This setting will force the jump menu to show the current page as the default selection in this block\'s jump menu.'),
74 74
       );
75 75
       // Do the rest of the form additions in hook_form_alter() since we can't do ahah here.
76 76
       return $form;
77 77
     case 'save':
78
-      variable_set('jump_activepageinmenu_' . $delta, $edit['jump_activepageinmenu_' . $delta]);
79
-      variable_set('jump_use_js_' . $delta, $edit['jump_use_js_' . $delta]);
80
-      variable_set('jump_add_select_' . $delta, $edit['jump_add_select_' . $delta]);
81
-      variable_set('jump_add_select_text_' . $delta, $edit['jump_add_select_text_' . $delta]);
78
+      variable_set('jump_activepageinmenu_'.$delta, $edit['jump_activepageinmenu_'.$delta]);
79
+      variable_set('jump_use_js_'.$delta, $edit['jump_use_js_'.$delta]);
80
+      variable_set('jump_add_select_'.$delta, $edit['jump_add_select_'.$delta]);
81
+      variable_set('jump_add_select_text_'.$delta, $edit['jump_add_select_text_'.$delta]);
82 82
       break;
83 83
     case 'view':
84 84
       // The first 5 characters of $delta should be one of:
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $vocab = taxonomy_vocabulary_load($jumpmenu_name);
103 103
         $subject = $vocab->name;
104 104
       }
105
-      if (variable_get('jump_use_js_' . $delta, 0) === 1) drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
105
+      if (variable_get('jump_use_js_'.$delta, 0) === 1) drupal_add_js(drupal_get_path('module', 'jump').'/jump.js');
106 106
       return array('subject' => $subject, 'content' => $form);
107 107
       break;
108 108
   }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
  */
126 126
 function jump_quickly($name = 'navigation', $type = 'menu', $active = -1, $override = '') {
127 127
   // Reconstruct the $delta
128
-  $delta = $type . '-' . $name;
128
+  $delta = $type.'-'.$name;
129 129
   if ($active === -1) {
130 130
     $active = variable_get('jump_activepageinmenu', 1);
131 131
   }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
   static $num_jump_forms = 0;
154 154
   $num_jump_forms++;
155 155
 
156
-  return drupal_get_form('jump_quickly_form_' . $num_jump_forms, $options, $menu_state);
156
+  return drupal_get_form('jump_quickly_form_'.$num_jump_forms, $options, $menu_state);
157 157
 }
158 158
 
159 159
 /**
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
     '#type' => 'submit',
189 189
     '#value' => t('Go')
190 190
   );
191
-  if (variable_get('jump_use_js_' . $menu_state['delta'], 0) === 1) {
191
+  if (variable_get('jump_use_js_'.$menu_state['delta'], 0) === 1) {
192 192
     // Give each menu a unique name.
193
-    $form['#attributes']['name'] = 'jumpquickly' . $menu_state['delta'];
193
+    $form['#attributes']['name'] = 'jumpquickly'.$menu_state['delta'];
194 194
     $form['#attributes']['class'] .= ' js-enabled';
195 195
 //    unset($form['submit']);
196
-    if (variable_get('jump_add_select_' . $menu_state['delta'], 0) === 1) {
196
+    if (variable_get('jump_add_select_'.$menu_state['delta'], 0) === 1) {
197 197
       $form['jump_goto']['#attributes']['class'] = 'first-no-jump';
198 198
       // Add the extra empty select option to the top of the array.
199
-      $form['jump_goto']['#options'] = array('' => variable_get('jump_add_select_text_' . $menu_state['delta'], t('Select Option'))) + $options;
199
+      $form['jump_goto']['#options'] = array('' => variable_get('jump_add_select_text_'.$menu_state['delta'], t('Select Option'))) + $options;
200 200
       $form['jump_goto']['#default_value'] = (array_key_exists($default, $options)) ? $default : '';
201 201
     }
202 202
   }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
   foreach ($tree as $data) {
250 250
     if (!$data['link']['hidden']) {
251 251
       $href = ($data['link']['href'] == '<front>') ? $front : $data['link']['href'];
252
-      $href = (isset($data['link']['options']['fragment'])) ? $href . '#' . $data['link']['options']['fragment'] : $href;
252
+      $href = (isset($data['link']['options']['fragment'])) ? $href.'#'.$data['link']['options']['fragment'] : $href;
253 253
       $options[$href] = $data['link']['title'];
254 254
     }
255 255
   }
@@ -313,15 +313,15 @@  discard block
 block discarded – undo
313 313
       if ($form['module']['#value'] === 'jump' && function_exists('ahah_helper_register')) {
314 314
         $delta = $form['delta']['#value'];
315 315
         ahah_helper_register($form, $form_state);
316
-        $default_jump_use_js = (!isset($form_state['storage']['jump_use_js_' . $delta])) ? variable_get('jump_use_js_' . $delta, 0) : $form_state['storage']['jump_use_js_' . $delta];
317
-        $default_jump_add_select = (!isset($form_state['storage']['jump_add_select_' . $delta])) ? variable_get('jump_add_select_' . $delta, 0) : $form_state['storage']['jump_add_select_' . $delta];
316
+        $default_jump_use_js = (!isset($form_state['storage']['jump_use_js_'.$delta])) ? variable_get('jump_use_js_'.$delta, 0) : $form_state['storage']['jump_use_js_'.$delta];
317
+        $default_jump_add_select = (!isset($form_state['storage']['jump_add_select_'.$delta])) ? variable_get('jump_add_select_'.$delta, 0) : $form_state['storage']['jump_add_select_'.$delta];
318 318
 
319 319
         $form['block_settings']['jump_wrapper'] = array(
320 320
           '#prefix' => '<div id="jump-wrapper">',
321 321
           '#suffix' => '</div>',
322 322
           '#type' => 'markup'
323 323
         );
324
-        $form['block_settings']['jump_wrapper']['jump_use_js_' . $delta] = array(
324
+        $form['block_settings']['jump_wrapper']['jump_use_js_'.$delta] = array(
325 325
           '#type' => 'checkbox',
326 326
           '#title' => t('Hide the submit button and use Javascript to automatically jump to the selected menu item'),
327 327
           '#default_value' => $default_jump_use_js,
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
           ),
334 334
         );
335 335
         if ($default_jump_use_js === 1) {
336
-          $form['block_settings']['jump_wrapper']['jump_add_select_' . $delta] = array(
336
+          $form['block_settings']['jump_wrapper']['jump_add_select_'.$delta] = array(
337 337
             '#type' => 'checkbox',
338 338
             '#title' => t('Add an empty select option into the list of options'),
339 339
             '#default_value' => $default_jump_add_select,
@@ -345,10 +345,10 @@  discard block
 block discarded – undo
345 345
             ),
346 346
           );
347 347
           if ($default_jump_add_select === 1) {
348
-            $form['block_settings']['jump_wrapper']['jump_add_select_text_' . $delta] = array(
348
+            $form['block_settings']['jump_wrapper']['jump_add_select_text_'.$delta] = array(
349 349
               '#type' => 'textfield',
350 350
               '#title' => t('Text to use for the empty select option'),
351
-              '#default_value' => variable_get('jump_add_select_text_' . $delta, t('Select Option')),
351
+              '#default_value' => variable_get('jump_add_select_text_'.$delta, t('Select Option')),
352 352
               '#weight' => 2
353 353
             );
354 354
           }
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
  */
367 367
 function jump_get_active_setting($delta) {
368 368
   $active_site_default = variable_get('jump_activepageinmenu', 1);
369
-  $active = variable_get('jump_activepageinmenu_' . $delta, $active_site_default);
369
+  $active = variable_get('jump_activepageinmenu_'.$delta, $active_site_default);
370 370
   return $active;
371 371
 }
372 372
 
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/jump/jump_views_plugin_style.inc 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 
113 113
     $count = 0;
114 114
     foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
115
-      $token = '%'. ++$count;
115
+      $token = '%'.++$count;
116 116
       if (!isset($tokens[$token])) {
117 117
         $tokens[$token] = '';
118 118
       }
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/forum_access/forum_access.admin.inc 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 function _forum_access_forum_form(&$form, &$form_state, $is_container) {
15 15
   $tid = (isset($form['tid']['#value']) ? $form['tid']['#value'] : NULL);
16 16
   if (isset($tid) && !forum_access_access($tid, 'view', NULL, FALSE)) {
17
-    drupal_access_denied();  // Deny access if the user doesn't have View access.
17
+    drupal_access_denied(); // Deny access if the user doesn't have View access.
18 18
     module_invoke_all('exit');
19 19
     exit;
20 20
   }
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
 
40 40
   $tr = 't';
41 41
   $variables = array(
42
-    '!access_content'                 => '<em>'. l($tr('access content'), 'admin/user/permissions', array('fragment' => 'module-node', 'html' => TRUE)) .'</em>',
43
-    '!access_comments'                => '<em>'. l($tr('access comments'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)) .'</em>',
44
-    '!create_forum_topics'            => '<em>'. l($tr('create forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)) .'</em>',
45
-    '!post_comments'                  => '<em>'. l($tr('post comments'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)) .'</em>',
46
-    '!post_comments_without_approval' => '<em>'. l($tr('post comments without approval'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)) .'</em>',
47
-    '!edit_own_forum_topics'          => '<em>'. l($tr('edit own forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)) .'</em>',
48
-    '!edit_any_forum_topics'          => '<em>'. l($tr('edit any forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)) .'</em>',
49
-    '!delete_own_forum_topics'        => '<em>'. l($tr('delete own forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)) .'</em>',
50
-    '!delete_any_forum_topics'        => '<em>'. l($tr('delete any forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)) .'</em>',
51
-    '!administer_comments'            => '<em>'. l($tr('administer comments'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)) .'</em>',
52
-    '!administer_forums'              => '<em>'. l($tr('administer forums'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)) .'</em>',
53
-    '!administer_nodes'               => '<em>'. l($tr('administer nodes'), 'admin/user/permissions', array('fragment' => 'module-node', 'html' => TRUE)) .'</em>',
42
+    '!access_content'                 => '<em>'.l($tr('access content'), 'admin/user/permissions', array('fragment' => 'module-node', 'html' => TRUE)).'</em>',
43
+    '!access_comments'                => '<em>'.l($tr('access comments'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)).'</em>',
44
+    '!create_forum_topics'            => '<em>'.l($tr('create forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)).'</em>',
45
+    '!post_comments'                  => '<em>'.l($tr('post comments'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)).'</em>',
46
+    '!post_comments_without_approval' => '<em>'.l($tr('post comments without approval'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)).'</em>',
47
+    '!edit_own_forum_topics'          => '<em>'.l($tr('edit own forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)).'</em>',
48
+    '!edit_any_forum_topics'          => '<em>'.l($tr('edit any forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)).'</em>',
49
+    '!delete_own_forum_topics'        => '<em>'.l($tr('delete own forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)).'</em>',
50
+    '!delete_any_forum_topics'        => '<em>'.l($tr('delete any forum topics'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)).'</em>',
51
+    '!administer_comments'            => '<em>'.l($tr('administer comments'), 'admin/user/permissions', array('fragment' => 'module-comment', 'html' => TRUE)).'</em>',
52
+    '!administer_forums'              => '<em>'.l($tr('administer forums'), 'admin/user/permissions', array('fragment' => 'module-forum', 'html' => TRUE)).'</em>',
53
+    '!administer_nodes'               => '<em>'.l($tr('administer nodes'), 'admin/user/permissions', array('fragment' => 'module-node', 'html' => TRUE)).'</em>',
54 54
   );
55 55
   if (!$is_container) {
56 56
     $form['forum_access']['permissions'] = array(
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
     );
62 62
     $form['forum_access']['permissions'][] = array(
63 63
       '#type' => 'markup',
64
-      '#value' => '<div>'. t('Note that users need') .'<ul style="margin-top: 0"><li>'.
65
-                           t('the !access_content and !access_comments permissions <strong>AND <em>View</em></strong> to be able to see this forum and its content at all,', $variables) .'</li><li>'.
66
-                           t('the !create_forum_topics (and similar) permissions <strong>AND <em>Post</em></strong> to be able to create forum content, and', $variables) .'</li><li>'.
67
-                           t('the !post_comments and (probably) !post_comments_without_approval permission <!TAG>AND <em>Comment</em></!TAG> to be able to post comments/replies;', $variables + array('!TAG' => (variable_get('forum_access_D5_legacy_mode', FALSE) ? 'del title="'. t('Drupal 5 legacy mode') .'"' : 'strong'))) .'</li><li>'.
68
-                           t('the !edit_own_forum_topics or !edit_any_forum_topics (and similar) permissions <strong>AND (<em>Edit</em> AND <em>Comment</em></strong>) can be added if desired, <strong>plus</strong>', $variables) .'</li><li>'.
69
-                           t('the !delete_own_forum_topics or !delete_any_forum_topics (and similar) permissions (<strong>OR <em>Delete</em></strong>) if desired;', $variables) .'</li><li>'.
70
-                           t('the !administer_comments (global!) permission <strong>OR <em>Edit</em>/<em>Delete</em></strong> to be able to edit/delete comments;', $variables) .'</li><li>'.
71
-                           t('the !administer_forums permission <strong>AND <em>View</em></strong> to be able to administer forums (and change access!).', $variables) .'</li></ul>'.
72
-                           t('Furthermore note that content which is not published is treated in a different way by Drupal: it can be viewed only by its author or by users with the !administer_nodes permission. Unpublished comments and replies are accessible to users with <strong><em>Edit</em> OR <em>Delete</em></strong>, <strong>OR</strong> with the !administer_comments permission, but they are never counted on the forum page.', $variables) .'</div>',
64
+      '#value' => '<div>'.t('Note that users need').'<ul style="margin-top: 0"><li>'.
65
+                           t('the !access_content and !access_comments permissions <strong>AND <em>View</em></strong> to be able to see this forum and its content at all,', $variables).'</li><li>'.
66
+                           t('the !create_forum_topics (and similar) permissions <strong>AND <em>Post</em></strong> to be able to create forum content, and', $variables).'</li><li>'.
67
+                           t('the !post_comments and (probably) !post_comments_without_approval permission <!TAG>AND <em>Comment</em></!TAG> to be able to post comments/replies;', $variables + array('!TAG' => (variable_get('forum_access_D5_legacy_mode', FALSE) ? 'del title="'.t('Drupal 5 legacy mode').'"' : 'strong'))).'</li><li>'.
68
+                           t('the !edit_own_forum_topics or !edit_any_forum_topics (and similar) permissions <strong>AND (<em>Edit</em> AND <em>Comment</em></strong>) can be added if desired, <strong>plus</strong>', $variables).'</li><li>'.
69
+                           t('the !delete_own_forum_topics or !delete_any_forum_topics (and similar) permissions (<strong>OR <em>Delete</em></strong>) if desired;', $variables).'</li><li>'.
70
+                           t('the !administer_comments (global!) permission <strong>OR <em>Edit</em>/<em>Delete</em></strong> to be able to edit/delete comments;', $variables).'</li><li>'.
71
+                           t('the !administer_forums permission <strong>AND <em>View</em></strong> to be able to administer forums (and change access!).', $variables).'</li></ul>'.
72
+                           t('Furthermore note that content which is not published is treated in a different way by Drupal: it can be viewed only by its author or by users with the !administer_nodes permission. Unpublished comments and replies are accessible to users with <strong><em>Edit</em> OR <em>Delete</em></strong>, <strong>OR</strong> with the !administer_comments permission, but they are never counted on the forum page.', $variables).'</div>',
73 73
     );
74 74
   }
75 75
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
       '#collapsed' => empty($template_tid),
83 83
   );
84 84
   $form['forum_access']['template']['taxonomy'][$vid] = taxonomy_form($vid, array($template_tid), '');
85
-  $form['forum_access']['template']['taxonomy'][$vid]['#description'] = t("Select a forum and click !Load to retrieve that forum's settings as a starting point for this forum or container.", array('!Load' => '['. t('Load') .']'));
85
+  $form['forum_access']['template']['taxonomy'][$vid]['#description'] = t("Select a forum and click !Load to retrieve that forum's settings as a starting point for this forum or container.", array('!Load' => '['.t('Load').']'));
86 86
   $form['forum_access']['template']['load_button'] = array(
87 87
     '#type' => 'button',
88 88
     '#name' => 'load_template',
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     );
206 206
   }
207 207
 
208
-  drupal_add_css(drupal_get_path('module', 'forum_access') .'/forum_access.css');
208
+  drupal_add_css(drupal_get_path('module', 'forum_access').'/forum_access.css');
209 209
 
210 210
   // Find our moderator ACL:
211 211
   if (isset($tid)) {  // edit, not new
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
     $form['forum_access']['acl'] = acl_edit_form($acl_id, t('Moderators'));
223 223
     $form['forum_access']['acl'][] = array(
224 224
       '#type' => 'markup',
225
-      '#value' => '<div>'. t('Moderators receive all grants above.') .'</div>',
225
+      '#value' => '<div>'.t('Moderators receive all grants above.').'</div>',
226 226
       '#weight' => -1,
227 227
     );
228 228
     $form['forum_access']['acl']['note'] = array(
229 229
       '#type' => 'markup',
230
-      '#value' => '<div>'. t('Note: Changes to moderators are not saved until you click [!Save] below.', array('!Save' => $tr('Save'))) .'</div>',
230
+      '#value' => '<div>'.t('Note: Changes to moderators are not saved until you click [!Save] below.', array('!Save' => $tr('Save'))).'</div>',
231 231
     );
232 232
     $form['forum_access']['acl']['#after_build'][] = '_forum_access_forum_form_after_build_acl0';
233 233
     $form['forum_access']['acl']['#after_build'] = array_reverse($form['forum_access']['acl']['#after_build']);
@@ -251,11 +251,11 @@  discard block
 block discarded – undo
251 251
       '!Content_Access' => l('Content Access', 'http://drupal.org/project/content_access'),
252 252
       '@Content_Access' => 'Content Access',
253 253
       '!ACL' => 'ACL',
254
-      '!module_list' => '<ul><li>'. implode($na_modules, '</li><li>') .'</li></ul>',
254
+      '!module_list' => '<ul><li>'.implode($na_modules, '</li><li>').'</li></ul>',
255 255
     );
256 256
     $form['forum_access']['interference'][] = array(
257 257
       '#type' => 'item',
258
-      '#value' => '<p>'. t("Besides !Forum_Access (and !ACL) you have installed the following node access module(s): !module_list   The grants of every module are combined for each node. Access can only be granted, not removed &mdash; if a certain module grants a permission, the other(s) cannot deny it.", $variables) .'</p>',
258
+      '#value' => '<p>'.t("Besides !Forum_Access (and !ACL) you have installed the following node access module(s): !module_list   The grants of every module are combined for each node. Access can only be granted, not removed &mdash; if a certain module grants a permission, the other(s) cannot deny it.", $variables).'</p>',
259 259
       '#description' => t('Forums can contain other content types besides %content_type; !Forum_Access will contribute the grants defined above to every node in this forum, but other node access control modules may also contribute their grants, especially to nodes of types other than %content_type.', $variables),
260 260
     );
261 261
 
@@ -282,25 +282,25 @@  discard block
 block discarded – undo
282 282
           '#attributes' => array('class' => 'error'),
283 283
         );
284 284
         $form['forum_access']['interference']['by_content_access'][] = array(
285
-          '#value' => '<div>'. t('You have set the !Content_Access module to control access to content of type %content_type&mdash;this can interfere with proper operation of !Forum_Access!', $variables) ." $specifically</div>",
285
+          '#value' => '<div>'.t('You have set the !Content_Access module to control access to content of type %content_type&mdash;this can interfere with proper operation of !Forum_Access!', $variables)." $specifically</div>",
286 286
         );
287 287
         if ($ca_priority == $fa_priority) {
288 288
           $form['forum_access']['interference']['by_content_access'][] = array(
289
-            '#value' => '<div>'. t("Unless you really know what you're doing, we recommend that you go to the !link page and clear all checkboxes. This will instruct @Content_Access to leave the %content_type nodes alone. However, if you put nodes of other content types into forums as well, then these content types will continue to have this problem.", $variables) .'</div>',
289
+            '#value' => '<div>'.t("Unless you really know what you're doing, we recommend that you go to the !link page and clear all checkboxes. This will instruct @Content_Access to leave the %content_type nodes alone. However, if you put nodes of other content types into forums as well, then these content types will continue to have this problem.", $variables).'</div>',
290 290
           );
291 291
         }
292 292
         else {
293 293
           $form['forum_access']['interference']['by_content_access'][] = array(
294
-            '#value' => '<div>'. t("The priority of @Content_Access ($ca_priority) is higher than the priority of !Forum_Access ($fa_priority), which means the latter is <strong>completely disabled</strong> for the %content_type type! Unless you really know what you're doing, we recommend that you go to the !link page, change the priority (under %Advanced) to 0, and clear all checkboxes.", $variables) .'</div>',
294
+            '#value' => '<div>'.t("The priority of @Content_Access ($ca_priority) is higher than the priority of !Forum_Access ($fa_priority), which means the latter is <strong>completely disabled</strong> for the %content_type type! Unless you really know what you're doing, we recommend that you go to the !link page, change the priority (under %Advanced) to 0, and clear all checkboxes.", $variables).'</div>',
295 295
           );
296 296
         }
297 297
         $form['forum_access']['interference']['by_content_access'][] = array(
298
-          '#value' => '<div>'. t("Alternatively, you can give !Forum_Access priority over @Content_Access by either raising the priority of !Forum_Access in every forum above the priority of @Content_Access, or by lowering the priority of @Content_Access for the content types in question below the priority of !Forum_Access.", $variables) .'</div>',
298
+          '#value' => '<div>'.t("Alternatively, you can give !Forum_Access priority over @Content_Access by either raising the priority of !Forum_Access in every forum above the priority of @Content_Access, or by lowering the priority of @Content_Access for the content types in question below the priority of !Forum_Access.", $variables).'</div>',
299 299
         );
300 300
       }
301 301
       else {
302 302
         $form['forum_access']['interference'][] = array(
303
-          '#value' => '<p>'. t('Note: You have installed the !Content_Access module, which has the capability to grant access to content that would otherwise be protected by !Forum_Access. Be careful when configuring @Content_Access!', $variables) .'</p>',
303
+          '#value' => '<p>'.t('Note: You have installed the !Content_Access module, which has the capability to grant access to content that would otherwise be protected by !Forum_Access. Be careful when configuring @Content_Access!', $variables).'</p>',
304 304
         );
305 305
       }
306 306
     }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
       '!DNA'                 => 'DNA',
332 332
       '!debug_mode'          => l('debug mode', 'admin/settings/devel', array('fragment' => 'edit-devel-node-access-debug-mode')),
333 333
       '!dna_summary'         => l('devel/node_access/summary', 'devel/node_access/summary'),
334
-      '!Rebuild_permissions' => '['. $tr('Rebuild permissions') .']',
334
+      '!Rebuild_permissions' => '['.$tr('Rebuild permissions').']',
335 335
       '!Post_settings_link'  => l('admin/content/node-settings', 'admin/content/node-settings'),
336 336
       '!Forum_Access_'       => l('Forum Access', 'http://drupal.org/project/issues/forum_access'),
337 337
       '!ACL_'                => l('ACL', 'http://drupal.org/project/issues/acl'),
@@ -344,26 +344,26 @@  discard block
 block discarded – undo
344 344
     );
345 345
     $form['forum_access']['troubleshooting'][] = array(
346 346
       '#type' => 'item',
347
-      '#value' => '<div>'.    t("In case of problems, follow these steps until you've got it worked out:") .'<ol style="margin-top: 0"><li>'.
348
-                              t("Update to the 'recommended' !Forum_Access and !ACL releases for your version of Drupal.", $variables) .'</li><li>'.
349
-        (count($na_modules) ? t("Read %Module_interference above and update your other node access modules.", $variables) .'</li><li>' : '') .
350
-                              t("Check the release notes of the development snapshots for issues that might have been fixed in !Forum_Access-dev or !ACL-dev since the latest release.", $variables) .'</li><li>'.
351
-                              t("Install the %devel_node_access module (!DNA, part of the !Devel module) and enable its !debug_mode: !DNA will show you all the grants that actually control your nodes in a footer block on each node's page.", $variables) .'</li><li>'.
352
-                              t("Additional insight can be gained from !dna_summary and by enabling the second !DNA block.", $variables) .'</li><li>'.
353
-                              t("Click !Rebuild_permissions on !Post_settings_link and check DNA for changes.", $variables) .'</li><li>'.
354
-                              t("Check the issues queues of !Forum_Access_ and !ACL_ for existing reports and possible solutions.", $variables) .'</li><li>'.
355
-                              t("If all of this hasn't helped, then pick ONE node that is misbehaving, look at it using an account that can see the node (and that should NOT have access if that's your problem!), create a new issue in the issues queue, describe the problem... <ul><li> what did you do? </li><li> what did you expect? </li><li> what happened instead? </li></ul> ... and <strong>attach a screenshot of all the DNA records</strong> for that one node. <br /> Be sure to indicate paths (URLs) for every page and module that you mention.") .'</li></ol></div>',
347
+      '#value' => '<div>'.t("In case of problems, follow these steps until you've got it worked out:").'<ol style="margin-top: 0"><li>'.
348
+                              t("Update to the 'recommended' !Forum_Access and !ACL releases for your version of Drupal.", $variables).'</li><li>'.
349
+        (count($na_modules) ? t("Read %Module_interference above and update your other node access modules.", $variables).'</li><li>' : '').
350
+                              t("Check the release notes of the development snapshots for issues that might have been fixed in !Forum_Access-dev or !ACL-dev since the latest release.", $variables).'</li><li>'.
351
+                              t("Install the %devel_node_access module (!DNA, part of the !Devel module) and enable its !debug_mode: !DNA will show you all the grants that actually control your nodes in a footer block on each node's page.", $variables).'</li><li>'.
352
+                              t("Additional insight can be gained from !dna_summary and by enabling the second !DNA block.", $variables).'</li><li>'.
353
+                              t("Click !Rebuild_permissions on !Post_settings_link and check DNA for changes.", $variables).'</li><li>'.
354
+                              t("Check the issues queues of !Forum_Access_ and !ACL_ for existing reports and possible solutions.", $variables).'</li><li>'.
355
+                              t("If all of this hasn't helped, then pick ONE node that is misbehaving, look at it using an account that can see the node (and that should NOT have access if that's your problem!), create a new issue in the issues queue, describe the problem... <ul><li> what did you do? </li><li> what did you expect? </li><li> what happened instead? </li></ul> ... and <strong>attach a screenshot of all the DNA records</strong> for that one node. <br /> Be sure to indicate paths (URLs) for every page and module that you mention.").'</li></ol></div>',
356 356
     );
357 357
     $form['forum_access']['troubleshooting'][] = array(
358 358
       '#type' => 'item',
359
-      '#value' => '<div>'. t("Note: You should not keep the !Devel module enabled on a production site.", $variables) .'</div>',
359
+      '#value' => '<div>'.t("Note: You should not keep the !Devel module enabled on a production site.", $variables).'</div>',
360 360
     );
361 361
   }
362 362
 
363 363
   if (!$is_container && isset($tid) && !node_access_needs_rebuild()) {
364 364
     $count = db_result(db_query("SELECT COUNT(DISTINCT n.nid) FROM {node} n INNER JOIN {term_node} tn ON tn.vid = n.vid WHERE tn.tid = %d", $tid));
365
-    $limit = 20;   // from _node_access_rebuild_batch_operation()
366
-    $threshold = variable_get('forum_access_batch_threshold', $limit);  // change the variable if you want
365
+    $limit = 20; // from _node_access_rebuild_batch_operation()
366
+    $threshold = variable_get('forum_access_batch_threshold', $limit); // change the variable if you want
367 367
     $form['forum_access']['update_limit'] = array(
368 368
       '#type' => 'value',
369 369
       '#value' => $limit,
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
   $element_children = element_children($element);
442 442
   foreach ($element_children as $rid) {
443 443
     if ($rid == $moderator_rid) {
444
-      $element[$rid]['#prefix'] = '<span title="'. t("This is the (temporary) @Forum_Moderator role; it has the '@administer_nodes' and '@administer_comments' permissions and is only used temporarily by @Forum_Access &mdash; do NOT give this role to any user!", array('@Forum_Moderator' => t('Forum Moderator'), '@administer_nodes' => $tr('administer nodes'), '@administer_comments' => $tr('administer comments'), '@Forum_Access' => 'Forum Access')) .'" class="forum-access-temporary-moderator">';
444
+      $element[$rid]['#prefix'] = '<span title="'.t("This is the (temporary) @Forum_Moderator role; it has the '@administer_nodes' and '@administer_comments' permissions and is only used temporarily by @Forum_Access &mdash; do NOT give this role to any user!", array('@Forum_Moderator' => t('Forum Moderator'), '@administer_nodes' => $tr('administer nodes'), '@administer_comments' => $tr('administer comments'), '@Forum_Access' => 'Forum Access')).'" class="forum-access-temporary-moderator">';
445 445
       $element[$rid]['#suffix'] = "</span>";
446 446
       $element[$rid]['#default_value'] = TRUE;
447 447
       $element[$rid]['#disabled'] = TRUE;
@@ -452,19 +452,19 @@  discard block
 block discarded – undo
452 452
     elseif ($element['#parents'][1] == 'comment_create') {
453 453
     }
454 454
     elseif ($element['#parents'][1] == 'view' && isset($permissions[$rid]['administer forums'])) {
455
-      $element[$rid]['#title'] = '<em>'. $element[$rid]['#title'] .'</em>';
456
-      $element[$rid]['#prefix'] = '<span title="'. t("This role has the '@administer_forums' permission, and granting '@View' enables the role holders to change the settings on this page, including @Access_control!", array('@administer_forums' => $tr('administer forums'), '@View' => t('View'), '@Access_control' => t('Access control'))) .'">';
455
+      $element[$rid]['#title'] = '<em>'.$element[$rid]['#title'].'</em>';
456
+      $element[$rid]['#prefix'] = '<span title="'.t("This role has the '@administer_forums' permission, and granting '@View' enables the role holders to change the settings on this page, including @Access_control!", array('@administer_forums' => $tr('administer forums'), '@View' => t('View'), '@Access_control' => t('Access control'))).'">';
457 457
       if (isset($permissions[$rid]['administer nodes'])) {
458
-        $element[$rid]['#prefix'] = str_replace('">', ' '. t("Because the role also has the '@administer_nodes' permission, it has full access to all nodes either way.", array('@administer_nodes' => $tr('administer nodes'))) .'">', $element[$rid]['#prefix']);
458
+        $element[$rid]['#prefix'] = str_replace('">', ' '.t("Because the role also has the '@administer_nodes' permission, it has full access to all nodes either way.", array('@administer_nodes' => $tr('administer nodes'))).'">', $element[$rid]['#prefix']);
459 459
       }
460 460
       $element[$rid]['#suffix'] = "</span>";
461 461
     }
462 462
     elseif (isset($permissions[$rid]['administer nodes'])) {
463 463
       $element[$rid]['#disabled'] = TRUE;
464 464
       $element[$rid]['#default_value'] = TRUE;
465
-      $element[$rid]['#prefix'] = '<span title="'. ($rid != $moderator_rid
465
+      $element[$rid]['#prefix'] = '<span title="'.($rid != $moderator_rid
466 466
                                                     ? t("This role has the '@administer_nodes' permission and thus full access to all nodes.", array('@administer_nodes' => $tr('administer nodes')))
467
-                                                    : t("This is the @Forum_Moderator role; it has the '@administer_nodes' and '@administer_comments' permissions and thus full access to all nodes and comments.", array('@Forum_Moderator' => t('Forum Moderator'), '@administer_nodes' => $tr('administer nodes'), '@administer_comments' => $tr('administer comments')))) .'">';
467
+                                                    : t("This is the @Forum_Moderator role; it has the '@administer_nodes' and '@administer_comments' permissions and thus full access to all nodes and comments.", array('@Forum_Moderator' => t('Forum Moderator'), '@administer_nodes' => $tr('administer nodes'), '@administer_comments' => $tr('administer comments')))).'">';
468 468
       $element[$rid]['#suffix'] = "</span>";
469 469
     }
470 470
   }
@@ -560,12 +560,12 @@  discard block
 block discarded – undo
560 560
     variable_del('forum_access_new_template_tid');
561 561
   }
562 562
   module_load_include('node.inc', 'forum_access');
563
-  $moderator_rid = _forum_access_get_moderator_rid(TRUE);  // create the moderators role if it doesn't exist
563
+  $moderator_rid = _forum_access_get_moderator_rid(TRUE); // create the moderators role if it doesn't exist
564 564
 
565 565
   // check for changes
566 566
   $is_changed = $is_new = strpos($_GET['q'], 'admin/content/forum/add/') === 0;
567 567
   $is_changed = $is_changed || !empty($access['force_update']);
568
-  $form_initial_values = $form;  // avoid Coder warning
568
+  $form_initial_values = $form; // avoid Coder warning
569 569
   $form_initial_values = $form_initial_values['forum_access'];
570 570
   foreach (array('view', 'create', 'comment_create', 'update', 'delete') as $grant_type) {
571 571
     if (isset($form_initial_values[$grant_type])) {
@@ -610,11 +610,11 @@  discard block
 block discarded – undo
610 610
     }
611 611
     else {
612 612
       db_query("INSERT INTO {forum_access} (tid, rid, grant_view, grant_update, grant_delete, grant_create, grant_comment_create, priority) VALUES (%d, %d, %d, %d, %d, %d, %d, %d)",
613
-      $tid, $rid, (bool) $checked, !empty($access['update'][$rid]), !empty($access['delete'][$rid]), !empty($access['create'][$rid]), !empty($access['comment_create'][$rid]), $fa_priority);
613
+      $tid, $rid, (bool)$checked, !empty($access['update'][$rid]), !empty($access['delete'][$rid]), !empty($access['create'][$rid]), !empty($access['comment_create'][$rid]), $fa_priority);
614 614
     }
615 615
   }
616 616
   $tr = 't';
617
-  $link = l($tr('edit'), 'admin/content/forum/edit/forum/'. $tid);
617
+  $link = l($tr('edit'), 'admin/content/forum/edit/forum/'.$tid);
618 618
   watchdog('access', 'Changed grants for %forum forum.', array('%forum' => $form_state['values']['name']), WATCHDOG_NOTICE, $link);
619 619
 
620 620
   if (!$is_new && $form_state['values']['form_id'] != 'forum_form_container') {
@@ -628,10 +628,10 @@  discard block
 block discarded – undo
628 628
       $context = array();
629 629
       $pending_error_messages = drupal_get_messages('error', FALSE);
630 630
       $our_error_message_index = (isset($pending_error_messages['error']) ? count($pending_error_messages['error']) : 0);
631
-      _forum_access_update_batch_finished(FALSE, array(), array());       // add our error message (in case we die underway)
631
+      _forum_access_update_batch_finished(FALSE, array(), array()); // add our error message (in case we die underway)
632 632
       _forum_access_update_batch_operation($tid, 999999, 1, $context);
633
-      $pending_error_messages = drupal_get_messages('error', TRUE);       // still alive, get and clear all 'error' messages
634
-      unset($pending_error_messages['error'][$our_error_message_index]);  // remove our error message
633
+      $pending_error_messages = drupal_get_messages('error', TRUE); // still alive, get and clear all 'error' messages
634
+      unset($pending_error_messages['error'][$our_error_message_index]); // remove our error message
635 635
       foreach ($pending_error_messages['error'] as $message) {            // replay any others
636 636
         drupal_set_message($message, 'error');
637 637
       }
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
       $count = db_result(db_query("SELECT COUNT(DISTINCT n.nid) FROM {node} n INNER JOIN {term_node} tn ON tn.vid = n.vid WHERE tn.tid = %d", $tid));
645 645
       $batch = array(
646 646
         'title' => t('Updating content access permissions'),
647
-        'file' => drupal_get_path('module', 'forum_access') .'/forum_access.admin.inc',
647
+        'file' => drupal_get_path('module', 'forum_access').'/forum_access.admin.inc',
648 648
         'operations' => array(
649 649
           array('_forum_access_update_batch_operation', array($tid, $limit, $count)),
650 650
         ),
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
     }
655 655
   }
656 656
 
657
-  variable_del('forum_access_rids');  // clear cache
657
+  variable_del('forum_access_rids'); // clear cache
658 658
 }
659 659
 
660 660
 /**
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 
688 688
   // Multistep processing : report progress.
689 689
   if ($context['sandbox']['progress'] != $context['sandbox']['max']) {
690
-    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
690
+    $context['finished'] = $context['sandbox']['progress']/$context['sandbox']['max'];
691 691
   }
692 692
 }
693 693
 
@@ -829,8 +829,8 @@  discard block
 block discarded – undo
829 829
   );
830 830
   if (arg(3) == 'forum') {
831 831
     drupal_set_message(t('Note: In Drupal, access can only be granted, not taken away. Whatever access you grant here will not be reflected in the !Forum_Access_link settings, but !Forum_Access can only allow <i>more</i> access, not less.', $variables)
832
-      .'<br /><span class="error">'. t('Specifically, any rights granted to the %anonymous_user and/or the %authenticated_user will <b>override</b> the settings of !Forum_Access!', $variables) .'</span>'
833
-      .'<br />'. t('To avoid conflicts with !Forum_Access settings, you may want to lower the priority of !Content_Access (under %Advanced below) below the priority of !Forum_Access for the content types that you want to be controlled by !Forum_Access.', $variables), 'warning');
832
+      .'<br /><span class="error">'.t('Specifically, any rights granted to the %anonymous_user and/or the %authenticated_user will <b>override</b> the settings of !Forum_Access!', $variables).'</span>'
833
+      .'<br />'.t('To avoid conflicts with !Forum_Access settings, you may want to lower the priority of !Content_Access (under %Advanced below) below the priority of !Forum_Access for the content types that you want to be controlled by !Forum_Access.', $variables), 'warning');
834 834
   }
835 835
   else {
836 836
     $vid = _forum_access_get_vid();
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
   if (isset($moderator_rid) && isset($form['account']['roles']['#options'][$moderator_rid])) {
894 894
     $form['account']['roles'][$moderator_rid] = array(
895 895
       '#type' => 'checkbox',
896
-      '#title' => $form['account']['roles']['#options'][$moderator_rid] .' ('. t('reserved for internal use by the @Forum_Access module', array('@Forum_Access' => 'Forum Access')) .')',
896
+      '#title' => $form['account']['roles']['#options'][$moderator_rid].' ('.t('reserved for internal use by the @Forum_Access module', array('@Forum_Access' => 'Forum Access')).')',
897 897
       '#default_value' => in_array($moderator_rid, $form['account']['roles']['#default_value']),
898 898
       '#disabled' => TRUE,
899 899
     );
@@ -930,8 +930,8 @@  discard block
 block discarded – undo
930 930
     else {
931 931
       $msg = t('!Forum_Access cannot create the %role role!', $variables);
932 932
       watchdog('user', $msg, NULL, WATCHDOG_WARNING);
933
-      drupal_set_message($msg .' '. t('Is it already in use?'), 'error');
934
-      $role->name = $role_name .' '. $i;
933
+      drupal_set_message($msg.' '.t('Is it already in use?'), 'error');
934
+      $role->name = $role_name.' '.$i;
935 935
     }
936 936
   }
937 937
   $msg = t('!Forum_Access has given up and will not work correctly! Rename one of the roles listed above, so that !Forum_Access can use its name.', $variables);
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/forum_access/forum_access.module 2 patches
Switch Indentation   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -86,75 +86,75 @@  discard block
 block discarded – undo
86 86
   }
87 87
 
88 88
   switch (arg(0)) {
89
-    case 'comment':
90
-      if (variable_get('forum_access_D5_legacy_mode', FALSE)) {
91
-        return; // disable comment access control
92
-      }
93
-      if ((arg(1) == 'edit' || arg(1) == 'delete') && !user_access('administer comments')) {
94
-        if (is_numeric($cid = arg(2))) { // comment/edit/%, comment/delete/%
95
-          $access[] = (arg(1) == 'edit' ? 'update' : 'delete');
96
-          $comment = _comment_load($cid);
97
-          $nid = $comment->nid;
98
-          // If the node turns out to be in a forum where we have update/delete
99
-          // access, then we need Moderator permissions now, so we can moderate
100
-          // this comment.
101
-          // We won't provide full Administrator access, though: we'll remove
102
-          // author and timestamp, for example.
103
-          $grant_normal_access = TRUE;
104
-        }
89
+  case 'comment':
90
+    if (variable_get('forum_access_D5_legacy_mode', FALSE)) {
91
+      return; // disable comment access control
92
+    }
93
+    if ((arg(1) == 'edit' || arg(1) == 'delete') && !user_access('administer comments')) {
94
+      if (is_numeric($cid = arg(2))) { // comment/edit/%, comment/delete/%
95
+        $access[] = (arg(1) == 'edit' ? 'update' : 'delete');
96
+        $comment = _comment_load($cid);
97
+        $nid = $comment->nid;
98
+        // If the node turns out to be in a forum where we have update/delete
99
+        // access, then we need Moderator permissions now, so we can moderate
100
+        // this comment.
101
+        // We won't provide full Administrator access, though: we'll remove
102
+        // author and timestamp, for example.
103
+        $grant_normal_access = TRUE;
105 104
       }
106
-      break;
105
+    }
106
+    break;
107 107
 
108
-    case 'node':
109
-      if (is_numeric(arg(1))) {
110
-        if (arg(2) == 'edit' && !user_access('administer nodes')) { // node/%/edit
111
-          $access[] = 'update';
112
-          $nid = arg(1);
113
-          // If the node turns out to be in a forum where we have update/delete
114
-          // access, then we already get limited edit capabilities from NA, but
115
-          // we need some more, e.g. publish/unpublish and comment status.
116
-          // In order to get these controls on the form, we need Moderator
117
-          // permissions now.
118
-          // We won't provide full Administrator access, though: we'll remove
119
-          // author and timestamp, for example.
120
-        }
121
-        if (arg(2) == 'delete' && !user_access('administer nodes')) { // node/%/delete
122
-          $access = array();
123
-          $nid = arg(1);
124
-          // This is the delete confirmation page. We don't need any
125
-          // additional permissions, but we'll assert 'view' access below.
126
-        }
127
-        if (arg(2) == NULL && !user_access('administer comments')) { // node/%
128
-          $access[] = 'update';
129
-          $nid = arg(1);
130
-          // If the node turns out to be in a forum where we have update/delete
131
-          // access, then we'll get the 'Edit' link automatically from NA, but
132
-          // we'll need Moderator permissions, so that we can add the edit/delete
133
-          // comment links (*after* we've identified the other comment links).
134
-        }
108
+  case 'node':
109
+    if (is_numeric(arg(1))) {
110
+      if (arg(2) == 'edit' && !user_access('administer nodes')) { // node/%/edit
111
+        $access[] = 'update';
112
+        $nid = arg(1);
113
+        // If the node turns out to be in a forum where we have update/delete
114
+        // access, then we already get limited edit capabilities from NA, but
115
+        // we need some more, e.g. publish/unpublish and comment status.
116
+        // In order to get these controls on the form, we need Moderator
117
+        // permissions now.
118
+        // We won't provide full Administrator access, though: we'll remove
119
+        // author and timestamp, for example.
135 120
       }
136
-      break;
137
-
138
-    case 'community':
139
-        if (arg(1)=='forum') {
140
-            if (is_numeric(arg(2))) {
141
-                $tid=arg(2);
142
-                // Obtain the tid from a URL path containing
143
-                // community/forum/%tid, this will prevent users from
144
-                // loading forums they are not allowed to access.
145
-                // However, only tid>1 are terms we care about. (This
146
-                // allows forum_tweaks mark-read functionality to
147
-                // work.)
148
-                if (isset($tid) and ($tid>1)) {
149
-                    if (!forum_access_access($tid, 'view')) {
150
-                        drupal_access_denied();
151
-                        module_invoke_all('exit');
152
-                        exit;
153
-                    }
154
-                }// isset($tid)
155
-            }// is_numeric(arg(2))
156
-        }// arg(1)==forum
121
+      if (arg(2) == 'delete' && !user_access('administer nodes')) { // node/%/delete
122
+        $access = array();
123
+        $nid = arg(1);
124
+        // This is the delete confirmation page. We don't need any
125
+        // additional permissions, but we'll assert 'view' access below.
126
+      }
127
+      if (arg(2) == NULL && !user_access('administer comments')) { // node/%
128
+        $access[] = 'update';
129
+        $nid = arg(1);
130
+        // If the node turns out to be in a forum where we have update/delete
131
+        // access, then we'll get the 'Edit' link automatically from NA, but
132
+        // we'll need Moderator permissions, so that we can add the edit/delete
133
+        // comment links (*after* we've identified the other comment links).
134
+      }
135
+    }
157 136
     break;
137
+
138
+  case 'community':
139
+      if (arg(1)=='forum') {
140
+          if (is_numeric(arg(2))) {
141
+              $tid=arg(2);
142
+              // Obtain the tid from a URL path containing
143
+              // community/forum/%tid, this will prevent users from
144
+              // loading forums they are not allowed to access.
145
+              // However, only tid>1 are terms we care about. (This
146
+              // allows forum_tweaks mark-read functionality to
147
+              // work.)
148
+              if (isset($tid) and ($tid>1)) {
149
+                  if (!forum_access_access($tid, 'view')) {
150
+                      drupal_access_denied();
151
+                      module_invoke_all('exit');
152
+                      exit;
153
+                  }
154
+              }// isset($tid)
155
+          }// is_numeric(arg(2))
156
+      }// arg(1)==forum
157
+  break;
158 158
   }// switch
159 159
   if (isset($nid)) {
160 160
     $node = node_load($nid);
@@ -244,36 +244,36 @@  discard block
 block discarded – undo
244 244
   global $user;
245 245
   $sql = NULL;
246 246
   switch ($primary_field) {
247
-    case 'tid':
248
-      if ($user->uid == 1
249
-        || user_access('administer nodes') && strpos($_GET['q'], 'node/add/forum') === FALSE
250
-        || user_access('administer forums') && $_GET['q'] == 'admin/content/forum') {
251
-        break;
252
-      }
253
-      if (strpos($_GET['q'], 'node/add/forum') !== FALSE) {
254
-        $required_access = 'create';
255
-      }
256
-      else {
257
-        $required_access = 'view';
258
-      }
259
-      $roles = implode(', ', array_keys($user->roles));
260
-      $sql['join'] = "LEFT JOIN {forum_access} fa ON $primary_table.tid = fa.tid
247
+  case 'tid':
248
+    if ($user->uid == 1
249
+      || user_access('administer nodes') && strpos($_GET['q'], 'node/add/forum') === FALSE
250
+      || user_access('administer forums') && $_GET['q'] == 'admin/content/forum') {
251
+      break;
252
+    }
253
+    if (strpos($_GET['q'], 'node/add/forum') !== FALSE) {
254
+      $required_access = 'create';
255
+    }
256
+    else {
257
+      $required_access = 'view';
258
+    }
259
+    $roles = implode(', ', array_keys($user->roles));
260
+    $sql['join'] = "LEFT JOIN {forum_access} fa ON $primary_table.tid = fa.tid
261 261
                       LEFT JOIN {acl} acl_fa ON acl_fa.number = $primary_table.tid AND acl_fa.module = 'forum_access'
262 262
                       LEFT JOIN {acl_user} aclu_fa ON aclu_fa.acl_id = acl_fa.acl_id AND aclu_fa.uid = $user->uid";
263
-      $sql['where'] = "(fa.grant_$required_access >= 1 AND fa.rid IN ($roles)) OR fa.tid IS NULL OR aclu_fa.uid = $user->uid";
264
-      $sql['distinct'] = 1;
265
-      break;
263
+    $sql['where'] = "(fa.grant_$required_access >= 1 AND fa.rid IN ($roles)) OR fa.tid IS NULL OR aclu_fa.uid = $user->uid";
264
+    $sql['distinct'] = 1;
265
+    break;
266 266
 
267
-    case 'rid':
268
-      if (strpos($query, 'FROM {role}') === FALSE
269
-        || strpos($_GET['q'] .'/', 'admin/content/forum/') === 0) {
270
-        break;
271
-      }
272
-      $moderator_rid = forum_access_query_moderator_rid();
273
-      if (!empty($moderator_rid)) {
274
-        $sql['where'] = "$primary_table.rid <> $moderator_rid";
275
-      }
267
+  case 'rid':
268
+    if (strpos($query, 'FROM {role}') === FALSE
269
+      || strpos($_GET['q'] .'/', 'admin/content/forum/') === 0) {
276 270
       break;
271
+    }
272
+    $moderator_rid = forum_access_query_moderator_rid();
273
+    if (!empty($moderator_rid)) {
274
+      $sql['where'] = "$primary_table.rid <> $moderator_rid";
275
+    }
276
+    break;
277 277
   }
278 278
   return $sql;
279 279
 }
@@ -301,42 +301,42 @@  discard block
 block discarded – undo
301 301
   }
302 302
 
303 303
   switch ($op) {
304
-    case 'presave':
305
-      $old_tid = db_result(db_query('SELECT tid FROM {forum} WHERE nid = %d', $node->nid));
306
-      break;
304
+  case 'presave':
305
+    $old_tid = db_result(db_query('SELECT tid FROM {forum} WHERE nid = %d', $node->nid));
306
+    break;
307 307
 
308
-    case 'update':
309
-      if (!empty($old_tid)) {
310
-        if (!empty($node->tid) && $node->tid == $old_tid) {
311
-          return;
312
-        }
313
-        acl_node_clear_acls($node->nid, 'forum_access');
308
+  case 'update':
309
+    if (!empty($old_tid)) {
310
+      if (!empty($node->tid) && $node->tid == $old_tid) {
311
+        return;
312
+      }
313
+      acl_node_clear_acls($node->nid, 'forum_access');
314 314
 
315
-        if (module_exists('nodecomment')) {
316
-          _forum_access_changed_tid($node->tid);
317
-          $result = db_query('SELECT cid FROM {node_comments} WHERE nid = %d', $node->nid);
318
-          while ($row = db_fetch_object($result)) {
319
-            acl_node_clear_acls($row->cid, 'forum_access');
320
-          }
315
+      if (module_exists('nodecomment')) {
316
+        _forum_access_changed_tid($node->tid);
317
+        $result = db_query('SELECT cid FROM {node_comments} WHERE nid = %d', $node->nid);
318
+        while ($row = db_fetch_object($result)) {
319
+          acl_node_clear_acls($row->cid, 'forum_access');
321 320
         }
322 321
       }
323
-      // Deliberate no break -- for changed and for previously unassigned terms we need an insert.
324
-
325
-    case 'insert':
326
-      if (!empty($node->tid)) {
327
-        $acl_id = acl_get_id_by_number('forum_access', $node->tid);
328
-        acl_node_add_acl($node->nid, $acl_id, 1, 1, 1);
329
-
330
-        if (isset($old_tid) && module_exists('nodecomment')) {
331
-          $result = db_query('SELECT cid FROM {node_comments} WHERE nid = %d', $node->nid);
332
-          while ($row = db_fetch_object($result)) {
333
-            acl_node_add_acl($row->cid, $acl_id, 1, 1, 1);
334
-            node_access_acquire_grants(node_load($row->cid));
335
-          }
322
+    }
323
+    // Deliberate no break -- for changed and for previously unassigned terms we need an insert.
324
+
325
+  case 'insert':
326
+    if (!empty($node->tid)) {
327
+      $acl_id = acl_get_id_by_number('forum_access', $node->tid);
328
+      acl_node_add_acl($node->nid, $acl_id, 1, 1, 1);
329
+
330
+      if (isset($old_tid) && module_exists('nodecomment')) {
331
+        $result = db_query('SELECT cid FROM {node_comments} WHERE nid = %d', $node->nid);
332
+        while ($row = db_fetch_object($result)) {
333
+          acl_node_add_acl($row->cid, $acl_id, 1, 1, 1);
334
+          node_access_acquire_grants(node_load($row->cid));
336 335
         }
337 336
       }
338
-      $old_tid = NULL;
339
-      break;
337
+    }
338
+    $old_tid = NULL;
339
+    break;
340 340
   }
341 341
 }
342 342
 
@@ -587,20 +587,20 @@  discard block
 block discarded – undo
587 587
  */
588 588
 function forum_access_user($op, &$edit, &$account, $category = NULL) {
589 589
   switch ($op) {
590
-    case 'validate':
591
-      $rid = forum_access_query_moderator_rid();
592
-      if (!empty($rid)) {
593
-        if (isset($edit['roles'][$rid]) && $edit['roles'][$rid]) {
594
-          $roles = user_roles();
595
-          $variables = array(
596
-            '@Forum_Access' => 'Forum Access',
597
-            '%Role' => $roles[$rid],
598
-          );
599
-          drupal_set_message(t('The %Role role is reserved for internal use by the @Forum_Access module! It was not assigned.', $variables), 'warning');
600
-          unset($edit['roles'][$rid]);
601
-        }
590
+  case 'validate':
591
+    $rid = forum_access_query_moderator_rid();
592
+    if (!empty($rid)) {
593
+      if (isset($edit['roles'][$rid]) && $edit['roles'][$rid]) {
594
+        $roles = user_roles();
595
+        $variables = array(
596
+          '@Forum_Access' => 'Forum Access',
597
+          '%Role' => $roles[$rid],
598
+        );
599
+        drupal_set_message(t('The %Role role is reserved for internal use by the @Forum_Access module! It was not assigned.', $variables), 'warning');
600
+        unset($edit['roles'][$rid]);
602 601
       }
603
-      break;
602
+    }
603
+    break;
604 604
   }
605 605
 }
606 606
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -136,16 +136,16 @@  discard block
 block discarded – undo
136 136
       break;
137 137
 
138 138
     case 'community':
139
-        if (arg(1)=='forum') {
139
+        if (arg(1) == 'forum') {
140 140
             if (is_numeric(arg(2))) {
141
-                $tid=arg(2);
141
+                $tid = arg(2);
142 142
                 // Obtain the tid from a URL path containing
143 143
                 // community/forum/%tid, this will prevent users from
144 144
                 // loading forums they are not allowed to access.
145 145
                 // However, only tid>1 are terms we care about. (This
146 146
                 // allows forum_tweaks mark-read functionality to
147 147
                 // work.)
148
-                if (isset($tid) and ($tid>1)) {
148
+                if (isset($tid) and ($tid > 1)) {
149 149
                     if (!forum_access_access($tid, 'view')) {
150 150
                         drupal_access_denied();
151 151
                         module_invoke_all('exit');
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
  * Alter the node/comment create/edit forms and various admin forms.
188 188
  */
189 189
 function forum_access_form_alter(&$form, &$form_state, $form_id) {
190
-  if (isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id) {
190
+  if (isset($form['type']['#value']) && $form['type']['#value'].'_node_form' == $form_id) {
191 191
     module_load_include('node.inc', 'forum_access');
192 192
     _forum_access_node_form($form, $form_state);
193 193
   }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
     case 'rid':
268 268
       if (strpos($query, 'FROM {role}') === FALSE
269
-        || strpos($_GET['q'] .'/', 'admin/content/forum/') === 0) {
269
+        || strpos($_GET['q'].'/', 'admin/content/forum/') === 0) {
270 270
         break;
271 271
       }
272 272
       $moderator_rid = forum_access_query_moderator_rid();
@@ -417,10 +417,10 @@  discard block
 block discarded – undo
417 417
   }
418 418
   if (empty($comment)) {
419 419
     // Check links for the node.
420
-    if ($tid && isset($links['comment_add']) && !forum_access_access($tid, 'comment_create') && !(forum_access_access($tid, 'create') and ($node->uid==$user->uid)) ) {
420
+    if ($tid && isset($links['comment_add']) && !forum_access_access($tid, 'comment_create') && !(forum_access_access($tid, 'create') and ($node->uid == $user->uid))) {
421 421
       unset($links['comment_add']);
422 422
       // Hack to manually remove quote link
423
-      if ( isset($links['quote']) ) {
423
+      if (isset($links['quote'])) {
424 424
           unset($links['quote']);
425 425
       }
426 426
     }
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
       'delete' => 'comment_delete',
434 434
     );
435 435
     foreach ($required_keys as $access => $key) {
436
-      if (!forum_access_access($tid, $access) && !($access == 'update' && comment_access('edit', $comment)) && !($access == 'comment_create' && forum_access_access($tid, 'create') && ($node->uid==$user->uid)) ) {
436
+      if (!forum_access_access($tid, $access) && !($access == 'update' && comment_access('edit', $comment)) && !($access == 'comment_create' && forum_access_access($tid, 'create') && ($node->uid == $user->uid))) {
437 437
         unset($links[$required_keys[$access]]);
438 438
         unset($required_keys[$access]);
439 439
       }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     }
444 444
 
445 445
     // Hack to manually remove quote link if comment_reply link is no longer set
446
-    if ( (!(isset($links['comment_reply']))) AND isset($links['quote']) ) {
446
+    if ((!(isset($links['comment_reply']))) AND isset($links['quote'])) {
447 447
         unset($links['quote']);
448 448
     }
449 449
     
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
     }
563 563
 
564 564
     $roles = array_keys($account->roles);
565
-    $result = db_result(db_query("SELECT tid FROM {forum_access} WHERE rid IN (". db_placeholders($roles) .") AND grant_". $type ." = 1 AND tid = %d", array_merge($roles, array($tid))));
565
+    $result = db_result(db_query("SELECT tid FROM {forum_access} WHERE rid IN (".db_placeholders($roles).") AND grant_".$type." = 1 AND tid = %d", array_merge($roles, array($tid))));
566 566
 
567 567
     if ($result) {
568 568
       $cache[$account->uid][$tid][$type] = 1;
Please login to merge, or discard this patch.
sites/default/boinc/modules/contrib/i18nviews/includes/i18nviews.views.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 function i18nviews_views_handlers() {
19 19
   return array(
20 20
     'info' => array(
21
-      'path' => drupal_get_path('module', 'i18nviews') . '/includes',
21
+      'path' => drupal_get_path('module', 'i18nviews').'/includes',
22 22
     ),
23 23
     'handlers' => array(
24 24
       'content_negotiation_filter_handler' => array(
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
  * Implementation of hook_views_plugins().
33 33
  */
34 34
 function i18nviews_views_plugins() {
35
-  $path = drupal_get_path('module', 'i18nviews') . '/includes';
35
+  $path = drupal_get_path('module', 'i18nviews').'/includes';
36 36
   return array(
37 37
     'module' => 'i18nviews',
38 38
     'localization' => array(
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/i18nviews/i18nviews.module 2 patches
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function i18nviews_help($path, $arg) {
17 17
   switch ($path) {
18
-    case 'admin/modules#description' :
19
-      $output = '<p>'. t('Supports translation for views strings: title, header, footer...') .'</p>';
20
-      $output .= '<p>'. t('To search and translate strings, use the <a href="@translate-interface">translation interface</a> pages.', array('@translate-interface' => url('admin/build/translate'))) .'</p>';
21
-      return $output;
18
+  case 'admin/modules#description' :
19
+    $output = '<p>'. t('Supports translation for views strings: title, header, footer...') .'</p>';
20
+    $output .= '<p>'. t('To search and translate strings, use the <a href="@translate-interface">translation interface</a> pages.', array('@translate-interface' => url('admin/build/translate'))) .'</p>';
21
+    return $output;
22 22
   }
23 23
 }
24 24
 
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function i18nviews_locale($op = 'groups') {
29 29
   switch ($op) {
30
-    case 'groups':
31
-      return array('views' => t('Views'));
32
-    case 'info':
33
-      $info['views']['refresh callback'] = 'i18nviews_locale_refresh';
34
-      $info['views']['format'] = TRUE;
35
-      return $info;
30
+  case 'groups':
31
+    return array('views' => t('Views'));
32
+  case 'info':
33
+    $info['views']['refresh callback'] = 'i18nviews_locale_refresh';
34
+    $info['views']['format'] = TRUE;
35
+    return $info;
36 36
   }
37 37
 }
38 38
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 function i18nviews_help($path, $arg) {
17 17
   switch ($path) {
18 18
     case 'admin/modules#description' :
19
-      $output = '<p>'. t('Supports translation for views strings: title, header, footer...') .'</p>';
20
-      $output .= '<p>'. t('To search and translate strings, use the <a href="@translate-interface">translation interface</a> pages.', array('@translate-interface' => url('admin/build/translate'))) .'</p>';
19
+      $output = '<p>'.t('Supports translation for views strings: title, header, footer...').'</p>';
20
+      $output .= '<p>'.t('To search and translate strings, use the <a href="@translate-interface">translation interface</a> pages.', array('@translate-interface' => url('admin/build/translate'))).'</p>';
21 21
       return $output;
22 22
   }
23 23
 }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 function i18nviews_views_api() {
90 90
   return array(
91 91
     'api' => '2.0',
92
-    'path' => drupal_get_path('module', 'i18nviews') . '/includes',
92
+    'path' => drupal_get_path('module', 'i18nviews').'/includes',
93 93
   );
94 94
 }
95 95
 
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
     // Also checking weird values for $display_id, see 277711
111 111
     if (!empty($view->display) && is_array($view->display) && is_string($display_id)) {
112 112
       $fields = _i18nviews_display_fields();
113
-      if(!empty($view->display[$display_id])) {
113
+      if (!empty($view->display[$display_id])) {
114 114
         $fields = _i18nviews_localize_array($view->name, $display_id, $view->display[$display_id]->handler->options, $fields);
115 115
       }
116
-      if($fields && !empty($view->display['default'])) {
116
+      if ($fields && !empty($view->display['default'])) {
117 117
         _i18nviews_localize_array($view->name, 'default', $view->display['default']->handler->options, $fields);
118 118
       }      
119 119
     }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
   foreach ($field_names as $field) {
160 160
     if (!empty($data[$field])) {
161 161
       if ($update) {
162
-        $format = isset($data[$field . '_format']) ? $data[$field . '_format'] : NULL;
162
+        $format = isset($data[$field.'_format']) ? $data[$field.'_format'] : NULL;
163 163
         i18nstrings_update("views:$name:$group:$field", $data[$field], $format);
164 164
       }
165 165
       else {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     if (isset($form_state['values'][$field])) {
210 210
       $name = $form_state['view']->name;
211 211
       $group = $form_state['display_id'];
212
-      $format = isset($form_state['values'][$field . '_format']) ? $form_state['values'][$field . '_format'] : NULL;
212
+      $format = isset($form_state['values'][$field.'_format']) ? $form_state['values'][$field.'_format'] : NULL;
213 213
       i18nstrings_update("views:$name:$group:$field", $form_state['values'][$field], $format);
214 214
     }
215 215
   }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/wysiwyg/editors/jwysiwyg.inc 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
  *   The installed editor version.
47 47
  */
48 48
 function wysiwyg_jwysiwyg_version($editor) {
49
-  $script = $editor['library path'] . '/jquery.wysiwyg.js';
49
+  $script = $editor['library path'].'/jquery.wysiwyg.js';
50 50
   if (!file_exists($script)) {
51 51
     return;
52 52
   }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/wysiwyg/editors/fckeditor.inc 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
  *   The installed editor version.
51 51
  */
52 52
 function wysiwyg_fckeditor_version($editor) {
53
-  $library = $editor['library path'] . '/fckeditor.js';
53
+  $library = $editor['library path'].'/fckeditor.js';
54 54
   if (!file_exists($library)) {
55 55
     return;
56 56
   }
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
  */
99 99
 function wysiwyg_fckeditor_settings($editor, $config, $theme) {
100 100
   $settings = array(
101
-    'EditorPath' => base_path() . $editor['library path'] . '/',
102
-    'SkinPath' => base_path() . $editor['library path'] . '/editor/skins/' . $theme . '/',
103
-    'CustomConfigurationsPath' => base_path() . drupal_get_path('module', 'wysiwyg') . '/editors/js/fckeditor.config.js',
101
+    'EditorPath' => base_path().$editor['library path'].'/',
102
+    'SkinPath' => base_path().$editor['library path'].'/editor/skins/'.$theme.'/',
103
+    'CustomConfigurationsPath' => base_path().drupal_get_path('module', 'wysiwyg').'/editors/js/fckeditor.config.js',
104 104
     'Width' => '100%',
105 105
     'Height' => 420,
106 106
     'LinkBrowser' => FALSE,
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
       // Add path for native external plugins; internal ones do not need a path.
181 181
       if (empty($plugin['internal']) && isset($plugin['path'])) {
182 182
         // All native FCKeditor plugins use the filename fckplugin.js.
183
-        $settings[$name]['path'] = base_path() . $plugin['path'] . '/';
183
+        $settings[$name]['path'] = base_path().$plugin['path'].'/';
184 184
       }
185 185
       if (!empty($plugin['languages'])) {
186 186
         $settings[$name]['languages'] = $plugin['languages'];
@@ -199,10 +199,10 @@  discard block
 block discarded – undo
199 199
     // Populate required plugin settings.
200 200
     $settings[$name] = $plugin['dialog settings'] + array(
201 201
       'title' => $plugin['title'],
202
-      'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'],
202
+      'icon' => base_path().$plugin['icon path'].'/'.$plugin['icon file'],
203 203
       'iconTitle' => $plugin['icon title'],
204 204
       // @todo These should only be set if the plugin defined them.
205
-      'css' => base_path() . $plugin['css path'] . '/' . $plugin['css file'],
205
+      'css' => base_path().$plugin['css path'].'/'.$plugin['css file'],
206 206
     );
207 207
   }
208 208
   return $settings;
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
       'internal' => TRUE,
245 245
     ),
246 246
     'autogrow' => array(
247
-      'path' => $editor['library path'] . '/editor/plugins',
247
+      'path' => $editor['library path'].'/editor/plugins',
248 248
       'extensions' => array(
249 249
         'autogrow' => t('Autogrow'),
250 250
       ),
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
       'load' => TRUE,
256 256
     ),
257 257
     'bbcode' => array(
258
-      'path' => $editor['library path'] . '/editor/plugins',
258
+      'path' => $editor['library path'].'/editor/plugins',
259 259
       'extensions' => array(
260 260
         'bbcode' => t('BBCode'),
261 261
       ),
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
       'load' => TRUE,
264 264
     ),
265 265
     'dragresizetable' => array(
266
-      'path' => $editor['library path'] . '/editor/plugins',
266
+      'path' => $editor['library path'].'/editor/plugins',
267 267
       'extensions' => array(
268 268
         'dragresizetable' => t('Table drag/resize'),
269 269
       ),
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
       'load' => TRUE,
272 272
     ),
273 273
     'tablecommands' => array(
274
-      'path' => $editor['library path'] . '/editor/plugins',
274
+      'path' => $editor['library path'].'/editor/plugins',
275 275
       'buttons' => array(
276 276
         'TableCellProp' => t('Table: Cell properties'),
277 277
         'TableInsertRowAfter' => t('Table: Insert row after'),
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/wysiwyg/editors/wymeditor.inc 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     'title' => 'WYMeditor',
14 14
     'vendor url' => 'http://www.wymeditor.org/',
15 15
     'download url' => 'http://www.wymeditor.org/download/',
16
-    'library path' => wysiwyg_get_path('wymeditor') . '/wymeditor',
16
+    'library path' => wysiwyg_get_path('wymeditor').'/wymeditor',
17 17
     'libraries' => array(
18 18
       'min' => array(
19 19
         'title' => 'Minified',
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
  *   The installed editor version.
52 52
  */
53 53
 function wysiwyg_wymeditor_version($editor) {
54
-  $script = $editor['library path'] . '/jquery.wymeditor.js';
54
+  $script = $editor['library path'].'/jquery.wymeditor.js';
55 55
   if (!file_exists($script)) {
56 56
     return;
57 57
   }
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
   // @todo Setup $library in wysiwyg_load_editor() already.
100 100
   $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries']));
101 101
   $settings = array(
102
-    'basePath' => base_path() . $editor['library path'] . '/',
102
+    'basePath' => base_path().$editor['library path'].'/',
103 103
     'wymPath' => $editor['libraries'][$library]['files'][0],
104 104
     // @todo Does not work in Drupal; jQuery can live anywhere.
105
-    'jQueryPath' => base_path() . 'misc/jquery.js',
105
+    'jQueryPath' => base_path().'misc/jquery.js',
106 106
     'updateSelector' => '.form-submit',
107 107
     'skin' => $theme,
108 108
   );
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
               $settings['toolsItems'][] = array(
137 137
                 'name' => $button,
138 138
                 'title' => $plugins[$plugin][$type][$button],
139
-                'css' => 'wym_tools_' . $button,
139
+                'css' => 'wym_tools_'.$button,
140 140
               );
141 141
             }
142 142
           }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $settings['containersItems'][] = array(
164 164
           'name' => strtoupper($tag),
165 165
           'title' => $containers[$tag],
166
-          'css' => 'wym_containers_' . $tag,
166
+          'css' => 'wym_containers_'.$tag,
167 167
         );
168 168
       }
169 169
     }
Please login to merge, or discard this patch.