@@ -242,8 +242,7 @@ discard block |
||
242 | 242 | foreach ($cached->data as $key => $value) { |
243 | 243 | $node->$key = $value; |
244 | 244 | } |
245 | - } |
|
246 | - else { |
|
245 | + } else { |
|
247 | 246 | $default_additions = _content_field_invoke_default('load', $node); |
248 | 247 | if ($default_additions) { |
249 | 248 | foreach ($default_additions as $key => $value) { |
@@ -458,8 +457,7 @@ discard block |
||
458 | 457 | // render arrays. Check we're not on a form first. |
459 | 458 | if (!isset($elements['#build_id']) && isset($value['view']) && isset($elements[$value['view']])) { |
460 | 459 | $elements[$value['view']]['#weight'] = $value['weight']; |
461 | - } |
|
462 | - elseif (isset($elements[$key])) { |
|
460 | + } elseif (isset($elements[$key])) { |
|
463 | 461 | $elements[$key]['#weight'] = $value['weight']; |
464 | 462 | } |
465 | 463 | } |
@@ -530,8 +528,7 @@ discard block |
||
530 | 528 | $output .= drupal_render($element[$element['#field_name'] .'_add_more']); |
531 | 529 | |
532 | 530 | drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class); |
533 | - } |
|
534 | - else { |
|
531 | + } else { |
|
535 | 532 | foreach (element_children($element) as $key) { |
536 | 533 | $output .= drupal_render($element[$key]); |
537 | 534 | } |
@@ -744,8 +741,7 @@ discard block |
||
744 | 741 | // NODE_BUILD_NORMAL is 0, and ('whatever' == 0) is TRUE, so we need a ===. |
745 | 742 | if ($node->build_mode === NODE_BUILD_NORMAL || $node->build_mode == NODE_BUILD_PREVIEW) { |
746 | 743 | $context = $teaser ? 'teaser' : 'full'; |
747 | - } |
|
748 | - else { |
|
744 | + } else { |
|
749 | 745 | $context = $node->build_mode; |
750 | 746 | } |
751 | 747 | // The field may be missing info for $contexts added by modules |
@@ -797,8 +793,7 @@ discard block |
||
797 | 793 | $element['items'][$delta] += $format_info; |
798 | 794 | $element['items'][$delta]['#item']['#delta'] = $delta; |
799 | 795 | } |
800 | - } |
|
801 | - else { |
|
796 | + } else { |
|
802 | 797 | $element['items'] += $format_info; |
803 | 798 | } |
804 | 799 | |
@@ -829,8 +824,7 @@ discard block |
||
829 | 824 | $wrapper = NULL; |
830 | 825 | if (isset($node->content[$field['field_name']])) { |
831 | 826 | $wrapper = $node->content[$field['field_name']]; |
832 | - } |
|
833 | - elseif (module_exists('fieldgroup') && ($group_name = fieldgroup_get_group($node->type, $field['field_name'])) && isset($node->content[$group_name]['group'][$field['field_name']])) { |
|
827 | + } elseif (module_exists('fieldgroup') && ($group_name = fieldgroup_get_group($node->type, $field['field_name'])) && isset($node->content[$group_name]['group'][$field['field_name']])) { |
|
834 | 828 | $wrapper = $node->content[$group_name]['group'][$field['field_name']]; |
835 | 829 | } |
836 | 830 | |
@@ -844,13 +838,11 @@ discard block |
||
844 | 838 | // '#chilren' is not set if the field is empty. |
845 | 839 | $items[$delta]['view'] = isset($element['items'][$delta]['#children']) ? $element['items'][$delta]['#children'] : ''; |
846 | 840 | } |
847 | - } |
|
848 | - elseif (isset($element['items']['#children'])) { |
|
841 | + } elseif (isset($element['items']['#children'])) { |
|
849 | 842 | // Multiple values formatter. |
850 | 843 | $items[0]['view'] = $element['items']['#children']; |
851 | 844 | } |
852 | - } |
|
853 | - else { |
|
845 | + } else { |
|
854 | 846 | // Hidden or inaccessible field. |
855 | 847 | $items[0]['view'] = ''; |
856 | 848 | } |
@@ -866,8 +858,7 @@ discard block |
||
866 | 858 | $wrapper = NULL; |
867 | 859 | if (isset($node->content[$field['field_name']])) { |
868 | 860 | $wrapper = $node->content[$field['field_name']]; |
869 | - } |
|
870 | - elseif (module_exists('fieldgroup') && ($group_name = fieldgroup_get_group($node->type, $field['field_name'])) && isset($node->content[$group_name]['group'][$field['field_name']])) { |
|
861 | + } elseif (module_exists('fieldgroup') && ($group_name = fieldgroup_get_group($node->type, $field['field_name'])) && isset($node->content[$group_name]['group'][$field['field_name']])) { |
|
871 | 862 | $wrapper = $node->content[$group_name]['group'][$field['field_name']]; |
872 | 863 | } |
873 | 864 | |
@@ -1050,8 +1041,7 @@ discard block |
||
1050 | 1041 | // how to handle that. |
1051 | 1042 | if (db_result(db_query("SELECT COUNT(*) FROM {". $table ."} WHERE vid = %d", $node->vid))) { |
1052 | 1043 | content_write_record($table, $record, array('vid')); |
1053 | - } |
|
1054 | - else { |
|
1044 | + } else { |
|
1055 | 1045 | content_write_record($table, $record); |
1056 | 1046 | } |
1057 | 1047 | } |
@@ -1134,8 +1124,7 @@ discard block |
||
1134 | 1124 | if (is_array($object)) { |
1135 | 1125 | $object = (object) $object; |
1136 | 1126 | $array = TRUE; |
1137 | - } |
|
1138 | - else { |
|
1127 | + } else { |
|
1139 | 1128 | $array = FALSE; |
1140 | 1129 | } |
1141 | 1130 | |
@@ -1174,12 +1163,10 @@ discard block |
||
1174 | 1163 | |
1175 | 1164 | if (empty($info['serialize'])) { |
1176 | 1165 | $values[] = $object->$field; |
1177 | - } |
|
1178 | - else { |
|
1166 | + } else { |
|
1179 | 1167 | $values[] = serialize($object->$field); |
1180 | 1168 | } |
1181 | - } |
|
1182 | - else { |
|
1169 | + } else { |
|
1183 | 1170 | $placeholders[] = 'NULL'; |
1184 | 1171 | } |
1185 | 1172 | } |
@@ -1190,8 +1177,7 @@ discard block |
||
1190 | 1177 | if (!count($update)) { |
1191 | 1178 | $query = "INSERT INTO {". $table ."} (". implode(', ', $fields) .') VALUES ('. implode(', ', $placeholders) .')'; |
1192 | 1179 | $return = SAVED_NEW; |
1193 | - } |
|
1194 | - else { |
|
1180 | + } else { |
|
1195 | 1181 | $query = ''; |
1196 | 1182 | foreach ($fields as $id => $field) { |
1197 | 1183 | if ($query) { |
@@ -1253,8 +1239,7 @@ discard block |
||
1253 | 1239 | $result = $function($op, $node, $field, $items, $teaser, $page); |
1254 | 1240 | if (is_array($result)) { |
1255 | 1241 | $return = array_merge($return, $result); |
1256 | - } |
|
1257 | - else if (isset($result)) { |
|
1242 | + } else if (isset($result)) { |
|
1258 | 1243 | $return[] = $result; |
1259 | 1244 | } |
1260 | 1245 | } |
@@ -1279,15 +1264,13 @@ discard block |
||
1279 | 1264 | // rather than by field. |
1280 | 1265 | if (in_array($op, array('load', 'insert', 'update', 'delete', 'delete revision'))) { |
1281 | 1266 | return content_storage($op, $node); |
1282 | - } |
|
1283 | - else { |
|
1267 | + } else { |
|
1284 | 1268 | foreach ($type['fields'] as $field) { |
1285 | 1269 | $items = isset($node->$field['field_name']) ? $node->$field['field_name'] : array(); |
1286 | 1270 | $result = content_field($op, $node, $field, $items, $teaser, $page); |
1287 | 1271 | if (is_array($result)) { |
1288 | 1272 | $return = array_merge($return, $result); |
1289 | - } |
|
1290 | - else if (isset($result)) { |
|
1273 | + } else if (isset($result)) { |
|
1291 | 1274 | $return[] = $result; |
1292 | 1275 | } |
1293 | 1276 | if (isset($node->$field['field_name'])) { |
@@ -1410,8 +1393,7 @@ discard block |
||
1410 | 1393 | |
1411 | 1394 | if (!$reset && $cached = cache_get('content_type_info:'. $language->language, content_cache_tablename())) { |
1412 | 1395 | $info = $cached->data; |
1413 | - } |
|
1414 | - else { |
|
1396 | + } else { |
|
1415 | 1397 | $info = array( |
1416 | 1398 | 'field types' => array(), |
1417 | 1399 | 'widget types' => array(), |
@@ -1580,8 +1562,7 @@ discard block |
||
1580 | 1562 | $db_info = array(); |
1581 | 1563 | if ($field['db_storage'] == CONTENT_DB_STORAGE_PER_FIELD) { |
1582 | 1564 | $db_info['table'] = _content_tablename($field['field_name'], CONTENT_DB_STORAGE_PER_FIELD); |
1583 | - } |
|
1584 | - else { |
|
1565 | + } else { |
|
1585 | 1566 | $db_info['table'] = _content_tablename($field['type_name'], CONTENT_DB_STORAGE_PER_CONTENT_TYPE); |
1586 | 1567 | } |
1587 | 1568 | |
@@ -1600,8 +1581,7 @@ discard block |
||
1600 | 1581 | function content_storage_type($field) { |
1601 | 1582 | if ($field['multiple'] > 0) { |
1602 | 1583 | return CONTENT_DB_STORAGE_PER_FIELD; |
1603 | - } |
|
1604 | - else { |
|
1584 | + } else { |
|
1605 | 1585 | module_load_include('inc', 'content', 'includes/content.crud'); |
1606 | 1586 | $instances = content_field_instance_read(array('field_name' => $field['field_name'])); |
1607 | 1587 | if (count($instances) > 1) { |
@@ -1655,8 +1635,7 @@ discard block |
||
1655 | 1635 | foreach ($array as $key => $value) { |
1656 | 1636 | if (is_array($value)) { |
1657 | 1637 | $result += content_array_flatten($value); |
1658 | - } |
|
1659 | - else { |
|
1638 | + } else { |
|
1660 | 1639 | $result[$key] = $value; |
1661 | 1640 | } |
1662 | 1641 | } |
@@ -1711,8 +1690,7 @@ discard block |
||
1711 | 1690 | if (strpos($opt, '|') !== FALSE) { |
1712 | 1691 | list($key, $value) = explode('|', $opt); |
1713 | 1692 | $allowed_values[$cid][$key] = (isset($value) && $value !=='') ? $value : $key; |
1714 | - } |
|
1715 | - else { |
|
1693 | + } else { |
|
1716 | 1694 | $allowed_values[$cid][$opt] = $opt; |
1717 | 1695 | } |
1718 | 1696 | } |
@@ -1733,8 +1711,7 @@ discard block |
||
1733 | 1711 | foreach ($options as $key => $opt) { |
1734 | 1712 | if (is_array($opt)) { |
1735 | 1713 | content_allowed_values_filter_html($options[$key]); |
1736 | - } |
|
1737 | - else { |
|
1714 | + } else { |
|
1738 | 1715 | $options[$key] = html_entity_decode(strip_tags($opt), ENT_QUOTES); |
1739 | 1716 | } |
1740 | 1717 | } |
@@ -1817,8 +1794,7 @@ discard block |
||
1817 | 1794 | } |
1818 | 1795 | |
1819 | 1796 | $element['#item'] = $items[0]; |
1820 | - } |
|
1821 | - else { |
|
1797 | + } else { |
|
1822 | 1798 | // Multiple values formatter. |
1823 | 1799 | $items = $item; |
1824 | 1800 | $function = $field['module'] .'_field'; |
@@ -1869,11 +1845,9 @@ discard block |
||
1869 | 1845 | |
1870 | 1846 | if ($selector === '_tabs') { |
1871 | 1847 | return $info['tabs']; |
1872 | - } |
|
1873 | - elseif (isset($selector) && isset($info['tabs'][$selector])) { |
|
1848 | + } elseif (isset($selector) && isset($info['tabs'][$selector])) { |
|
1874 | 1849 | return isset($info['tabs'][$selector]) ? $info['tabs'][$selector]['build modes'] : array(); |
1875 | - } |
|
1876 | - else { |
|
1850 | + } else { |
|
1877 | 1851 | return $info['build modes']; |
1878 | 1852 | } |
1879 | 1853 | } |
@@ -1987,8 +1961,7 @@ discard block |
||
1987 | 1961 | |
1988 | 1962 | if ($version < 1003) { |
1989 | 1963 | $version = 0; |
1990 | - } |
|
1991 | - else { |
|
1964 | + } else { |
|
1992 | 1965 | $version = 1003; |
1993 | 1966 | } |
1994 | 1967 | |
@@ -2042,8 +2015,7 @@ discard block |
||
2042 | 2015 | function content_cache_tablename() { |
2043 | 2016 | if (variable_get('content_schema_version', -1) < 6000) { |
2044 | 2017 | return 'cache'; |
2045 | - } |
|
2046 | - else { |
|
2018 | + } else { |
|
2047 | 2019 | return 'cache_content'; |
2048 | 2020 | } |
2049 | 2021 | } |
@@ -2125,8 +2097,7 @@ discard block |
||
2125 | 2097 | return FALSE; |
2126 | 2098 | } |
2127 | 2099 | return (bool)db_result(db_query("SHOW INDEX FROM {". $table ."} WHERE key_name = '$name'")); |
2128 | - } |
|
2129 | - elseif ($db_type == 'pgsql') { |
|
2100 | + } elseif ($db_type == 'pgsql') { |
|
2130 | 2101 | // Note that the index names in Schema API for PostgreSQL are prefixed by |
2131 | 2102 | // the table name and suffixed by '_idx'. |
2132 | 2103 | return (bool)db_result(db_query("SELECT COUNT(indexname) FROM pg_indexes WHERE indexname = '{". $table ."}_{$name}_idx'")); |
@@ -2222,8 +2193,7 @@ discard block |
||
2222 | 2193 | if (is_array($result)) { |
2223 | 2194 | $default_value = $result; |
2224 | 2195 | } |
2225 | - } |
|
2226 | - elseif (!empty($field['widget']['default_value'])) { |
|
2196 | + } elseif (!empty($field['widget']['default_value'])) { |
|
2227 | 2197 | $default_value = $field['widget']['default_value']; |
2228 | 2198 | } |
2229 | 2199 | return (array) $default_value; |
@@ -2336,8 +2306,7 @@ discard block |
||
2336 | 2306 | || !is_array($object['display_settings'][$context]) |
2337 | 2307 | || empty($object['display_settings'][$context]['exclude'])) { |
2338 | 2308 | return FALSE; |
2339 | - } |
|
2340 | - else { |
|
2309 | + } else { |
|
2341 | 2310 | return TRUE; |
2342 | 2311 | } |
2343 | 2312 | } |
@@ -2372,8 +2341,7 @@ discard block |
||
2372 | 2341 | // Use isset() to avoid undefined index message on #children when field values are empty. |
2373 | 2342 | $variables['items'][$delta]['view'] = isset($element['items'][$delta]['#children']) ? $element['items'][$delta]['#children'] : ''; |
2374 | 2343 | } |
2375 | - } |
|
2376 | - else { |
|
2344 | + } else { |
|
2377 | 2345 | // Multiple values formatter. |
2378 | 2346 | // We display the 'all items' output as $items[0], as if it was the |
2379 | 2347 | // output of a single valued field. |
@@ -2392,8 +2360,7 @@ discard block |
||
2392 | 2360 | foreach ($variables['items'] as $delta => $item) { |
2393 | 2361 | if (!isset($item['view']) || (empty($item['view']) && (string)$item['view'] !== '0')) { |
2394 | 2362 | $variables['items'][$delta]['empty'] = TRUE; |
2395 | - } |
|
2396 | - else { |
|
2363 | + } else { |
|
2397 | 2364 | $field_empty = FALSE; |
2398 | 2365 | $variables['items'][$delta]['empty'] = FALSE; |
2399 | 2366 | } |
@@ -2643,8 +2610,7 @@ discard block |
||
2643 | 2610 | $db_info = content_database_info($field); |
2644 | 2611 | if (!empty($type_name)) { |
2645 | 2612 | $delta = db_result(db_query("SELECT MAX(delta) FROM {". $db_info['table'] ."} f LEFT JOIN {node} n ON f.vid = n.vid WHERE n.type = '%s'", $type_name)); |
2646 | - } |
|
2647 | - else { |
|
2613 | + } else { |
|
2648 | 2614 | $delta = db_result(db_query("SELECT MAX(delta) FROM {". $db_info['table'] ."}")); |
2649 | 2615 | } |
2650 | 2616 | if ($delta >= 0) { |
@@ -2663,8 +2629,7 @@ discard block |
||
2663 | 2629 | if (!empty($type_name)) { |
2664 | 2630 | $param = array('type_name' => $type_name); |
2665 | 2631 | $inactive = array($type_name => array()); |
2666 | - } |
|
2667 | - else { |
|
2632 | + } else { |
|
2668 | 2633 | $param = array(); |
2669 | 2634 | $inactive = array(); |
2670 | 2635 | } |
@@ -2693,8 +2658,7 @@ discard block |
||
2693 | 2658 | if (!empty($type_name)) { |
2694 | 2659 | $param = array('type_name' => $type_name); |
2695 | 2660 | $inactive = array($type_name => array()); |
2696 | - } |
|
2697 | - else { |
|
2661 | + } else { |
|
2698 | 2662 | $param = array(); |
2699 | 2663 | $inactive = array(); |
2700 | 2664 | } |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | foreach ($form['#content_profile_registration_use_types'] as $type => $typename) { |
22 | 22 | content_profile_registration_add_profile_form($type, $form, $form_state); |
23 | 23 | } |
24 | - } |
|
25 | - elseif ($form_id == 'content_profile_admin_settings') { |
|
24 | + } elseif ($form_id == 'content_profile_admin_settings') { |
|
26 | 25 | $type = $form_state['type']; |
27 | 26 | // Let other modules add registration child elements before us! |
28 | 27 | $form += array('registration' => array()); |
@@ -133,8 +132,7 @@ discard block |
||
133 | 132 | // Set this to the values of one node, as it might be need by some #ahah callbacks |
134 | 133 | $form_add['#node'] = $node_form['#node']; |
135 | 134 | $form_add['type'] = $node_form['type']; |
136 | - } |
|
137 | - else { |
|
135 | + } else { |
|
138 | 136 | foreach (array('uid', 'name', 'author', 'buttons', 'language', '#theme', 'options') as $key) { |
139 | 137 | unset($node_form[$key]); |
140 | 138 | } |
@@ -148,8 +146,7 @@ discard block |
||
148 | 146 | if (count(element_children($form_add[$group_name])) == 0) { |
149 | 147 | unset($form_add[$group_name]); |
150 | 148 | } |
151 | - } |
|
152 | - else { |
|
149 | + } else { |
|
153 | 150 | unset($form_add[$field_name]); |
154 | 151 | } |
155 | 152 | } |
@@ -213,8 +210,7 @@ discard block |
||
213 | 210 | |
214 | 211 | if (!in_array('other', content_profile_get_settings($type, 'registration_hide'))) { |
215 | 212 | node_validate($node, $form); |
216 | - } |
|
217 | - elseif (module_exists('content')) { |
|
213 | + } elseif (module_exists('content')) { |
|
218 | 214 | content_validate($node); |
219 | 215 | } |
220 | 216 | |
@@ -232,8 +228,7 @@ discard block |
||
232 | 228 | function _content_profile_registration_remove_values($key, $element, &$form_state) { |
233 | 229 | if ((isset($element['#input']) || !empty($element['#tree'])) && isset($form_state['values'][$key])) { |
234 | 230 | unset($form_state['values'][$key]); |
235 | - } |
|
236 | - elseif (empty($element['#input']) && empty($element['#tree'])) { |
|
231 | + } elseif (empty($element['#input']) && empty($element['#tree'])) { |
|
237 | 232 | foreach (element_children($element) as $key) { |
238 | 233 | _content_profile_registration_remove_values($key, $element[$key], $form_state); |
239 | 234 | } |
@@ -19,8 +19,7 @@ |
||
19 | 19 | foreach($types as $type_name => $type) { |
20 | 20 | if (isset($object)) { |
21 | 21 | $profile = content_profile_load($type_name, $object->uid); |
22 | - } |
|
23 | - else { |
|
22 | + } else { |
|
24 | 23 | global $user; |
25 | 24 | $profile = content_profile_load($type_name, $user->uid); |
26 | 25 | } |
@@ -270,8 +270,7 @@ discard block |
||
270 | 270 | '#title' => t('Use this content type as a content profile for users'), |
271 | 271 | '#default_value' => variable_get('content_profile_use_'. $form['#node_type']->type, FALSE), |
272 | 272 | ); |
273 | - } |
|
274 | - elseif (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id && is_content_profile($form['#node'])) { |
|
273 | + } elseif (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id && is_content_profile($form['#node'])) { |
|
275 | 274 | // Customize the redirect target and buttons of our own node forms. |
276 | 275 | if (arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == 'edit' || arg(2) == 'profile') { |
277 | 276 | $form['buttons']['preview']['#access'] = FALSE; |
@@ -382,8 +381,7 @@ discard block |
||
382 | 381 | // This node already exists, redirect to edit page |
383 | 382 | drupal_goto('node/'. $nid .'/edit', 'destination=user/'. $node->uid); |
384 | 383 | } |
385 | - } |
|
386 | - elseif ($op == 'validate' && is_content_profile($node) && user_access('administer nodes')) { |
|
384 | + } elseif ($op == 'validate' && is_content_profile($node) && user_access('administer nodes')) { |
|
387 | 385 | $form = $a3; |
388 | 386 | // Only validate if the user-name changed or we add a new node |
389 | 387 | if (!empty($node->nid) && $form['author']['name']['#default_value'] == $node->name) { |
@@ -394,8 +392,7 @@ discard block |
||
394 | 392 | if ($uid && content_profile_profile_exists($node, $uid)) { |
395 | 393 | form_set_error('name', t('This user already has a content profile of this type. You can only create one profile per user.')); |
396 | 394 | } |
397 | - } |
|
398 | - elseif ($op == 'prepare translation' && is_content_profile($node->translation_source)) { |
|
395 | + } elseif ($op == 'prepare translation' && is_content_profile($node->translation_source)) { |
|
399 | 396 | // Make sure the translated profile belongs to the same user. |
400 | 397 | $node->uid = $node->translation_source->uid; |
401 | 398 | $node->name = $node->translation_source->name; |
@@ -504,8 +501,7 @@ discard block |
||
504 | 501 | $node = content_profile_load($type, $arg[1]); |
505 | 502 | if ($node) { |
506 | 503 | return node_help('node/%/edit', array(1 => $node->nid)); |
507 | - } |
|
508 | - else { |
|
504 | + } else { |
|
509 | 505 | return node_help('node/add/'. $type, array('node', 'add', $type)); |
510 | 506 | } |
511 | 507 | } |
@@ -537,8 +533,7 @@ discard block |
||
537 | 533 | |
538 | 534 | // Working around the bug described at http://drupal.org/node/302873 |
539 | 535 | module_load_include('inc', 'content_profile', 'content_profile.theme'); |
540 | - } |
|
541 | - elseif (user_access('create '. $type .' content') && content_profile_get_settings($type, 'add_link') && !$node && ($uid == $user->uid || user_access('administer nodes'))) { |
|
536 | + } elseif (user_access('create '. $type .' content') && content_profile_get_settings($type, 'add_link') && !$node && ($uid == $user->uid || user_access('administer nodes'))) { |
|
542 | 537 | $content['content_profile_'. $type] = array( |
543 | 538 | '#admin' => $uid != $user->uid, |
544 | 539 | '#theme' => 'content_profile_display_add_link', |
@@ -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 | } |