@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | foreach ($iconify as $name) { |
| 36 | 36 | if (isset($element[$name])) { |
| 37 | 37 | $words = explode(' ', $element[$name]['title']); |
| 38 | - foreach($words as &$word) { |
|
| 39 | - if(is_numeric($word)) { |
|
| 38 | + foreach ($words as &$word) { |
|
| 39 | + if (is_numeric($word)) { |
|
| 40 | 40 | $word = '<span class="notification-count">' . $word . '</span>'; |
| 41 | 41 | } |
| 42 | 42 | else { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | /** |
| 253 | 253 | * Helper function to examine menu links and return the appropriate class. |
| 254 | 254 | */ |
| 255 | -function commons_origins_menu_link_class(&$element) { |
|
| 255 | +function commons_origins_menu_link_class(&$element) { |
|
| 256 | 256 | if ($element['#original_link']['menu_name'] == 'main-menu') { |
| 257 | 257 | $element['#attributes']['class'][] = drupal_html_class($element['#original_link']['menu_name'] . '-' . $element['#original_link']['router_path']); |
| 258 | 258 | } |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | 'field_related_question', |
| 400 | 400 | 'field_topics', |
| 401 | 401 | ); |
| 402 | - foreach($related_information as $field) { |
|
| 402 | + foreach ($related_information as $field) { |
|
| 403 | 403 | if (!empty($variables['content'][$field])) { |
| 404 | 404 | $variables['content']['related_information'][$field] = $variables['content'][$field]; |
| 405 | 405 | hide($variables['content'][$field]); |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | /** |
| 623 | 623 | * Implements hook_preprocess_pager(). |
| 624 | 624 | */ |
| 625 | -function commons_origins_preprocess_pager_link (&$variables, $hook) { |
|
| 625 | +function commons_origins_preprocess_pager_link(&$variables, $hook) { |
|
| 626 | 626 | // Style pager links like buttons. |
| 627 | 627 | $variables['attributes']['class'][] = 'action-item'; |
| 628 | 628 | $variables['attributes']['class'][] = 'action-item-inline'; |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | // Set an identifying class to the event attendance form. |
| 688 | - if(strpos($element['#id'], 'commons-events-attend-event-form') === 0) { |
|
| 688 | + if (strpos($element['#id'], 'commons-events-attend-event-form') === 0) { |
|
| 689 | 689 | $variables['attributes_array']['class'][] = 'node-actions'; |
| 690 | 690 | } |
| 691 | 691 | |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | $output = ''; |
| 1177 | 1177 | |
| 1178 | 1178 | // Add Microformat classes to each address. |
| 1179 | - foreach($variables['items'] as &$address) { |
|
| 1179 | + foreach ($variables['items'] as &$address) { |
|
| 1180 | 1180 | // Only display an address if it has been populated. We determine this by |
| 1181 | 1181 | // validating that the administrative area has been populated. |
| 1182 | 1182 | if (!empty($address['#address']['administrative_area'])) { |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | $variables['user_profile'][$action]['#access'] = FALSE; |
| 1261 | 1261 | } |
| 1262 | 1262 | } |
| 1263 | - if (!module_exists('commons_trusted_contacts') && isset( $variables['user_profile']['user_actions']['group_group'])) { |
|
| 1263 | + if (!module_exists('commons_trusted_contacts') && isset($variables['user_profile']['user_actions']['group_group'])) { |
|
| 1264 | 1264 | $variables['user_profile']['user_actions']['group_group']['#access'] = FALSE; |
| 1265 | 1265 | } |
| 1266 | 1266 | if (!empty($variables['user_profile']['user_actions'])) { |
@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | foreach($words as &$word) { |
| 39 | 39 | if(is_numeric($word)) { |
| 40 | 40 | $word = '<span class="notification-count">' . $word . '</span>'; |
| 41 | - } |
|
| 42 | - else { |
|
| 41 | + } else { |
|
| 43 | 42 | $word = '<span class="notification-label element-invisible">' . $word . '</span>'; |
| 44 | 43 | } |
| 45 | 44 | } |
@@ -321,8 +320,7 @@ discard block |
||
| 321 | 320 | if ($name != 'comment_forbidden' && $name != 'answer-add' && !is_string($link['attributes']['class'])) { |
| 322 | 321 | $link['attributes']['class'][] = 'action-item-small'; |
| 323 | 322 | $link['attributes']['class'][] = 'action-item-inline'; |
| 324 | - } |
|
| 325 | - elseif ($name != 'comment_forbidden' && $name != 'answer-add') { |
|
| 323 | + } elseif ($name != 'comment_forbidden' && $name != 'answer-add') { |
|
| 326 | 324 | $link['attributes']['class'] .= ' action-item-small action-item-inline'; |
| 327 | 325 | } |
| 328 | 326 | } |
@@ -343,8 +341,7 @@ discard block |
||
| 343 | 341 | foreach ($chunks as &$chunk) { |
| 344 | 342 | if ($chunk == $variables['comment_count']) { |
| 345 | 343 | $chunk = '<span class="action-item-small-append">' . $variables['comment_count'] . '</span>'; |
| 346 | - } |
|
| 347 | - else { |
|
| 344 | + } else { |
|
| 348 | 345 | $chunk = '<span class="element-invisible">' . $chunk . '</span>'; |
| 349 | 346 | } |
| 350 | 347 | } |
@@ -473,8 +470,7 @@ discard block |
||
| 473 | 470 | // Style the flag links like buttons. |
| 474 | 471 | if ($variables['last_action'] == 'flagged') { |
| 475 | 472 | $variables['flag_classes_array'][] = 'action-item-small-active'; |
| 476 | - } |
|
| 477 | - else { |
|
| 473 | + } else { |
|
| 478 | 474 | $variables['flag_classes_array'][] = 'action-item-small'; |
| 479 | 475 | } |
| 480 | 476 | $variables['flag_classes'] = implode(' ', $variables['flag_classes_array']); |
@@ -612,8 +608,7 @@ discard block |
||
| 612 | 608 | foreach ($view->result as $id => $result) { |
| 613 | 609 | if (isset($result->node_type)) { |
| 614 | 610 | $variables['classes_array'][$id] .= ' ' . drupal_html_class('row-type-' . $result->node_type); |
| 615 | - } |
|
| 616 | - else if (($view->name == 'commons_events_upcoming' && $view->override_path != 'events') || $view->name == 'commons_events_user_upcoming_events') { |
|
| 611 | + } else if (($view->name == 'commons_events_upcoming' && $view->override_path != 'events') || $view->name == 'commons_events_user_upcoming_events') { |
|
| 617 | 612 | $variables['classes_array'][$id] .= ' ' . drupal_html_class('row-type-event'); |
| 618 | 613 | } |
| 619 | 614 | } |
@@ -651,8 +646,7 @@ discard block |
||
| 651 | 646 | // Roll the classes into the attributes. |
| 652 | 647 | if (empty($variables['attributes_array']['class'])) { |
| 653 | 648 | $variables['attributes_array']['class'] = $variables['classes_array']; |
| 654 | - } |
|
| 655 | - else { |
|
| 649 | + } else { |
|
| 656 | 650 | $variables['attributes_array']['class'] = array_merge($variables['attributes_array']['class'], $variables['classes_array']); |
| 657 | 651 | } |
| 658 | 652 | |
@@ -834,8 +828,7 @@ discard block |
||
| 834 | 828 | return '<span class="' . $classes . '" id="rate-button-' . $id . '">' . |
| 835 | 829 | '<span class="element-invisible">' . check_plain($text) . '</span>' . |
| 836 | 830 | '</span>'; |
| 837 | - } |
|
| 838 | - else { |
|
| 831 | + } else { |
|
| 839 | 832 | return '<a class="' . $classes . '" id="rate-button-' . $id . '" rel="nofollow" href="' . htmlentities($href) . '" title="' . check_plain($text) . '">' . |
| 840 | 833 | '<span class="element-invisible">' . check_plain($text) . '</span>' . |
| 841 | 834 | '</a>'; |
@@ -851,8 +844,7 @@ discard block |
||
| 851 | 844 | if (is_array($form['#theme'])) { |
| 852 | 845 | $hooks = array('form_content'); |
| 853 | 846 | $form['#theme'] = array_merge($form['#theme'], $hooks); |
| 854 | - } |
|
| 855 | - else { |
|
| 847 | + } else { |
|
| 856 | 848 | $form['#theme'] = array( |
| 857 | 849 | $form['#theme'], |
| 858 | 850 | 'form_content', |
@@ -1000,8 +992,7 @@ discard block |
||
| 1000 | 992 | if (isset($link['href'])) { |
| 1001 | 993 | // Pass in $link as $options, they share the same keys. |
| 1002 | 994 | $output .= l($link['title'], $link['href'], $link); |
| 1003 | - } |
|
| 1004 | - elseif (!empty($link['title'])) { |
|
| 995 | + } elseif (!empty($link['title'])) { |
|
| 1005 | 996 | // Some links are actually not links, but we wrap these in <span> for adding title and class attributes. |
| 1006 | 997 | if (empty($link['html'])) { |
| 1007 | 998 | $link['title'] = check_plain($link['title']); |
@@ -1098,8 +1089,7 @@ discard block |
||
| 1098 | 1089 | } |
| 1099 | 1090 | if (isset($item['#href']) && strpos($item['#href'], 'messages')) { |
| 1100 | 1091 | $item['#options']['attributes']['class'][] = 'message-contact'; |
| 1101 | - } |
|
| 1102 | - elseif (isset($item['#href'])) { |
|
| 1092 | + } elseif (isset($item['#href'])) { |
|
| 1103 | 1093 | $item['#options']['attributes']['class'][] = 'trusted-status-request'; |
| 1104 | 1094 | } |
| 1105 | 1095 | } |
@@ -1118,8 +1108,7 @@ discard block |
||
| 1118 | 1108 | |
| 1119 | 1109 | if (!isset($element['#value'])) { |
| 1120 | 1110 | return '<' . $element['#tag'] . $attributes . " />\n"; |
| 1121 | - } |
|
| 1122 | - else { |
|
| 1111 | + } else { |
|
| 1123 | 1112 | $output = '<' . $element['#tag'] . $attributes . '>'; |
| 1124 | 1113 | if (isset($element['#value_prefix'])) { |
| 1125 | 1114 | $output .= $element['#value_prefix']; |
@@ -1152,8 +1141,7 @@ discard block |
||
| 1152 | 1141 | if (isset($item['#type']) && $item['#type'] == 'link') { |
| 1153 | 1142 | if (strpos($item['#href'], '/subscribe')) { |
| 1154 | 1143 | $item['#options']['attributes']['class'][] = 'action-item-primary'; |
| 1155 | - } |
|
| 1156 | - else { |
|
| 1144 | + } else { |
|
| 1157 | 1145 | $item['#options']['attributes']['class'][] = 'action-item'; |
| 1158 | 1146 | } |
| 1159 | 1147 | } |
@@ -1181,8 +1169,7 @@ discard block |
||
| 1181 | 1169 | // validating that the administrative area has been populated. |
| 1182 | 1170 | if (!empty($address['#address']['administrative_area'])) { |
| 1183 | 1171 | _commons_origins_format_address($address); |
| 1184 | - } |
|
| 1185 | - else { |
|
| 1172 | + } else { |
|
| 1186 | 1173 | // Deny access to incomplete addresses. |
| 1187 | 1174 | $address['#access'] = FALSE; |
| 1188 | 1175 | } |
@@ -1220,8 +1207,7 @@ discard block |
||
| 1220 | 1207 | // If an address is incomplete, remove it and tell the system a |
| 1221 | 1208 | // rebuild is needed. |
| 1222 | 1209 | unset($variables['row']->field_field_address[$key]); |
| 1223 | - } |
|
| 1224 | - else { |
|
| 1210 | + } else { |
|
| 1225 | 1211 | _commons_origins_format_address($address['rendered']); |
| 1226 | 1212 | } |
| 1227 | 1213 | } |
@@ -1294,8 +1280,7 @@ discard block |
||
| 1294 | 1280 | if (module_exists('timeago') && variable_get('timeago_node', 1)) { |
| 1295 | 1281 | $variables['date'] = timeago_format_date($node->created, $variables['date']); |
| 1296 | 1282 | $use_timeago_date_format = TRUE; |
| 1297 | - } |
|
| 1298 | - else { |
|
| 1283 | + } else { |
|
| 1299 | 1284 | $use_timeago_date_format = FALSE; |
| 1300 | 1285 | } |
| 1301 | 1286 | |
@@ -1318,16 +1303,13 @@ discard block |
||
| 1318 | 1303 | $placeholders['!group'] = l($wrapper->{OG_AUDIENCE_FIELD}->get(0)->label(), 'node/' . $wrapper->{OG_AUDIENCE_FIELD}->get(0)->getIdentifier()); |
| 1319 | 1304 | if ($use_timeago_date_format == TRUE) { |
| 1320 | 1305 | $variables['submitted'] = t('!type created !date in the !group group by !user', $placeholders); |
| 1321 | - } |
|
| 1322 | - else { |
|
| 1306 | + } else { |
|
| 1323 | 1307 | $variables['submitted'] = t('!type created @interval ago in the !group group by !user', $placeholders); |
| 1324 | 1308 | } |
| 1325 | - } |
|
| 1326 | - else { |
|
| 1309 | + } else { |
|
| 1327 | 1310 | if ($use_timeago_date_format == TRUE) { |
| 1328 | 1311 | $variables['submitted'] = t('!type created !date by !user', $placeholders); |
| 1329 | - } |
|
| 1330 | - else { |
|
| 1312 | + } else { |
|
| 1331 | 1313 | $variables['submitted'] = t('!type created @interval ago by !user', $placeholders); |
| 1332 | 1314 | } |
| 1333 | 1315 | } |
@@ -33,8 +33,7 @@ |
||
| 33 | 33 | $permission = "create $bundle content"; |
| 34 | 34 | if ($group_id && !og_user_access('node', $group_id, $permission)) { |
| 35 | 35 | return; |
| 36 | - } |
|
| 37 | - elseif (!user_access($permission)) { |
|
| 36 | + } elseif (!user_access($permission)) { |
|
| 38 | 37 | return; |
| 39 | 38 | } |
| 40 | 39 | |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - * commons_bw.features.field_base.inc |
|
| 5 | - */ |
|
| 3 | + * @file |
|
| 4 | + * commons_bw.features.field_base.inc |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Implements hook_field_default_field_bases(). |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - * commons_bw.features.field_instance.inc |
|
| 5 | - */ |
|
| 3 | + * @file |
|
| 4 | + * commons_bw.features.field_instance.inc |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Implements hook_field_default_field_instances(). |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - * Code for the Commons Browsing Widget feature. |
|
| 5 | - */ |
|
| 3 | + * @file |
|
| 4 | + * Code for the Commons Browsing Widget feature. |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | include_once 'commons_bw.features.inc'; |
| 8 | 8 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | function commons_bw_form_views_exposed_form_alter(&$form, &$form_state, $form_id) { |
| 97 | 97 | // Implements tweaks to exposed filters and sorts per the Commons designs. |
| 98 | - if (strpos($form['#id'],'views-exposed-form-commons-bw') === 0) { |
|
| 98 | + if (strpos($form['#id'], 'views-exposed-form-commons-bw') === 0) { |
|
| 99 | 99 | // Remove the sort order (eg, descending vs ascending). |
| 100 | 100 | $form['sort_order']['#access'] = FALSE; |
| 101 | 101 | $form['sort_by']['#title'] = t('Sorted by'); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | // See if we're building for the first time, or getting pre-saved values. |
| 117 | 117 | $field_name = $form['#field']['field_name']; |
| 118 | 118 | |
| 119 | - if(!empty($form_state['field'][$field_name][LANGUAGE_NONE]['instance']['display_in_partial_form'])) { |
|
| 119 | + if (!empty($form_state['field'][$field_name][LANGUAGE_NONE]['instance']['display_in_partial_form'])) { |
|
| 120 | 120 | $display_default = $form_state['field'][$field_name][LANGUAGE_NONE]['instance']['display_in_partial_form']; |
| 121 | 121 | } |
| 122 | 122 | else if (isset($form_state['build_info']['args'][0]['display_in_partial_form'])) { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $instances = field_info_instances('node', $bundle); |
| 156 | 156 | |
| 157 | 157 | // Remove all fields except those marked as "display_in_partial_form". |
| 158 | - foreach($instances as $field_name => $instance) { |
|
| 158 | + foreach ($instances as $field_name => $instance) { |
|
| 159 | 159 | if (empty($instance['display_in_partial_form'])) { |
| 160 | 160 | unset($instances[$field_name]); |
| 161 | 161 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | field_attach_form('node', $node, $form, $form_state, entity_language('node', $node)); |
| 188 | 188 | |
| 189 | - foreach(element_children($form) as $field_name) { |
|
| 189 | + foreach (element_children($form) as $field_name) { |
|
| 190 | 190 | if (empty($instances[$field_name])) { |
| 191 | 191 | $form[$field_name]['#access'] = FALSE; |
| 192 | 192 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | $view->execute(); |
| 464 | 464 | |
| 465 | 465 | // Append the result count to the tab title. |
| 466 | - $tabs[$machine_name]['title'] = $tabs[$machine_name]['title'] . ' <span class="commons-bw-result-count">'. $view->total_rows . '</span>'; |
|
| 466 | + $tabs[$machine_name]['title'] = $tabs[$machine_name]['title'] . ' <span class="commons-bw-result-count">' . $view->total_rows . '</span>'; |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | // Use the current tab as the quicktabs default if the tab settings specify. |
@@ -118,11 +118,9 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | if(!empty($form_state['field'][$field_name][LANGUAGE_NONE]['instance']['display_in_partial_form'])) { |
| 120 | 120 | $display_default = $form_state['field'][$field_name][LANGUAGE_NONE]['instance']['display_in_partial_form']; |
| 121 | - } |
|
| 122 | - else if (isset($form_state['build_info']['args'][0]['display_in_partial_form'])) { |
|
| 121 | + } else if (isset($form_state['build_info']['args'][0]['display_in_partial_form'])) { |
|
| 123 | 122 | $display_default = $form_state['build_info']['args'][0]['display_in_partial_form']; |
| 124 | - } |
|
| 125 | - else { |
|
| 123 | + } else { |
|
| 126 | 124 | $display_default = FALSE; |
| 127 | 125 | } |
| 128 | 126 | |
@@ -174,13 +172,11 @@ discard block |
||
| 174 | 172 | if (module_exists('locale')) { |
| 175 | 173 | if (locale_multilingual_node_type($node->type)) { |
| 176 | 174 | $node->language = $language->language; |
| 177 | - } |
|
| 178 | - else { |
|
| 175 | + } else { |
|
| 179 | 176 | $default = language_default(); |
| 180 | 177 | $node->language = $default->language; |
| 181 | 178 | } |
| 182 | - } |
|
| 183 | - else { |
|
| 179 | + } else { |
|
| 184 | 180 | $node->language = LANGUAGE_NONE; |
| 185 | 181 | } |
| 186 | 182 | |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - * commons_bw.features.inc |
|
| 5 | - */ |
|
| 3 | + * @file |
|
| 4 | + * commons_bw.features.inc |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Implements hook_ctools_plugin_directory(). |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * commons_search.module |
|
| 4 | - * Code for the Commons Search feature. |
|
| 5 | - */ |
|
| 3 | + * commons_search.module |
|
| 4 | + * Code for the Commons Search feature. |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | include_once 'commons_search.features.inc'; |
| 8 | 8 | |
@@ -44,8 +44,7 @@ discard block |
||
| 44 | 44 | // We're using faceted core search, so change Site search key to reflect |
| 45 | 45 | // the change of search engines. |
| 46 | 46 | $site_key = 'o-search_facetapi'; |
| 47 | - } |
|
| 48 | - else { |
|
| 47 | + } else { |
|
| 49 | 48 | if (module_exists('apachesolr_search')) { |
| 50 | 49 | // Are we using Apache Solr? If so change the Site search key to reflect |
| 51 | 50 | // the change of search engines. |
@@ -106,14 +105,12 @@ discard block |
||
| 106 | 105 | // specified group. |
| 107 | 106 | $qm = (strpos($form_state['redirect'], '?') !== FALSE ? '' : '?'); |
| 108 | 107 | $form_state['redirect'] .= $qm . '&f[1]=sm_og_group_ref:node:' . $form_state['search_group_id']; |
| 109 | - } |
|
| 110 | - else { |
|
| 108 | + } else { |
|
| 111 | 109 | // Using core search to search within a group doesn't work, so we simply |
| 112 | 110 | // use a view with exposed search terms to do the searching. |
| 113 | 111 | drupal_goto('search/group/' . $form_state['search_group_id'], array('query' => array('keys' => $keys))); |
| 114 | 112 | } |
| 115 | - } |
|
| 116 | - else { |
|
| 113 | + } else { |
|
| 117 | 114 | if ($form_state['values']['custom_search_types'] == 'c-user') { |
| 118 | 115 | // Force update the redirect on User search since Custom Search is weird. |
| 119 | 116 | $keys = check_plain($form_state['values']['search_block_form']); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - * commons_search_core.facetapi_defaults.inc |
|
| 5 | - */ |
|
| 3 | + * @file |
|
| 4 | + * commons_search_core.facetapi_defaults.inc |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Implements hook_facetapi_default_facet_settings(). |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - * commons_search_core.features.inc |
|
| 5 | - */ |
|
| 3 | + * @file |
|
| 4 | + * commons_search_core.features.inc |
|
| 5 | + */ |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Implements hook_ctools_plugin_api(). |