@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | // If unset it wants a generic, unfilled context, which is just NULL. |
32 | 32 | if (empty($context->data) || !isset($context->data->uid)) { |
33 | 33 | $new_context = ctools_context_create_empty('node', NULL); |
34 | - } |
|
35 | - else { |
|
34 | + } else { |
|
36 | 35 | // Load the node for the requested type |
37 | 36 | $uid = $context->data->uid; |
38 | 37 | $content_profile_node = content_profile_load($conf['type'], $uid); |
@@ -44,8 +43,7 @@ discard block |
||
44 | 43 | // Have content profile relationships limit CCK field availability. |
45 | 44 | if (isset($new_context->restrictions['type'])) { |
46 | 45 | $new_context->restrictions['type'][] = $conf['type']; |
47 | - } |
|
48 | - else { |
|
46 | + } else { |
|
49 | 47 | $new_context->restrictions['type'] = array($conf['type']); |
50 | 48 | } |
51 | 49 | return $new_context; |
@@ -100,14 +100,11 @@ |
||
100 | 100 | $type = $action == 'add' ? $arg : $arg->type; |
101 | 101 | if (content_profile_get_settings($type, 'edit_tab') == 'top') { |
102 | 102 | return 'user/'. $uid . '/profile/'. $type; |
103 | - } |
|
104 | - elseif (content_profile_get_settings($type, 'edit_tab') == 'sub') { |
|
103 | + } elseif (content_profile_get_settings($type, 'edit_tab') == 'sub') { |
|
105 | 104 | return 'user/'. $uid . '/edit/'. $type; |
106 | - } |
|
107 | - elseif ($action == 'add') { |
|
105 | + } elseif ($action == 'add') { |
|
108 | 106 | return 'node/add/'. str_replace('_', '-', $arg); |
109 | - } |
|
110 | - else { |
|
107 | + } else { |
|
111 | 108 | return 'node/'. $arg->nid .'/edit'; |
112 | 109 | } |
113 | 110 | } |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | if (isset($form_state['node']) && $form_state['node']['type'] == $this->options['content-type']) { |
31 | 31 | $node = $form_state['node']; |
32 | - } |
|
33 | - else { |
|
32 | + } else { |
|
34 | 33 | if (isset($page)) { |
35 | 34 | $node = node_load(array( |
36 | 35 | 'type' => $this->options['content-type'], |
@@ -40,8 +39,7 @@ discard block |
||
40 | 39 | } |
41 | 40 | if (empty($node)) { |
42 | 41 | PageroutePageAdd::setNodeAddForm($form, $form_state, $page); |
43 | - } |
|
44 | - else { |
|
42 | + } else { |
|
45 | 43 | $this->setNodeEditForm($form, $form_state, $page, $args, $node); |
46 | 44 | } |
47 | 45 | parent::unsetForm($form); |
@@ -101,8 +99,7 @@ discard block |
||
101 | 99 | } |
102 | 100 | node_tag_new($node->nid); |
103 | 101 | $form += array('pageroute-view' => array('#value' => node_view($node, FALSE, TRUE, FALSE))); |
104 | - } |
|
105 | - else { |
|
102 | + } else { |
|
106 | 103 | $type_name = node_get_types('name', $page->options['content-type']); |
107 | 104 | $form += array('pageroute-view' => array('#value' => theme('content_profile_pageroute_empty', $type_name))); |
108 | 105 | } |
@@ -51,8 +51,7 @@ |
||
51 | 51 | if ($op == 'list') { |
52 | 52 | $blocks[0]['info'] = t('Mobile Menu Toggle'); |
53 | 53 | return $blocks; |
54 | - } |
|
55 | - elseif ($op == 'view') { |
|
54 | + } elseif ($op == 'view') { |
|
56 | 55 | $block = array(); |
57 | 56 | switch ($delta) { |
58 | 57 | case 0: |
@@ -177,8 +177,7 @@ |
||
177 | 177 | if ($exists) { |
178 | 178 | // If there is an existing entry, update. |
179 | 179 | db_query("UPDATE {pm_email_notify} SET email_notify_is_enabled = %d WHERE user_id = %d", $pm_email_enabled, $account->uid); |
180 | - } |
|
181 | - else { |
|
180 | + } else { |
|
182 | 181 | // If not, create a new one. |
183 | 182 | db_query("INSERT INTO {pm_email_notify} (email_notify_is_enabled, user_id) VALUES (%d, %d)", $pm_email_enabled, $account->uid); |
184 | 183 | } |
@@ -30,8 +30,7 @@ |
||
30 | 30 | // backwards compatability. |
31 | 31 | $variables['privatemsg_link'] = $variables['privatemsg']; |
32 | 32 | } |
33 | - } |
|
34 | - else { |
|
33 | + } else { |
|
35 | 34 | // Author Pane 1.x |
36 | 35 | |
37 | 36 | $image_path = $variables['image_path']; |
@@ -106,11 +106,9 @@ |
||
106 | 106 | function render($values) { |
107 | 107 | if (isset($values->uid)) { |
108 | 108 | $uid = $values->uid; |
109 | - } |
|
110 | - elseif (isset($values->users_uid)) { |
|
109 | + } elseif (isset($values->users_uid)) { |
|
111 | 110 | $uid = $values->users_uid; |
112 | - } |
|
113 | - else { |
|
111 | + } else { |
|
114 | 112 | return ''; |
115 | 113 | } |
116 | 114 | $text = t('Write private message'); |
@@ -112,8 +112,7 @@ discard block |
||
112 | 112 | if ($tag_id) { |
113 | 113 | // We are editing an existing tag, exclude the current tag from the search. |
114 | 114 | $exists = db_result(db_query("SELECT 1 FROM {pm_tags} WHERE tag = '%s' AND tag_id <> %d", $form_state['values']['tag'], $tag_id)); |
115 | - } |
|
116 | - else { |
|
115 | + } else { |
|
117 | 116 | $exists = db_result(db_query("SELECT 1 FROM {pm_tags} WHERE tag = '%s'", $form_state['values']['tag'])); |
118 | 117 | } |
119 | 118 | if ($exists) { |
@@ -130,8 +129,7 @@ discard block |
||
130 | 129 | db_query("UPDATE {pm_tags} SET tag = '%s', public = %d WHERE tag_id = %d", $form_state['values']['tag'], $form_state['values']['public'], $form_state['values']['tag_id']); |
131 | 130 | drupal_set_message(t('Tag updated.')); |
132 | 131 | $form_state['redirect'] = 'admin/settings/messages/tags'; |
133 | - } |
|
134 | - else { |
|
132 | + } else { |
|
135 | 133 | // Tag does not yet exist, create a new one. |
136 | 134 | db_query("INSERT INTO {pm_tags} (tag, public) VALUES ('%s', %d)", $form_state['values']['tag'], $form_state['values']['public']); |
137 | 135 | drupal_set_message(t('Tag created.')); |
@@ -192,8 +192,7 @@ discard block |
||
192 | 192 | if (empty($tag_id) && privatemsg_user_access('create private message tags')) { |
193 | 193 | db_query("INSERT INTO {pm_tags} (tag) VALUES ('%s')", $tag); |
194 | 194 | $tag_id = db_last_insert_id('pm_tags', 'tag_id'); |
195 | - } |
|
196 | - elseif (empty($tag_id)) { |
|
195 | + } elseif (empty($tag_id)) { |
|
197 | 196 | // The user does not have permission to create new tags - disregard this tag and move onto the next. |
198 | 197 | drupal_set_message(t('Tag %tag was ignored because you do not have permission to create new tags.', array('%tag' => $tag))); |
199 | 198 | continue; |
@@ -251,8 +250,7 @@ discard block |
||
251 | 250 | foreach ($threads as $thread) { |
252 | 251 | db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d', $account->uid, $thread); |
253 | 252 | } |
254 | - } |
|
255 | - else { |
|
253 | + } else { |
|
256 | 254 | // Delete tag mapping for the specified tag. |
257 | 255 | foreach ($threads as $thread) { |
258 | 256 | db_query('DELETE FROM {pm_tags_index} WHERE uid = %d AND thread_id = %d AND tag_id = %d', $account->uid, $thread, $tag_id); |
@@ -268,8 +266,7 @@ discard block |
||
268 | 266 | foreach (explode(',', $_GET['tags']) as $tag) { |
269 | 267 | if (isset($tag_data[$tag])) { |
270 | 268 | $filter['tags'][$tag] = $tag; |
271 | - } |
|
272 | - elseif (in_array($tag, $tag_data)) { |
|
269 | + } elseif (in_array($tag, $tag_data)) { |
|
273 | 270 | $filter['tags'][array_search($tag, $tag_data)] = array_search($tag, $tag_data); |
274 | 271 | } |
275 | 272 | } |
@@ -436,8 +433,7 @@ discard block |
||
436 | 433 | foreach ($filter['tags'] as $tag) { |
437 | 434 | if ((int)$tag > 0) { |
438 | 435 | $ids[] = $tag; |
439 | - } |
|
440 | - else { |
|
436 | + } else { |
|
441 | 437 | $query['tags'][] = $tag; |
442 | 438 | } |
443 | 439 | } |
@@ -456,8 +452,7 @@ discard block |
||
456 | 452 | foreach ($filter['author'] as $author) { |
457 | 453 | if (is_object($author) && isset($author->uid) && isset($author->name)) { |
458 | 454 | $query['author'][] = $author->name; |
459 | - } |
|
460 | - elseif ($author_obj = user_load($author)) { |
|
455 | + } elseif ($author_obj = user_load($author)) { |
|
461 | 456 | $query['author'][] = $author_obj->name; |
462 | 457 | } |
463 | 458 | } |
@@ -646,8 +641,7 @@ discard block |
||
646 | 641 | $fragments['where'][] = "pm.subject LIKE '%s' OR pm.body LIKE '%s'"; |
647 | 642 | $fragments['query_args']['where'][] = '%%'. $filter['search'] .'%%'; |
648 | 643 | $fragments['query_args']['where'][] = '%%'. $filter['search'] .'%%'; |
649 | - } |
|
650 | - else { |
|
644 | + } else { |
|
651 | 645 | $fragments['where'][] = "pm.subject LIKE '%s'"; |
652 | 646 | $fragments['query_args']['where'][] = '%%'. $filter['search'] .'%%'; |
653 | 647 | } |
@@ -820,8 +814,7 @@ discard block |
||
820 | 814 | $fragments['inner_join'][] = 'INNER JOIN {pm_tags_index} ti on ti.tag_id = t.tag_id'; |
821 | 815 | $fragments['where'][] = 'ti.thread_id IN (' . db_placeholders($threads) . ')'; |
822 | 816 | $fragments['query_args']['where'] += $threads; |
823 | - } |
|
824 | - else { |
|
817 | + } else { |
|
825 | 818 | // Tag usage counter is only used when we select all tags. |
826 | 819 | $fragments['select'][] = 'COUNT(ti.thread_id) as count'; |
827 | 820 | // LEFT JOIN so that unused tags are displayed too. |
@@ -850,8 +843,7 @@ discard block |
||
850 | 843 | AND pmtic.uid = ti.uid |
851 | 844 | AND pmtic.tag_id < ti.tag_id) < %d'; |
852 | 845 | $fragments['query_args']['where'][] = $limit; |
853 | - } |
|
854 | - elseif (!empty($threads) || !empty($user)) { |
|
846 | + } elseif (!empty($threads) || !empty($user)) { |
|
855 | 847 | // Only add a sort when we are not loading the tags for the admin page. |
856 | 848 | // Sorting is handled through tablesort_sql() then. |
857 | 849 | $fragments['order_by'][] = 't.tag ASC'; |