@@ -25,8 +25,10 @@ discard block |
||
| 25 | 25 | // if not XML, dev defaults to 1 |
| 26 | 26 | // |
| 27 | 27 | if (!$xml) { |
| 28 | - if ($dev === null) $dev=1; |
|
| 29 | -} |
|
| 28 | + if ($dev === null) { |
|
| 29 | + $dev=1; |
|
| 30 | + } |
|
| 31 | + } |
|
| 30 | 32 | |
| 31 | 33 | function dl_item($x, $y) { |
| 32 | 34 | echo "<tr><td valign=top align=right width=\"30%\">$x</td> |
@@ -91,7 +93,9 @@ discard block |
||
| 91 | 93 | } |
| 92 | 94 | |
| 93 | 95 | function show_version($pname, $i, $v) { |
| 94 | - if (!$v) return; |
|
| 96 | + if (!$v) { |
|
| 97 | + return; |
|
| 98 | + } |
|
| 95 | 99 | $num = $v["num"]; |
| 96 | 100 | $file = $v["file"]; |
| 97 | 101 | $status = $v["status"]; |
@@ -139,20 +143,30 @@ discard block |
||
| 139 | 143 | } |
| 140 | 144 | list_bar($long_name, $description); |
| 141 | 145 | foreach ($p["versions"] as $i=>$v) { |
| 142 | - if ($min_version && version_compare($v['num'], $min_version, "<")) continue; |
|
| 143 | - if ($max_version && version_compare($v['num'], $max_version, ">")) continue; |
|
| 144 | - if (!$dev && is_dev($v)) continue; |
|
| 146 | + if ($min_version && version_compare($v['num'], $min_version, "<")) { |
|
| 147 | + continue; |
|
| 148 | + } |
|
| 149 | + if ($max_version && version_compare($v['num'], $max_version, ">")) { |
|
| 150 | + continue; |
|
| 151 | + } |
|
| 152 | + if (!$dev && is_dev($v)) { |
|
| 153 | + continue; |
|
| 154 | + } |
|
| 145 | 155 | show_version($short_name, $i, $v); |
| 146 | 156 | } |
| 147 | 157 | } |
| 148 | 158 | |
| 149 | 159 | function show_platform_xml($short_name, $p, $dev) { |
| 150 | 160 | foreach ($p["versions"] as $i=>$v) { |
| 151 | - if (!$dev && is_dev($v)) continue; |
|
| 161 | + if (!$dev && is_dev($v)) { |
|
| 162 | + continue; |
|
| 163 | + } |
|
| 152 | 164 | // show only those builds that have been around for over three days. |
| 153 | 165 | // Gives us time to address any showstoppers |
| 154 | 166 | // found by the early adopters |
| 155 | - if (!$dev && ((time() - strtotime($v["date"])) <= 86400*3)) continue; |
|
| 167 | + if (!$dev && ((time() - strtotime($v["date"])) <= 86400*3)) { |
|
| 168 | + continue; |
|
| 169 | + } |
|
| 156 | 170 | show_version_xml($v, $p); |
| 157 | 171 | } |
| 158 | 172 | } |
@@ -53,7 +53,9 @@ |
||
| 53 | 53 | if ($x) { |
| 54 | 54 | $f = fopen($fn, "w"); |
| 55 | 55 | fwrite($f, $x); |
| 56 | - } else return; |
|
| 56 | + } else { |
|
| 57 | + return; |
|
| 58 | + } |
|
| 57 | 59 | } |
| 58 | 60 | $x = file_get_contents($fn); |
| 59 | 61 | $users = parse_element($x, "<participants_active>"); |
@@ -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 | } |