@@ -91,8 +91,9 @@ |
||
91 | 91 | * $db_url = 'pgsql://username:password@localhost/databasename'; |
92 | 92 | */ |
93 | 93 | require_once('dbconfig.php'); |
94 | -if (!isset($dbserver) || empty($dbserver)) |
|
94 | +if (!isset($dbserver) || empty($dbserver)) { |
|
95 | 95 | $dbserver='localhost'; |
96 | +} |
|
96 | 97 | $db_url = array( |
97 | 98 | 'default' => "{$dbtype}://{$dbuser}:".urlencode($dbpass)."@{$dbserver}/{$dbname}", |
98 | 99 | 'boinc' => "{$boinc_dbtype}://{$boinc_dbuser}:".urlencode($boinc_dbpass)."@{$boinc_dbserver}/{$boinc_dbname}" |
@@ -94,15 +94,16 @@ discard block |
||
94 | 94 | // Use the menu label as the default block subject |
95 | 95 | $menus = menu_get_menus(); |
96 | 96 | $subject = $menus[$jumpmenu_name]; |
97 | - } |
|
98 | - else if ($jumpmenu_type == 'taxo') { |
|
97 | + } else if ($jumpmenu_type == 'taxo') { |
|
99 | 98 | $form = jump_quickly($jumpmenu_name, 'taxo', $active); |
100 | 99 | |
101 | 100 | // Use the vocabulary name as the default block subject |
102 | 101 | $vocab = taxonomy_vocabulary_load($jumpmenu_name); |
103 | 102 | $subject = $vocab->name; |
104 | 103 | } |
105 | - if (variable_get('jump_use_js_' . $delta, 0) === 1) drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); |
|
104 | + if (variable_get('jump_use_js_' . $delta, 0) === 1) { |
|
105 | + drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); |
|
106 | + } |
|
106 | 107 | return array('subject' => $subject, 'content' => $form); |
107 | 108 | break; |
108 | 109 | } |
@@ -137,13 +138,11 @@ discard block |
||
137 | 138 | |
138 | 139 | if (is_array($name)) { |
139 | 140 | $options = $name; |
140 | - } |
|
141 | - else { |
|
141 | + } else { |
|
142 | 142 | $options = array(); |
143 | 143 | if ($type == 'menu') { |
144 | 144 | jump_menu_get_menu_options($options, $name); |
145 | - } |
|
146 | - elseif ($type == 'taxo') { |
|
145 | + } elseif ($type == 'taxo') { |
|
147 | 146 | jump_menu_get_taxo_options($options, $name); |
148 | 147 | } |
149 | 148 | } |
@@ -215,8 +214,7 @@ discard block |
||
215 | 214 | $fragment = explode('#', $form_state['values']['jump_goto']); |
216 | 215 | if (isset($fragment[1])) { |
217 | 216 | drupal_goto($fragment[0], NULL, $fragment[1]); |
218 | - } |
|
219 | - else { |
|
217 | + } else { |
|
220 | 218 | drupal_goto($form_state['values']['jump_goto']); |
221 | 219 | } |
222 | 220 | } |
@@ -76,8 +76,7 @@ discard block |
||
76 | 76 | foreach ($handlers as $field => $handler) { |
77 | 77 | if ($label = $handler->label()) { |
78 | 78 | $field_names[$field] = $label; |
79 | - } |
|
80 | - else { |
|
79 | + } else { |
|
81 | 80 | $field_names[$field] = $handler->ui_name(); |
82 | 81 | } |
83 | 82 | } |
@@ -125,8 +124,7 @@ discard block |
||
125 | 124 | $map = array_flip($this->field_map); |
126 | 125 | if (isset($row->$map[$field])) { |
127 | 126 | $tokens["[$field]"] = $row->$map[$field]; |
128 | - } |
|
129 | - else { |
|
127 | + } else { |
|
130 | 128 | $tokens["[$field]"] = ''; |
131 | 129 | } |
132 | 130 | } |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | if (isset($tid)) { // edit |
24 | 24 | $template_tid = variable_get('forum_access_default_template_tid', 0); |
25 | 25 | $settings = _forum_access_get_settings($tid); |
26 | - } |
|
27 | - else { // create |
|
26 | + } else { // create |
|
28 | 27 | $template_tid = variable_get('forum_access_new_template_tid', NULL); |
29 | 28 | $settings = _forum_access_get_settings($template_tid); |
30 | 29 | } |
@@ -288,8 +287,7 @@ discard block |
||
288 | 287 | $form['forum_access']['interference']['by_content_access'][] = array( |
289 | 288 | '#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 | 289 | ); |
291 | - } |
|
292 | - else { |
|
290 | + } else { |
|
293 | 291 | $form['forum_access']['interference']['by_content_access'][] = array( |
294 | 292 | '#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 | 293 | ); |
@@ -297,8 +295,7 @@ discard block |
||
297 | 295 | $form['forum_access']['interference']['by_content_access'][] = array( |
298 | 296 | '#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 | 297 | ); |
300 | - } |
|
301 | - else { |
|
298 | + } else { |
|
302 | 299 | $form['forum_access']['interference'][] = array( |
303 | 300 | '#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 | 301 | ); |
@@ -445,21 +442,17 @@ discard block |
||
445 | 442 | $element[$rid]['#suffix'] = "</span>"; |
446 | 443 | $element[$rid]['#default_value'] = TRUE; |
447 | 444 | $element[$rid]['#disabled'] = TRUE; |
448 | - } |
|
449 | - elseif ($element['#parents'][1] == 'create') { |
|
445 | + } elseif ($element['#parents'][1] == 'create') { |
|
450 | 446 | // Do nothing (Post is always mutable). |
451 | - } |
|
452 | - elseif ($element['#parents'][1] == 'comment_create') { |
|
453 | - } |
|
454 | - elseif ($element['#parents'][1] == 'view' && isset($permissions[$rid]['administer forums'])) { |
|
447 | + } elseif ($element['#parents'][1] == 'comment_create') { |
|
448 | + } elseif ($element['#parents'][1] == 'view' && isset($permissions[$rid]['administer forums'])) { |
|
455 | 449 | $element[$rid]['#title'] = '<em>'. $element[$rid]['#title'] .'</em>'; |
456 | 450 | $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 | 451 | if (isset($permissions[$rid]['administer nodes'])) { |
458 | 452 | $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 | 453 | } |
460 | 454 | $element[$rid]['#suffix'] = "</span>"; |
461 | - } |
|
462 | - elseif (isset($permissions[$rid]['administer nodes'])) { |
|
455 | + } elseif (isset($permissions[$rid]['administer nodes'])) { |
|
463 | 456 | $element[$rid]['#disabled'] = TRUE; |
464 | 457 | $element[$rid]['#default_value'] = TRUE; |
465 | 458 | $element[$rid]['#prefix'] = '<span title="'. ($rid != $moderator_rid |
@@ -515,8 +508,7 @@ discard block |
||
515 | 508 | if ($settings['priority'] != 0) { |
516 | 509 | $form['interference']['advanced']['#collapsed'] = FALSE; |
517 | 510 | } |
518 | - } |
|
519 | - elseif (is_array(reset($form_state['values']['forum_access']['template']['taxonomy']))) { |
|
511 | + } elseif (is_array(reset($form_state['values']['forum_access']['template']['taxonomy']))) { |
|
520 | 512 | $imv = reset($form_state['values']['forum_access']['template']['taxonomy']); |
521 | 513 | $template_tid = reset($imv); |
522 | 514 | } |
@@ -549,14 +541,12 @@ discard block |
||
549 | 541 | $template_tid = reset(array_values($access['template']['taxonomy'])); |
550 | 542 | if ($access['template']['select_by_default']) { |
551 | 543 | variable_set('forum_access_default_template_tid', $template_tid); |
552 | - } |
|
553 | - elseif (variable_get('forum_access_default_template_tid', 0) == $template_tid) { |
|
544 | + } elseif (variable_get('forum_access_default_template_tid', 0) == $template_tid) { |
|
554 | 545 | variable_del('forum_access_default_template_tid'); |
555 | 546 | } |
556 | 547 | if ($access['template']['load_for_new']) { |
557 | 548 | variable_set('forum_access_new_template_tid', $template_tid); |
558 | - } |
|
559 | - elseif (variable_get('forum_access_new_template_tid', 0) == $template_tid) { |
|
549 | + } elseif (variable_get('forum_access_new_template_tid', 0) == $template_tid) { |
|
560 | 550 | variable_del('forum_access_new_template_tid'); |
561 | 551 | } |
562 | 552 | module_load_include('node.inc', 'forum_access'); |
@@ -598,8 +588,7 @@ discard block |
||
598 | 588 | // We prefer not to save records for node administrators, because these have access anyway. |
599 | 589 | if (isset($permissions[$rid]['administer forums']) && $access['view'][$rid]) { |
600 | 590 | // For forum administrators, View needs to be saved, ... |
601 | - } |
|
602 | - else { |
|
591 | + } else { |
|
603 | 592 | // ... otherwise forget View. |
604 | 593 | $access['view'][$rid] = FALSE; |
605 | 594 | } |
@@ -607,8 +596,7 @@ discard block |
||
607 | 596 | 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)", |
608 | 597 | $tid, $rid, !empty($access['view'][$rid]), 0, 0, !empty($access['create'][$rid]), !empty($access['comment_create'][$rid]), $fa_priority); |
609 | 598 | } |
610 | - } |
|
611 | - else { |
|
599 | + } else { |
|
612 | 600 | 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 | 601 | $tid, $rid, (bool) $checked, !empty($access['update'][$rid]), !empty($access['delete'][$rid]), !empty($access['create'][$rid]), !empty($access['comment_create'][$rid]), $fa_priority); |
614 | 602 | } |
@@ -620,8 +608,7 @@ discard block |
||
620 | 608 | if (!$is_new && $form_state['values']['form_id'] != 'forum_form_container') { |
621 | 609 | if (!isset($access['update_choice']) || $access['update_choice'] == 2) { |
622 | 610 | node_access_needs_rebuild(TRUE); |
623 | - } |
|
624 | - elseif ($access['update_choice'] == 0) { |
|
611 | + } elseif ($access['update_choice'] == 0) { |
|
625 | 612 | // update immediately (but use the batch functions anyway |
626 | 613 | $save_redirect = $form_state['redirect']; |
627 | 614 | $form_state['redirect'] = $_GET['q']; |
@@ -637,8 +624,7 @@ discard block |
||
637 | 624 | } |
638 | 625 | _forum_access_update_batch_finished(TRUE, array(), array()); |
639 | 626 | $form_state['redirect'] = $save_redirect; |
640 | - } |
|
641 | - else { |
|
627 | + } else { |
|
642 | 628 | // mass update in batch mode, modeled after node.module |
643 | 629 | $limit = $access['update_limit']; |
644 | 630 | $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)); |
@@ -698,8 +684,7 @@ discard block |
||
698 | 684 | if ($success) { |
699 | 685 | drupal_set_message(t('The content access permissions have been updated.')); |
700 | 686 | cache_clear_all(); |
701 | - } |
|
702 | - else { |
|
687 | + } else { |
|
703 | 688 | drupal_set_message(t('The content access permissions have not been properly updated.'), 'error'); |
704 | 689 | } |
705 | 690 | } |
@@ -744,8 +729,7 @@ discard block |
||
744 | 729 | $return['view'] = array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID); |
745 | 730 | $return['create'] = array(DRUPAL_AUTHENTICATED_RID); |
746 | 731 | $return['comment_create'] = array(DRUPAL_AUTHENTICATED_RID); |
747 | - } |
|
748 | - else { |
|
732 | + } else { |
|
749 | 733 | $result = db_query("SELECT * FROM {forum_access} where tid = %d", $tid); |
750 | 734 | while ($access = db_fetch_object($result)) { |
751 | 735 | if ($access->grant_view) { |
@@ -831,8 +815,7 @@ discard block |
||
831 | 815 | 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 | 816 | .'<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 | 817 | .'<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 | - } |
|
835 | - else { |
|
818 | + } else { |
|
836 | 819 | $vid = _forum_access_get_vid(); |
837 | 820 | $vocabulary = taxonomy_vocabulary_load($vid); |
838 | 821 | if (isset($vocabulary->nodes[arg(3)])) { |
@@ -926,8 +909,7 @@ discard block |
||
926 | 909 | } |
927 | 910 | watchdog('user', $msg, NULL, WATCHDOG_NOTICE); |
928 | 911 | return $rid; |
929 | - } |
|
930 | - else { |
|
912 | + } else { |
|
931 | 913 | $msg = t('!Forum_Access cannot create the %role role!', $variables); |
932 | 914 | watchdog('user', $msg, NULL, WATCHDOG_WARNING); |
933 | 915 | drupal_set_message($msg .' '. t('Is it already in use?'), 'error'); |
@@ -49,23 +49,20 @@ discard block |
||
49 | 49 | foreach ($form['taxonomy'][$vid]['#options'] as $tid => $name) { |
50 | 50 | if (!is_numeric($tid)) { |
51 | 51 | $options[$tid] = $name; |
52 | - } |
|
53 | - elseif (is_object($name)) { |
|
52 | + } elseif (is_object($name)) { |
|
54 | 53 | foreach ($name->option as $sub_tid => $sub_name) { |
55 | 54 | if (!empty($tids[$sub_tid])) { |
56 | 55 | $options[$tid]->option[$sub_tid] = $sub_name; |
57 | 56 | } |
58 | 57 | } |
59 | - } |
|
60 | - elseif ($tids[$tid]) { |
|
58 | + } elseif ($tids[$tid]) { |
|
61 | 59 | $options[$tid] = $name; |
62 | 60 | } |
63 | 61 | } |
64 | 62 | |
65 | 63 | if ($options) { |
66 | 64 | $form['taxonomy'][$vid]['#options'] = $options; |
67 | - } |
|
68 | - else { |
|
65 | + } else { |
|
69 | 66 | unset($form['taxonomy'][$vid]); |
70 | 67 | } |
71 | 68 | |
@@ -135,8 +132,7 @@ discard block |
||
135 | 132 | } |
136 | 133 | break; |
137 | 134 | }//switch arg(0) |
138 | - } |
|
139 | - else { |
|
135 | + } else { |
|
140 | 136 | if (isset($form['admin']) && !empty($user->_forum_access_moderator)) { |
141 | 137 | foreach (element_children($form['admin']) as $key) { |
142 | 138 | if ($key != 'status') { |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | if (isset($node->comment_target_nid)) { |
39 | 39 | if ($changed_tid = _forum_access_changed_tid()) { |
40 | 40 | $tid = $changed_tid; // the topic node hasn't been saved yet! |
41 | - } |
|
42 | - else { |
|
41 | + } else { |
|
43 | 42 | $node = node_load($node->comment_target_nid); |
44 | 43 | $tid = _forum_access_get_tid($node); |
45 | 44 | } |
@@ -190,44 +189,34 @@ discard block |
||
190 | 189 | if (isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id) { |
191 | 190 | module_load_include('node.inc', 'forum_access'); |
192 | 191 | _forum_access_node_form($form, $form_state); |
193 | - } |
|
194 | - elseif ($form_id == 'comment_form' && !variable_get('forum_access_D5_legacy_mode', FALSE)) { |
|
192 | + } elseif ($form_id == 'comment_form' && !variable_get('forum_access_D5_legacy_mode', FALSE)) { |
|
195 | 193 | module_load_include('node.inc', 'forum_access'); |
196 | 194 | _forum_access_comment_form($form, $form_state); |
197 | - } |
|
198 | - elseif ($form_id == 'forum_overview') { |
|
195 | + } elseif ($form_id == 'forum_overview') { |
|
199 | 196 | module_load_include('admin.inc', 'forum_access'); |
200 | 197 | _forum_access_forum_overview($form, $form_state); |
201 | - } |
|
202 | - elseif ($form_id == 'forum_form_container') { |
|
198 | + } elseif ($form_id == 'forum_form_container') { |
|
203 | 199 | module_load_include('admin.inc', 'forum_access'); |
204 | 200 | _forum_access_forum_form($form, $form_state, TRUE); |
205 | - } |
|
206 | - elseif ($form_id == 'forum_form_forum') { |
|
201 | + } elseif ($form_id == 'forum_form_forum') { |
|
207 | 202 | module_load_include('admin.inc', 'forum_access'); |
208 | 203 | _forum_access_forum_form($form, $form_state, FALSE); |
209 | - } |
|
210 | - elseif ($form_id == 'forum_admin_settings') { |
|
204 | + } elseif ($form_id == 'forum_admin_settings') { |
|
211 | 205 | module_load_include('admin.inc', 'forum_access'); |
212 | 206 | _forum_access_forum_admin_settings_form($form, $form_state); |
213 | - } |
|
214 | - elseif ($form_id == 'user_admin_role') { |
|
207 | + } elseif ($form_id == 'user_admin_role') { |
|
215 | 208 | module_load_include('admin.inc', 'forum_access'); |
216 | 209 | _forum_access_user_admin_role_form($form, $form_state); |
217 | - } |
|
218 | - elseif ($form_id == 'content_access_admin_settings' && empty($_POST)) { |
|
210 | + } elseif ($form_id == 'content_access_admin_settings' && empty($_POST)) { |
|
219 | 211 | module_load_include('admin.inc', 'forum_access'); |
220 | 212 | _forum_access_content_access_admin_form(); |
221 | - } |
|
222 | - elseif ($form_id == 'user_admin_perm') { |
|
213 | + } elseif ($form_id == 'user_admin_perm') { |
|
223 | 214 | module_load_include('admin.inc', 'forum_access'); |
224 | 215 | _forum_access_user_admin_perm_form($form, $form_state); |
225 | - } |
|
226 | - elseif ($form_id == 'user_admin_account') { |
|
216 | + } elseif ($form_id == 'user_admin_account') { |
|
227 | 217 | module_load_include('admin.inc', 'forum_access'); |
228 | 218 | _forum_access_user_admin_account_form($form, $form_state); |
229 | - } |
|
230 | - elseif ($form_id == 'user_profile_form') { |
|
219 | + } elseif ($form_id == 'user_profile_form') { |
|
231 | 220 | module_load_include('admin.inc', 'forum_access'); |
232 | 221 | _forum_access_user_profile_form($form, $form_state); |
233 | 222 | } |
@@ -252,8 +241,7 @@ discard block |
||
252 | 241 | } |
253 | 242 | if (strpos($_GET['q'], 'node/add/forum') !== FALSE) { |
254 | 243 | $required_access = 'create'; |
255 | - } |
|
256 | - else { |
|
244 | + } else { |
|
257 | 245 | $required_access = 'view'; |
258 | 246 | } |
259 | 247 | $roles = implode(', ', array_keys($user->roles)); |
@@ -424,8 +412,7 @@ discard block |
||
424 | 412 | unset($links['quote']); |
425 | 413 | } |
426 | 414 | } |
427 | - } |
|
428 | - else { |
|
415 | + } else { |
|
429 | 416 | // Check links for the comment. |
430 | 417 | $required_keys = array( |
431 | 418 | 'comment_create' => 'comment_reply', |
@@ -436,8 +423,7 @@ discard block |
||
436 | 423 | if (!forum_access_access($tid, $access) && !($access == 'update' && comment_access('edit', $comment))) { |
437 | 424 | unset($links[$required_keys[$access]]); |
438 | 425 | unset($required_keys[$access]); |
439 | - } |
|
440 | - elseif (!array_key_exists($key, $links)) { |
|
426 | + } elseif (!array_key_exists($key, $links)) { |
|
441 | 427 | $link_is_missing = TRUE; |
442 | 428 | } |
443 | 429 | } |
@@ -566,15 +552,13 @@ discard block |
||
566 | 552 | |
567 | 553 | if ($result) { |
568 | 554 | $cache[$account->uid][$tid][$type] = 1; |
569 | - } |
|
570 | - else { |
|
555 | + } else { |
|
571 | 556 | // check our moderators too |
572 | 557 | $acl_id = acl_get_id_by_number('forum_access', $tid); |
573 | 558 | $result = db_result(db_query("SELECT uid FROM {acl_user} WHERE acl_id = %d AND uid = %d", $acl_id, $account->uid)); |
574 | 559 | if ($result) { |
575 | 560 | $cache[$account->uid][$tid][$type] = 2; |
576 | - } |
|
577 | - else { |
|
561 | + } else { |
|
578 | 562 | $cache[$account->uid][$tid][$type] = FALSE; |
579 | 563 | } |
580 | 564 | } |
@@ -62,8 +62,7 @@ discard block |
||
62 | 62 | function i18nviews_views_handler_field_allterms($fieldinfo, $fielddata, $value, $data) { |
63 | 63 | if ($fieldinfo['vocabulary']) { |
64 | 64 | $terms = taxonomy_node_get_terms_by_vocabulary($data->nid, $fieldinfo['vocabulary']); |
65 | - } |
|
66 | - else { |
|
65 | + } else { |
|
67 | 66 | $terms = taxonomy_node_get_terms($data->nid); |
68 | 67 | } |
69 | 68 | // Translate all these terms. |
@@ -74,8 +73,7 @@ discard block |
||
74 | 73 | $links[] = check_plain($term->name); |
75 | 74 | } |
76 | 75 | $links = !empty($links) ? implode(' | ', $links) : ''; |
77 | - } |
|
78 | - else { |
|
76 | + } else { |
|
79 | 77 | $node = new stdClass(); |
80 | 78 | $node->taxonomy = $terms; |
81 | 79 | $links = theme('links', taxonomy_link('taxonomy terms', $node)); |
@@ -126,8 +124,7 @@ discard block |
||
126 | 124 | if ($data['id'] == 'term_node.name') { |
127 | 125 | // That's a full taxonomy box. |
128 | 126 | $view->field[$index]['handler'] = 'i18ntaxonomy_views_handler_field_allterms'; |
129 | - } |
|
130 | - elseif (preg_match("/term_node_(\d+)\.name/", $data['id'], $matches)) { |
|
127 | + } elseif (preg_match("/term_node_(\d+)\.name/", $data['id'], $matches)) { |
|
131 | 128 | $vid = $matches[1]; |
132 | 129 | if ($translate[$vid]) { |
133 | 130 | // Set new handler for this field. |
@@ -161,8 +158,7 @@ discard block |
||
161 | 158 | if ($update) { |
162 | 159 | $format = isset($data[$field . '_format']) ? $data[$field . '_format'] : NULL; |
163 | 160 | i18nstrings_update("views:$name:$group:$field", $data[$field], $format); |
164 | - } |
|
165 | - else { |
|
161 | + } else { |
|
166 | 162 | $data[$field] = i18nstrings("views:$name:$group:$field", $data[$field]); |
167 | 163 | $translated[] = $field; |
168 | 164 | } |
@@ -102,8 +102,7 @@ discard block |
||
102 | 102 | if (count($value) > 1) { |
103 | 103 | $tname = t($value[0]); |
104 | 104 | $predefined[$key] = ($tname == $value[1]) ? $tname : "$tname ($value[1])"; |
105 | - } |
|
106 | - else { |
|
105 | + } else { |
|
107 | 106 | $predefined[$key] = t($value[0]); |
108 | 107 | } |
109 | 108 | } |
@@ -143,8 +142,7 @@ discard block |
||
143 | 142 | '#default_value' => !empty($profile->settings['buttons'][$name][$button]) ? $profile->settings['buttons'][$name][$button] : FALSE, |
144 | 143 | ); |
145 | 144 | } |
146 | - } |
|
147 | - else if (isset($meta['extensions']) && is_array($meta['extensions'])) { |
|
145 | + } else if (isset($meta['extensions']) && is_array($meta['extensions'])) { |
|
148 | 146 | foreach ($meta['extensions'] as $extension => $title) { |
149 | 147 | $form['buttons'][$name][$extension] = array( |
150 | 148 | '#type' => 'checkbox', |
@@ -334,8 +332,7 @@ discard block |
||
334 | 332 | // Determine if this is an update. |
335 | 333 | if (!db_result(db_query("SELECT 1 FROM {wysiwyg} WHERE format = %d", $format))) { |
336 | 334 | $update = array(); |
337 | - } |
|
338 | - else { |
|
335 | + } else { |
|
339 | 336 | $update = array('format'); |
340 | 337 | } |
341 | 338 | $wysiwyg = new stdClass(); |
@@ -405,8 +402,7 @@ discard block |
||
405 | 402 | ); |
406 | 403 | if ($editor['installed']) { |
407 | 404 | $options[$name] = $editor['title'] . (isset($editor['installed version']) ? ' ' . $editor['installed version'] : ''); |
408 | - } |
|
409 | - else { |
|
405 | + } else { |
|
410 | 406 | // Build on-site installation instructions. |
411 | 407 | // @todo Setup $library in wysiwyg_load_editor() already. |
412 | 408 | $library = (isset($editor['library']) ? $editor['library'] : key($editor['libraries'])); |
@@ -467,8 +463,7 @@ discard block |
||
467 | 463 | if ($in_code_only) { |
468 | 464 | $form['formats'][$id]['name']['#value'] .= ' <em>(' . t('From: !module module', array('!module' => $profiles[$id]->export_module)) . ')</em>'; |
469 | 465 | } |
470 | - } |
|
471 | - else { |
|
466 | + } else { |
|
472 | 467 | $form['formats'][$id]['editor'] = array( |
473 | 468 | '#type' => 'select', |
474 | 469 | '#default_value' => '', |
@@ -574,8 +569,7 @@ discard block |
||
574 | 569 | wysiwyg_profile_delete($wysiwyg); |
575 | 570 | if (!empty($form_state['values']['revert'])) { |
576 | 571 | drupal_set_message(t('Wysiwyg profile settings for %name has been reverted.', array('%name' => $format->name))); |
577 | - } |
|
578 | - else { |
|
572 | + } else { |
|
579 | 573 | drupal_set_message(t('Wysiwyg profile for %name has been deleted.', array('%name' => $format->name))); |
580 | 574 | } |
581 | 575 | $form_state['redirect'] = 'admin/settings/wysiwyg'; |
@@ -130,8 +130,7 @@ |
||
130 | 130 | if (isset($config['css_setting'])) { |
131 | 131 | if ($config['css_setting'] == 'theme') { |
132 | 132 | $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css()); |
133 | - } |
|
134 | - else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
133 | + } else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
|
135 | 134 | $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); |
136 | 135 | } |
137 | 136 | } |