@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | ->condition('fid', $flag_ids, 'IN') |
| 27 | 27 | ->condition('uid', $account->uid, '=') |
| 28 | 28 | ->condition('content_type', 'user', '=') |
| 29 | - ->fields('f',array('content_id')) |
|
| 29 | + ->fields('f', array('content_id')) |
|
| 30 | 30 | ->execute() |
| 31 | 31 | ->fetchAll(); |
| 32 | 32 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $uids = array(); |
| 39 | - foreach($result as $row) { |
|
| 39 | + foreach ($result as $row) { |
|
| 40 | 40 | $uids[] = (integer) $row->content_id; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | function commons_polls_form_node_form_alter(&$form, &$form_state, $form_id) { |
| 26 | 26 | $node = $form['#node']; |
| 27 | 27 | |
| 28 | - list(, , $bundle) = entity_extract_ids('node', $node); |
|
| 28 | + list(,, $bundle) = entity_extract_ids('node', $node); |
|
| 29 | 29 | |
| 30 | 30 | if ($bundle == 'poll' && empty($node->nid)) { |
| 31 | 31 | drupal_set_title(t('Create a poll')); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | function commons_polls_form_node_form_alter(&$form, &$form_state, $form_id) { |
| 26 | 26 | $node = $form['#node']; |
| 27 | 27 | |
| 28 | - list(, , $bundle) = entity_extract_ids('node', $node); |
|
| 28 | + list(,, $bundle) = entity_extract_ids('node', $node); |
|
| 29 | 29 | |
| 30 | 30 | if ($bundle == 'poll' && empty($node->nid)) { |
| 31 | 31 | drupal_set_title(t('Create a poll')); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | function commons_polls_form_node_form_alter(&$form, &$form_state, $form_id) { |
| 26 | 26 | $node = $form['#node']; |
| 27 | 27 | |
| 28 | - list(, , $bundle) = entity_extract_ids('node', $node); |
|
| 28 | + list(,, $bundle) = entity_extract_ids('node', $node); |
|
| 29 | 29 | |
| 30 | 30 | if ($bundle == 'poll' && empty($node->nid)) { |
| 31 | 31 | drupal_set_title(t('Create a poll')); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $commons_topics_entity_types = commons_topics_get_entity_types_with_topics(); |
| 20 | 20 | if (!empty($commons_topics_entity_types)) { |
| 21 | 21 | foreach ($commons_topics_entity_types as $entity_type => $bundles) { |
| 22 | - foreach(array_keys($bundles) as $bundle) { |
|
| 22 | + foreach (array_keys($bundles) as $bundle) { |
|
| 23 | 23 | $info['features']['field_instance'][] = "$entity_type-$bundle-field_topics"; |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | ); |
| 43 | 43 | $form['topics_wrapper']['field_topics'] = $form['field_topics']; |
| 44 | 44 | $form['field_topics'] = array('#language' => NULL); |
| 45 | - $form['#attached']['js'][] = drupal_get_path('module', 'commons_topics') . '/js/commons_topics.js'; |
|
| 45 | + $form['#attached']['js'][] = drupal_get_path('module', 'commons_topics').'/js/commons_topics.js'; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $commons_groups_entity_types = commons_groups_get_group_content_entity_types(); |
| 14 | 14 | if (!empty($commons_groups_entity_types)) { |
| 15 | 15 | foreach ($commons_groups_entity_types as $entity_type => $bundles) { |
| 16 | - foreach(array_keys($bundles) as $bundle) { |
|
| 16 | + foreach (array_keys($bundles) as $bundle) { |
|
| 17 | 17 | commons_groups_field_definition($field_instances, $entity_type, $bundle); |
| 18 | 18 | } |
| 19 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | // to create the group audience field for it when installing the profile. |
| 26 | 26 | $group_bundles['node'] = array('group' => TRUE); |
| 27 | 27 | } |
| 28 | - foreach(array_keys($group_bundles['node']) as $bundle) { |
|
| 28 | + foreach (array_keys($group_bundles['node']) as $bundle) { |
|
| 29 | 29 | commons_groups_field_definition_group($field_instances, 'node', $bundle); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | ); |
| 258 | 258 | |
| 259 | 259 | // Exported field_instance: 'node-group-group_group' |
| 260 | - $field_instances["$entity_type-$bundle-" . OG_GROUP_FIELD] = array( |
|
| 260 | + $field_instances["$entity_type-$bundle-".OG_GROUP_FIELD] = array( |
|
| 261 | 261 | 'bundle' => $bundle, |
| 262 | 262 | 'default_value' => array( |
| 263 | 263 | 0 => array( |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $hidden_permissions = array('subscribe', 'subscribe without approval'); |
| 29 | 29 | foreach ($hidden_permissions as $permission) { |
| 30 | 30 | if (isset($form['permission'][$permission])) { |
| 31 | - $form['permission'][$permission]['#markup'] .= ' ' . t('<strong>Disabled by the Commons Groups module.<strong>'); |
|
| 31 | + $form['permission'][$permission]['#markup'] .= ' '.t('<strong>Disabled by the Commons Groups module.<strong>'); |
|
| 32 | 32 | } |
| 33 | 33 | foreach ($form['checkboxes'] as $index => $elements) { |
| 34 | 34 | if (isset($elements['#options'][$permission])) { |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | function commons_groups_help($path, $arg) { |
| 69 | 69 | if (variable_get('commons_groups_needs_update', FALSE)) { |
| 70 | - $message = '<p>' . t("Drupal Commons 3.3 added a new, required field to control group privacy. Please edit your group(s) select one of the privacy options. Once all groups are |
|
| 71 | - set, an administrator can dismiss the update notice.") . '</p>'; |
|
| 70 | + $message = '<p>'.t("Drupal Commons 3.3 added a new, required field to control group privacy. Please edit your group(s) select one of the privacy options. Once all groups are |
|
| 71 | + set, an administrator can dismiss the update notice.").'</p>'; |
|
| 72 | 72 | if ($path == 'admin/content/groups/update') { |
| 73 | 73 | return $message; |
| 74 | 74 | } |
| 75 | 75 | elseif ($arg[0] == 'node' && $arg[2] == 'edit') { |
| 76 | 76 | $node = menu_get_object(); |
| 77 | - if($node->type == 'group' && empty($node->field_og_subscribe_settings)) { |
|
| 77 | + if ($node->type == 'group' && empty($node->field_og_subscribe_settings)) { |
|
| 78 | 78 | return $message; |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $breadcrumb[] = l(t('Groups'), 'groups'); |
| 98 | 98 | $group = node_load($entity->og_group_ref[LANGUAGE_NONE][0]['target_id']); |
| 99 | 99 | if (node_access('view', $group)) { |
| 100 | - $breadcrumb[] = l($group->title, 'node/' . $group->nid); |
|
| 100 | + $breadcrumb[] = l($group->title, 'node/'.$group->nid); |
|
| 101 | 101 | } |
| 102 | 102 | drupal_set_breadcrumb($breadcrumb); |
| 103 | 103 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | function commons_groups_form_node_form_alter(&$form, &$form_state, $form_id) { |
| 110 | 110 | $node = $form['#node']; |
| 111 | 111 | |
| 112 | - list(, , $bundle) = entity_extract_ids('node', $node); |
|
| 112 | + list(,, $bundle) = entity_extract_ids('node', $node); |
|
| 113 | 113 | |
| 114 | 114 | // Customizations to the node form for entities that are group content. |
| 115 | 115 | $group_content_entity_types = commons_groups_get_group_content_entity_types(); |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | // is selected. |
| 136 | 136 | $form['field_og_access_default_value']['#states'] = array( |
| 137 | 137 | 'visible' => array( |
| 138 | - ':input[name="field_og_subscribe_settings[' . LANGUAGE_NONE . ']"]' => array('value' => 'approval'), |
|
| 138 | + ':input[name="field_og_subscribe_settings['.LANGUAGE_NONE.']"]' => array('value' => 'approval'), |
|
| 139 | 139 | ), |
| 140 | 140 | ); |
| 141 | 141 | |
| 142 | 142 | $form['#after_build'] = array('commons_groups_form_group_node_after_build'); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $form['#attached']['css'][] = drupal_get_path('module', 'commons_groups') . '/css/commons_groups.css'; |
|
| 145 | + $form['#attached']['css'][] = drupal_get_path('module', 'commons_groups').'/css/commons_groups.css'; |
|
| 146 | 146 | |
| 147 | 147 | // The group access is set on commons_groups_node_presave(). |
| 148 | 148 | $form['group_access'][LANGUAGE_NONE]['#required'] = FALSE; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | return ''; |
| 300 | 300 | } |
| 301 | 301 | $contributors_count = $view->total_rows; |
| 302 | - $output .= l(format_plural($contributors_count, '1 contributor', '@count contributors'), 'node/' . $group->nid . '/contributors'); |
|
| 302 | + $output .= l(format_plural($contributors_count, '1 contributor', '@count contributors'), 'node/'.$group->nid.'/contributors'); |
|
| 303 | 303 | } |
| 304 | 304 | // Format the list of topics: |
| 305 | 305 | if (!empty($group->field_topics[LANGUAGE_NONE])) { |
@@ -310,14 +310,14 @@ discard block |
||
| 310 | 310 | $topics_text = ' discussing the @topics '; |
| 311 | 311 | $t_args = array('@topics' => format_plural(count($topics), 'topic', 'topics')); |
| 312 | 312 | foreach ($topics as $topic) { |
| 313 | - $topics_text .= '!topic-' . $topic->tid; |
|
| 313 | + $topics_text .= '!topic-'.$topic->tid; |
|
| 314 | 314 | if ($topic == end($topics)) { |
| 315 | 315 | $topics_text .= '.'; |
| 316 | 316 | } |
| 317 | 317 | else { |
| 318 | 318 | $topics_text .= ', '; |
| 319 | 319 | } |
| 320 | - $t_args['!topic-' . $topic->tid] = l(t($topic->name), 'taxonomy/term/' . $topic->tid); |
|
| 320 | + $t_args['!topic-'.$topic->tid] = l(t($topic->name), 'taxonomy/term/'.$topic->tid); |
|
| 321 | 321 | } |
| 322 | 322 | $output .= t($topics_text, $t_args); |
| 323 | 323 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | if ($form_id == 'edit_profile_user_profile_form' || substr($form_id, -10) === '_node_form') { |
| 362 | 362 | $internal_fields = array('field_unread_invitations', 'field_unread_messages', 'user_trusted_contacts', 'og_user_group_ref', 'group_access'); |
| 363 | 363 | foreach ($internal_fields as $field_name) { |
| 364 | - if(isset($form[$field_name])) { |
|
| 364 | + if (isset($form[$field_name])) { |
|
| 365 | 365 | $form[$field_name]['#access'] = FALSE; |
| 366 | 366 | } |
| 367 | 367 | } |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | function commons_groups_node_in_group_submit(&$form, &$form_state) { |
| 382 | 382 | if (isset($form_state['values']['og_group_ref'][LANGUAGE_NONE][0])) { |
| 383 | 383 | $group = $form_state['values']['og_group_ref'][LANGUAGE_NONE][0]['target_id']; |
| 384 | - $form_state['redirect'] = 'node/' . $group; |
|
| 384 | + $form_state['redirect'] = 'node/'.$group; |
|
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | |
| 455 | 455 | if (!isset($commons_entity_integrations)) { |
| 456 | 456 | foreach (module_implements('commons_entity_integration') as $module) { |
| 457 | - $commons_entity_integrations[$module] = call_user_func($module . '_commons_entity_integration'); |
|
| 457 | + $commons_entity_integrations[$module] = call_user_func($module.'_commons_entity_integration'); |
|
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
@@ -647,14 +647,14 @@ discard block |
||
| 647 | 647 | function commons_groups_related_groups_text($related_groups) { |
| 648 | 648 | // In 1 group: "in the x group" |
| 649 | 649 | if (count($related_groups) == 1) { |
| 650 | - return t(' in the !group group', array('!group' => l($related_groups[0]->title, 'node/' . $related_groups[0]->nid))); |
|
| 650 | + return t(' in the !group group', array('!group' => l($related_groups[0]->title, 'node/'.$related_groups[0]->nid))); |
|
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | // In 2 groups: "in the x and y groups" |
| 654 | 654 | if (count($related_groups) == 2) { |
| 655 | 655 | return t(' in the !group-0 and !group-1 groups', array( |
| 656 | - '!group-0' => l($related_groups[0]->title, 'node/' . $related_groups[0]->nid), |
|
| 657 | - '!group-1' => l($related_groups[1]->title, 'node/' . $related_groups[1]->nid), |
|
| 656 | + '!group-0' => l($related_groups[0]->title, 'node/'.$related_groups[0]->nid), |
|
| 657 | + '!group-1' => l($related_groups[1]->title, 'node/'.$related_groups[1]->nid), |
|
| 658 | 658 | )); |
| 659 | 659 | } |
| 660 | 660 | |
@@ -666,11 +666,11 @@ discard block |
||
| 666 | 666 | // Prepare tokens for t() for each of the other groups. |
| 667 | 667 | foreach ($related_groups as $key => $this_group) { |
| 668 | 668 | $text .= "!group-$key, "; |
| 669 | - $t_args["!group-$key"] = l($this_group->title, 'node/' . $this_group->nid); |
|
| 669 | + $t_args["!group-$key"] = l($this_group->title, 'node/'.$this_group->nid); |
|
| 670 | 670 | } |
| 671 | 671 | // Prepare the last group token. |
| 672 | 672 | $text .= " and !group-$last_group->nid groups."; |
| 673 | - $t_args["!group-$last_group->nid"] = l($last_group->title, 'node/' . $last_group->nid); |
|
| 673 | + $t_args["!group-$last_group->nid"] = l($last_group->title, 'node/'.$last_group->nid); |
|
| 674 | 674 | // Prepare the full text with all of the groups and their tokens: |
| 675 | 675 | return t($text, $t_args); |
| 676 | 676 | } |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | // Determine whether the group is private according to the subscription |
| 754 | 754 | // field. |
| 755 | 755 | $private = $wrapper->field_og_subscribe_settings->value() == 'invitation'; |
| 756 | - $wrapper->{OG_ACCESS_FIELD}->set((int)$private); |
|
| 756 | + $wrapper->{OG_ACCESS_FIELD}->set((int) $private); |
|
| 757 | 757 | return; |
| 758 | 758 | } |
| 759 | 759 | |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | 'alt' => $alt, |
| 989 | 989 | ), |
| 990 | 990 | '#path' => array( |
| 991 | - 'path' => 'user/' . $account->uid, |
|
| 991 | + 'path' => 'user/'.$account->uid, |
|
| 992 | 992 | 'options' => array( |
| 993 | 993 | 'attributes' => array( |
| 994 | 994 | 'title' => t("View @user's profile.", array('@user' => format_username($account))), |
@@ -1073,12 +1073,12 @@ discard block |
||
| 1073 | 1073 | return $element; |
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | - list($id, , $bundle) = entity_extract_ids($entity_type, $entity); |
|
| 1076 | + list($id,, $bundle) = entity_extract_ids($entity_type, $entity); |
|
| 1077 | 1077 | |
| 1078 | 1078 | // The user has a pending membership request. Let her know that |
| 1079 | 1079 | // her request is pending review. |
| 1080 | 1080 | if (og_is_member($entity_type, $id, 'user', $account, array(OG_STATE_PENDING))) { |
| 1081 | - $element[0] = array('#markup' => '<div class="subscription-type">' . t('Your membership request is pending review by a group organizer.') . '</div>'); |
|
| 1081 | + $element[0] = array('#markup' => '<div class="subscription-type">'.t('Your membership request is pending review by a group organizer.').'</div>'); |
|
| 1082 | 1082 | return $element; |
| 1083 | 1083 | } |
| 1084 | 1084 | // If user is blocked, they should not be able to apply for membership. |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | |
| 1129 | 1129 | $url = "group/$entity_type/$id/subscribe"; |
| 1130 | 1130 | if ($settings['field_name']) { |
| 1131 | - $url .= '/' . $settings['field_name']; |
|
| 1131 | + $url .= '/'.$settings['field_name']; |
|
| 1132 | 1132 | } |
| 1133 | 1133 | // Set the needs update hook if we end up with a group call that is missing |
| 1134 | 1134 | // the subscribe settings. We also check the variable first, because we |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | } |
| 1155 | 1155 | } |
| 1156 | 1156 | else { |
| 1157 | - $element[0] = array('#markup' => '<div class="subscription-type">' . t('Invite-only group') . '</div>'); |
|
| 1157 | + $element[0] = array('#markup' => '<div class="subscription-type">'.t('Invite-only group').'</div>'); |
|
| 1158 | 1158 | return $element; |
| 1159 | 1159 | } |
| 1160 | 1160 | } |
@@ -1170,7 +1170,7 @@ discard block |
||
| 1170 | 1170 | ); |
| 1171 | 1171 | |
| 1172 | 1172 | if (!empty($subscription_type)) { |
| 1173 | - $element[0]['#prefix'] = '<div class="subscription-type">' . $subscription_type . '</div>'; |
|
| 1173 | + $element[0]['#prefix'] = '<div class="subscription-type">'.$subscription_type.'</div>'; |
|
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | 1176 | return $element; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | function commons_polls_form_node_form_alter(&$form, &$form_state, $form_id) { |
| 26 | 26 | $node = $form['#node']; |
| 27 | 27 | |
| 28 | - list(, , $bundle) = entity_extract_ids('node', $node); |
|
| 28 | + list(,, $bundle) = entity_extract_ids('node', $node); |
|
| 29 | 29 | |
| 30 | 30 | if ($bundle == 'poll' && empty($node->nid)) { |
| 31 | 31 | drupal_set_title(t('Create a poll')); |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $form['choice_wrapper']['add_choice'] = array( |
| 83 | - '#markup' => '<a href="#" id="add-choice">' . t('Add more choices') . '</a>', |
|
| 83 | + '#markup' => '<a href="#" id="add-choice">'.t('Add more choices').'</a>', |
|
| 84 | 84 | ); |
| 85 | 85 | |
| 86 | - $form['#attached']['js'][] = drupal_get_path('module', 'commons_polls') . '/js/commons_polls_partial_form.js'; |
|
| 86 | + $form['#attached']['js'][] = drupal_get_path('module', 'commons_polls').'/js/commons_polls_partial_form.js'; |
|
| 87 | 87 | |
| 88 | 88 | $form['actions']['submit']['#value'] = t('Create'); |
| 89 | 89 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | if (!empty($commons_radioactivity_entity_types)) { |
| 34 | 34 | foreach ($commons_radioactivity_entity_types as $entity_type => $bundles) { |
| 35 | - foreach(array_keys($bundles) as $bundle) { |
|
| 35 | + foreach (array_keys($bundles) as $bundle) { |
|
| 36 | 36 | $info['features']['field_instance'][] = "$entity_type-$bundle-field_radioactivity"; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $form['field_radioactivity']['#attributes'] = array( |
| 56 | 56 | 'class' => array('radioactivity-form-energy'), |
| 57 | 57 | ); |
| 58 | - $form['field_radioactivity']['#attached']['js'][] = drupal_get_path('module', 'commons_radioactivity') . '/commons_radioactivity.js'; |
|
| 58 | + $form['field_radioactivity']['#attached']['js'][] = drupal_get_path('module', 'commons_radioactivity').'/commons_radioactivity.js'; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | // Only operate on nodes that have the radioactivity field. |
| 99 | 99 | if (!empty($node->field_radioactivity)) { |
| 100 | 100 | // Find the node's ID and bundle. |
| 101 | - list($id, , $bundle) = entity_extract_ids('node', $node); |
|
| 101 | + list($id,, $bundle) = entity_extract_ids('node', $node); |
|
| 102 | 102 | |
| 103 | 103 | // Prevent groups from going negative in energy. |
| 104 | 104 | if ($bundle == 'group' && $node->field_radioactivity[LANGUAGE_NONE][0]['radioactivity_energy'] + $value >= 0) { |