@@ -524,8 +524,7 @@ discard block |
||
524 | 524 | |
525 | 525 | if ($argument->is_wildcard()) { |
526 | 526 | $arg_title = $argument->wildcard_title(); |
527 | - } |
|
528 | - else { |
|
527 | + } else { |
|
529 | 528 | $arg_title = $argument->get_title(); |
530 | 529 | $argument->query(); |
531 | 530 | } |
@@ -552,8 +551,7 @@ discard block |
||
552 | 551 | } |
553 | 552 | |
554 | 553 | $breadcrumb_args[] = $arg; |
555 | - } |
|
556 | - else { |
|
554 | + } else { |
|
557 | 555 | // determine default condition and handle. |
558 | 556 | $status = $argument->default_action(); |
559 | 557 | break; |
@@ -765,15 +763,13 @@ discard block |
||
765 | 763 | // Check for already-cached results. |
766 | 764 | if (!empty($this->live_preview)) { |
767 | 765 | $cache = FALSE; |
768 | - } |
|
769 | - else { |
|
766 | + } else { |
|
770 | 767 | $cache = $this->display_handler->get_cache_plugin(); |
771 | 768 | } |
772 | 769 | if ($cache && $cache->cache_get('results')) { |
773 | 770 | $this->synchronize_pager(); |
774 | 771 | vpr('Used cached results'); |
775 | - } |
|
776 | - else { |
|
772 | + } else { |
|
777 | 773 | $items = array(); |
778 | 774 | if ($query) { |
779 | 775 | $replacements = $this->substitutions(); |
@@ -806,8 +802,7 @@ discard block |
||
806 | 802 | $offset = $this->pager['current_page'] * $this->pager['items_per_page'] + $this->pager['offset']; |
807 | 803 | $result = db_query_range($query, $args, $offset, $this->pager['items_per_page']); |
808 | 804 | |
809 | - } |
|
810 | - else { |
|
805 | + } else { |
|
811 | 806 | $result = db_query($query, $args); |
812 | 807 | } |
813 | 808 | |
@@ -862,14 +857,12 @@ discard block |
||
862 | 857 | // Check for already-cached output. |
863 | 858 | if (!empty($this->live_preview)) { |
864 | 859 | $cache = FALSE; |
865 | - } |
|
866 | - else { |
|
860 | + } else { |
|
867 | 861 | $cache = $this->display_handler->get_cache_plugin(); |
868 | 862 | } |
869 | 863 | if ($cache && $cache->cache_get('output')) { |
870 | 864 | vpr('Used cached output'); |
871 | - } |
|
872 | - else { |
|
865 | + } else { |
|
873 | 866 | if ($cache) { |
874 | 867 | $cache->cache_start(); |
875 | 868 | } |
@@ -1139,8 +1132,7 @@ discard block |
||
1139 | 1132 | // During building, we might find a title override. If so, use it. |
1140 | 1133 | if (!empty($this->build_info['title'])) { |
1141 | 1134 | $title = $this->build_info['title']; |
1142 | - } |
|
1143 | - else { |
|
1135 | + } else { |
|
1144 | 1136 | $title = $this->display_handler->get_option('title'); |
1145 | 1137 | } |
1146 | 1138 | |
@@ -1184,19 +1176,16 @@ discard block |
||
1184 | 1176 | foreach (explode('/', $path) as $piece) { |
1185 | 1177 | if ($piece != '%') { |
1186 | 1178 | $pieces[] = $piece; |
1187 | - } |
|
1188 | - else { |
|
1179 | + } else { |
|
1189 | 1180 | if (empty($args)) { |
1190 | 1181 | // Try to never put % in a url; use the wildcard instead. |
1191 | 1182 | if ($id && !empty($arguments[$id]['wildcard'])) { |
1192 | 1183 | $pieces[] = $arguments[$id]['wildcard']; |
1193 | - } |
|
1194 | - else { |
|
1184 | + } else { |
|
1195 | 1185 | $pieces[] = '*'; // gotta put something if there just isn't one. |
1196 | 1186 | } |
1197 | 1187 | |
1198 | - } |
|
1199 | - else { |
|
1188 | + } else { |
|
1200 | 1189 | $pieces[] = array_shift($args); |
1201 | 1190 | } |
1202 | 1191 | |
@@ -1345,8 +1334,7 @@ discard block |
||
1345 | 1334 | $data = db_fetch_object(db_query("SELECT * FROM {views_view} WHERE $where", $arg)); |
1346 | 1335 | if (empty($data)) { |
1347 | 1336 | $cache[$arg] = NULL; |
1348 | - } |
|
1349 | - else { |
|
1337 | + } else { |
|
1350 | 1338 | $view = new view(); |
1351 | 1339 | $view->load_row($data); |
1352 | 1340 | $view->type = t('Normal'); |
@@ -1367,8 +1355,7 @@ discard block |
||
1367 | 1355 | // this ID, otherwise push it on. |
1368 | 1356 | if (!empty($object->id)) { |
1369 | 1357 | $location[$object->id] = $object; |
1370 | - } |
|
1371 | - else { |
|
1358 | + } else { |
|
1372 | 1359 | $location[] = $object; |
1373 | 1360 | } |
1374 | 1361 | } |
@@ -1427,8 +1414,7 @@ discard block |
||
1427 | 1414 | // this ID, otherwise push it on. |
1428 | 1415 | if (!empty($object->id)) { |
1429 | 1416 | $location[$object->id] = $object; |
1430 | - } |
|
1431 | - else { |
|
1417 | + } else { |
|
1432 | 1418 | $location[] = $object; |
1433 | 1419 | } |
1434 | 1420 | } |
@@ -1530,8 +1516,7 @@ discard block |
||
1530 | 1516 | $value = $display->handler->get_option($option); |
1531 | 1517 | if ($id == 'default') { |
1532 | 1518 | $default = isset($definition['default']) ? $definition['default'] : NULL; |
1533 | - } |
|
1534 | - else { |
|
1519 | + } else { |
|
1535 | 1520 | $default = $this->display['default']->handler->get_option($option); |
1536 | 1521 | } |
1537 | 1522 | |
@@ -1705,11 +1690,9 @@ discard block |
||
1705 | 1690 | if (!isset($this->$field)) { |
1706 | 1691 | if (!empty($info['serialize']) && isset($info['serialized default'])) { |
1707 | 1692 | $this->$field = unserialize($info['serialized default']); |
1708 | - } |
|
1709 | - else if (isset($info['default'])) { |
|
1693 | + } else if (isset($info['default'])) { |
|
1710 | 1694 | $this->$field = $info['default']; |
1711 | - } |
|
1712 | - else { |
|
1695 | + } else { |
|
1713 | 1696 | $this->$field = ''; |
1714 | 1697 | } |
1715 | 1698 | } |
@@ -1750,16 +1733,14 @@ discard block |
||
1750 | 1733 | } |
1751 | 1734 | if (empty($info['serialize'])) { |
1752 | 1735 | $values[] = $this->$field; |
1753 | - } |
|
1754 | - else { |
|
1736 | + } else { |
|
1755 | 1737 | $values[] = serialize($this->$field); |
1756 | 1738 | } |
1757 | 1739 | } |
1758 | 1740 | $query = ''; |
1759 | 1741 | if (!$update) { |
1760 | 1742 | $query = "INSERT INTO {" . $this->db_table . "} (" . implode(', ', $fields) . ') VALUES (' . implode(', ', $defs) . ')'; |
1761 | - } |
|
1762 | - else { |
|
1743 | + } else { |
|
1763 | 1744 | $query = ''; |
1764 | 1745 | foreach ($fields as $id => $field) { |
1765 | 1746 | if ($query) { |
@@ -1822,8 +1803,7 @@ discard block |
||
1822 | 1803 | if (!isset($this->$field)) { |
1823 | 1804 | if (isset($info['default'])) { |
1824 | 1805 | $this->$field = $info['default']; |
1825 | - } |
|
1826 | - else { |
|
1806 | + } else { |
|
1827 | 1807 | $this->$field = ''; |
1828 | 1808 | } |
1829 | 1809 | |
@@ -2024,8 +2004,7 @@ discard block |
||
2024 | 2004 | $fields = $this->display[$display_id]->handler->get_option($types[$type]['plural']); |
2025 | 2005 | if (isset($item)) { |
2026 | 2006 | $fields[$id] = $item; |
2027 | - } |
|
2028 | - else { |
|
2007 | + } else { |
|
2029 | 2008 | unset($fields[$id]); |
2030 | 2009 | } |
2031 | 2010 |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | if (!isset($definition['path'])) { |
47 | 47 | if ($type == 'handler') { |
48 | 48 | $definition += views_fetch_handler_data($definition['handler']); |
49 | - } |
|
50 | - else { |
|
49 | + } else { |
|
51 | 50 | $definition += views_fetch_plugin_data($type, $definition['handler']); |
52 | 51 | } |
53 | 52 | } |
@@ -55,8 +54,7 @@ discard block |
||
55 | 54 | if (!empty($definition['parent'])) { |
56 | 55 | if ($type == 'handler') { |
57 | 56 | $parent = views_fetch_handler_data($definition['parent']); |
58 | - } |
|
59 | - else { |
|
57 | + } else { |
|
60 | 58 | $parent = views_fetch_plugin_data($type, $definition['parent']); |
61 | 59 | } |
62 | 60 | |
@@ -115,8 +113,7 @@ discard block |
||
115 | 113 | |
116 | 114 | if (!$handler) { |
117 | 115 | return $cache; |
118 | - } |
|
119 | - else if (isset($cache[$handler])) { |
|
116 | + } else if (isset($cache[$handler])) { |
|
120 | 117 | return $cache[$handler]; |
121 | 118 | } |
122 | 119 | |
@@ -171,8 +168,7 @@ discard block |
||
171 | 168 | $h = $data['table']['join'][$base_table]; |
172 | 169 | if (!empty($h['handler']) && class_exists($h['handler'])) { |
173 | 170 | $handler = new $h['handler']; |
174 | - } |
|
175 | - else { |
|
171 | + } else { |
|
176 | 172 | $handler = new views_join(); |
177 | 173 | } |
178 | 174 | |
@@ -188,8 +184,7 @@ discard block |
||
188 | 184 | |
189 | 185 | if (isset($h['arguments'])) { |
190 | 186 | call_user_func_array(array(&$handler, 'construct'), $h['arguments']); |
191 | - } |
|
192 | - else { |
|
187 | + } else { |
|
193 | 188 | $handler->construct(); |
194 | 189 | } |
195 | 190 | |
@@ -464,8 +459,7 @@ discard block |
||
464 | 459 | // Determine the primary table to seek |
465 | 460 | if (empty($this->query->relationships[$this->relationship])) { |
466 | 461 | $base_table = $this->query->base_table; |
467 | - } |
|
468 | - else { |
|
462 | + } else { |
|
469 | 463 | $base_table = $this->query->relationships[$this->relationship]['base']; |
470 | 464 | } |
471 | 465 | |
@@ -535,8 +529,7 @@ discard block |
||
535 | 529 | function get_field() { |
536 | 530 | if (!empty($this->formula)) { |
537 | 531 | return $this->handler->get_formula(); |
538 | - } |
|
539 | - else { |
|
532 | + } else { |
|
540 | 533 | return $this->handler->table_alias . '.' . $this->handler->real_field; |
541 | 534 | } |
542 | 535 | } |
@@ -564,8 +557,7 @@ discard block |
||
564 | 557 | // Determine the primary table to seek |
565 | 558 | if (empty($this->handler->query->relationships[$relationship])) { |
566 | 559 | $base_table = $this->handler->query->base_table; |
567 | - } |
|
568 | - else { |
|
560 | + } else { |
|
569 | 561 | $base_table = $this->handler->query->relationships[$relationship]['base']; |
570 | 562 | } |
571 | 563 | |
@@ -587,8 +579,7 @@ discard block |
||
587 | 579 | // automatically discard those values. |
588 | 580 | if (empty($this->handler->view->many_to_one_tables[$field])) { |
589 | 581 | $this->handler->view->many_to_one_tables[$field] = $this->handler->value; |
590 | - } |
|
591 | - else { |
|
582 | + } else { |
|
592 | 583 | $this->handler->view->many_to_one_tables[$field] = array_merge($this->handler->view->many_to_one_tables[$field], $this->handler->value); |
593 | 584 | } |
594 | 585 | |
@@ -618,8 +609,7 @@ discard block |
||
618 | 609 | |
619 | 610 | if (empty($options['add_table']) || empty($view->many_to_one_tables[$field])) { |
620 | 611 | return $query->ensure_table($this->handler->table, $this->handler->relationship, $join); |
621 | - } |
|
622 | - else { |
|
612 | + } else { |
|
623 | 613 | if (!empty($view->many_to_one_tables[$field])) { |
624 | 614 | foreach ($view->many_to_one_tables[$field] as $value) { |
625 | 615 | $join->extra = array( |
@@ -652,8 +642,7 @@ discard block |
||
652 | 642 | $join->type = 'INNER'; |
653 | 643 | $this->handler->table_alias = $this->handler->query->ensure_table($this->handler->table, $this->handler->relationship, $join); |
654 | 644 | $this->handler->view->many_to_one_tables[$field] = $this->handler->value; |
655 | - } |
|
656 | - else { |
|
645 | + } else { |
|
657 | 646 | $join = $this->get_join(); |
658 | 647 | $join->type = 'LEFT'; |
659 | 648 | if (!empty($this->handler->view->many_to_one_tables[$field])) { |
@@ -707,8 +696,7 @@ discard block |
||
707 | 696 | $this->handler->table_alias = $alias; |
708 | 697 | } |
709 | 698 | } |
710 | - } |
|
711 | - else { |
|
699 | + } else { |
|
712 | 700 | // For not, we just do one join. We'll add a where clause during |
713 | 701 | // the query phase to ensure that $table.$field IS NULL. |
714 | 702 | $join = $this->get_join(); |
@@ -747,18 +735,15 @@ discard block |
||
747 | 735 | |
748 | 736 | if ($operator == 'not') { |
749 | 737 | $this->handler->query->add_where($options['group'], "$field IS NULL"); |
750 | - } |
|
751 | - else if ($operator == 'or' && empty($options['reduce_duplicates'])) { |
|
738 | + } else if ($operator == 'or' && empty($options['reduce_duplicates'])) { |
|
752 | 739 | if (count($this->handler->value) > 1) { |
753 | 740 | $replace = array_fill(0, sizeof($this->handler->value), $placeholder); |
754 | 741 | $in = '(' . implode(", ", $replace) . ')'; |
755 | 742 | $this->handler->query->add_where($options['group'], "$field IN $in", $this->handler->value); |
756 | - } |
|
757 | - else { |
|
743 | + } else { |
|
758 | 744 | $this->handler->query->add_where($options['group'], "$field = $placeholder", $this->handler->value); |
759 | 745 | } |
760 | - } |
|
761 | - else { |
|
746 | + } else { |
|
762 | 747 | $field = $this->handler->real_field; |
763 | 748 | $clauses = array(); |
764 | 749 | foreach ($this->handler->table_aliases as $value => $alias) { |
@@ -806,8 +791,7 @@ discard block |
||
806 | 791 | // The '+' character in a query string may be parsed as ' '. |
807 | 792 | $filter->operator = 'or'; |
808 | 793 | $filter->value = preg_split('/[+ ]/', $str); |
809 | - } |
|
810 | - else if (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) { |
|
794 | + } else if (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) { |
|
811 | 795 | $filter->operator = 'and'; |
812 | 796 | $filter->value = explode(',', $str); |
813 | 797 | } |
@@ -836,8 +820,7 @@ discard block |
||
836 | 820 | global $user; |
837 | 821 | if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { |
838 | 822 | $timezone = $user->timezone; |
839 | - } |
|
840 | - else { |
|
823 | + } else { |
|
841 | 824 | $timezone = variable_get('date_default_timezone', 0); |
842 | 825 | } |
843 | 826 | |
@@ -848,11 +831,9 @@ discard block |
||
848 | 831 | if (!$already_set) { |
849 | 832 | if ($GLOBALS['db_type'] == 'pgsql') { |
850 | 833 | db_query("SET TIME ZONE INTERVAL '$offset' HOUR TO MINUTE"); |
851 | - } |
|
852 | - elseif ($GLOBALS['db_type'] == 'mysqli') { |
|
834 | + } elseif ($GLOBALS['db_type'] == 'mysqli') { |
|
853 | 835 | db_query("SET @@session.time_zone = '$offset'"); |
854 | - } |
|
855 | - elseif ($GLOBALS['db_type'] == 'mysql' && version_compare(db_version(), '4.1.3', '>=')) { |
|
836 | + } elseif ($GLOBALS['db_type'] == 'mysql' && version_compare(db_version(), '4.1.3', '>=')) { |
|
856 | 837 | db_query("SET @@session.time_zone = '$offset'"); |
857 | 838 | } |
858 | 839 | |
@@ -1256,8 +1237,7 @@ discard block |
||
1256 | 1237 | $this->field = $field; |
1257 | 1238 | $this->extra = $extra; |
1258 | 1239 | $this->type = strtoupper($type); |
1259 | - } |
|
1260 | - else if (!empty($this->definition)) { |
|
1240 | + } else if (!empty($this->definition)) { |
|
1261 | 1241 | // if no arguments, construct from definition. |
1262 | 1242 | // These four must exist or it will throw notices. |
1263 | 1243 | $this->table = $this->definition['table']; |
@@ -1281,16 +1261,14 @@ discard block |
||
1281 | 1261 | function join($table, &$query) { |
1282 | 1262 | if (empty($this->definition['table formula'])) { |
1283 | 1263 | $right_table = "{" . $this->table . "}"; |
1284 | - } |
|
1285 | - else { |
|
1264 | + } else { |
|
1286 | 1265 | $right_table = $this->definition['table formula']; |
1287 | 1266 | } |
1288 | 1267 | |
1289 | 1268 | if ($this->left_table) { |
1290 | 1269 | $left = $query->get_table_info($this->left_table); |
1291 | 1270 | $left_field = "$left[alias].$this->left_field"; |
1292 | - } |
|
1293 | - else { |
|
1271 | + } else { |
|
1294 | 1272 | // This can be used if left_field is a formula or something. It should be used only *very* rarely. |
1295 | 1273 | $left_field = $this->left_field; |
1296 | 1274 | } |
@@ -1302,8 +1280,7 @@ discard block |
||
1302 | 1280 | $replacements = array(); |
1303 | 1281 | if (!empty($view)) { |
1304 | 1282 | $replacements = $view->substitutions(); |
1305 | - } |
|
1306 | - else { |
|
1283 | + } else { |
|
1307 | 1284 | vpr('The current view is not set, maybe some code missed to execute $view->pre_execute()'); |
1308 | 1285 | } |
1309 | 1286 | |
@@ -1318,8 +1295,7 @@ discard block |
||
1318 | 1295 | $join_table = ''; |
1319 | 1296 | if (!array_key_exists('table', $info)) { |
1320 | 1297 | $join_table = $table['alias'] . '.'; |
1321 | - } |
|
1322 | - elseif (isset($info['table'])) { |
|
1298 | + } elseif (isset($info['table'])) { |
|
1323 | 1299 | $join_table = $info['table'] . '.'; |
1324 | 1300 | } |
1325 | 1301 | |
@@ -1332,8 +1308,7 @@ discard block |
||
1332 | 1308 | if (empty($info['raw'])) { |
1333 | 1309 | $raw_value = $this->db_safe($info['value'], $info); |
1334 | 1310 | $q = (empty($info['numeric']) ? "'" : ''); |
1335 | - } |
|
1336 | - else { |
|
1311 | + } else { |
|
1337 | 1312 | $raw_value = $info['value']; |
1338 | 1313 | $q = ''; |
1339 | 1314 | } |
@@ -1344,12 +1319,10 @@ discard block |
||
1344 | 1319 | if (count($raw_value) == 1) { |
1345 | 1320 | $value = $q . array_shift($raw_value) . $q; |
1346 | 1321 | $operator = $operator == 'NOT IN' ? '!=' : '='; |
1347 | - } |
|
1348 | - else { |
|
1322 | + } else { |
|
1349 | 1323 | $value = "($q" . implode("$q, $q", $raw_value) . "$q)"; |
1350 | 1324 | } |
1351 | - } |
|
1352 | - else { |
|
1325 | + } else { |
|
1353 | 1326 | $operator = !empty($info['operator']) ? $info['operator'] : '='; |
1354 | 1327 | $value = "$q$raw_value$q"; |
1355 | 1328 | } |
@@ -1359,13 +1332,11 @@ discard block |
||
1359 | 1332 | if ($extras) { |
1360 | 1333 | if (count($extras) == 1) { |
1361 | 1334 | $output .= ' AND ' . array_shift($extras); |
1362 | - } |
|
1363 | - else { |
|
1335 | + } else { |
|
1364 | 1336 | $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')'; |
1365 | 1337 | } |
1366 | 1338 | } |
1367 | - } |
|
1368 | - else if ($this->extra && is_string($this->extra)) { |
|
1339 | + } else if ($this->extra && is_string($this->extra)) { |
|
1369 | 1340 | $output .= " AND ($this->extra)"; |
1370 | 1341 | } |
1371 | 1342 | } |
@@ -1383,16 +1354,13 @@ discard block |
||
1383 | 1354 | foreach ($input as $value) { |
1384 | 1355 | if (empty($info['numeric'])) { |
1385 | 1356 | $output[] = db_escape_string($value); |
1386 | - } |
|
1387 | - else { |
|
1357 | + } else { |
|
1388 | 1358 | $output[] = intval($value); |
1389 | 1359 | } |
1390 | 1360 | } |
1391 | - } |
|
1392 | - else if (empty($info['numeric'])) { |
|
1361 | + } else if (empty($info['numeric'])) { |
|
1393 | 1362 | $output = db_escape_string($input); |
1394 | - } |
|
1395 | - else { |
|
1363 | + } else { |
|
1396 | 1364 | $output = intval($input); |
1397 | 1365 | } |
1398 | 1366 |
@@ -176,8 +176,7 @@ discard block |
||
176 | 176 | function add_relationship($alias, $join, $base, $link_point = NULL) { |
177 | 177 | if (empty($link_point)) { |
178 | 178 | $link_point = $this->base_table; |
179 | - } |
|
180 | - else if (!array_key_exists($link_point, $this->relationships)) { |
|
179 | + } else if (!array_key_exists($link_point, $this->relationships)) { |
|
181 | 180 | return FALSE; |
182 | 181 | } |
183 | 182 | |
@@ -303,8 +302,7 @@ discard block |
||
303 | 302 | if (!$alias && $join && $relationship && !empty($join->adjusted) && $table != $join->table) { |
304 | 303 | if ($relationship == $this->base_table) { |
305 | 304 | $alias = $table; |
306 | - } |
|
307 | - else { |
|
305 | + } else { |
|
308 | 306 | $alias = $relationship . '_' . $table; |
309 | 307 | } |
310 | 308 | } |
@@ -365,8 +363,7 @@ discard block |
||
365 | 363 | 'count' => 1, |
366 | 364 | 'alias' => $alias, |
367 | 365 | ); |
368 | - } |
|
369 | - else { |
|
366 | + } else { |
|
370 | 367 | $this->tables[$relationship][$table]['count']++; |
371 | 368 | } |
372 | 369 | |
@@ -824,8 +821,7 @@ discard block |
||
824 | 821 | // otherwise we assume it is a formula. |
825 | 822 | if (!$alias && $table) { |
826 | 823 | $as = $table . '_' . $field; |
827 | - } |
|
828 | - else { |
|
824 | + } else { |
|
829 | 825 | $as = $alias; |
830 | 826 | } |
831 | 827 | |
@@ -875,8 +871,7 @@ discard block |
||
875 | 871 | $keyword = drupal_strtoupper($where); |
876 | 872 | if (count($clauses) > 1) { |
877 | 873 | return "$keyword (" . implode(")\n " . $this->group_operator . ' (', $clauses) . ")\n"; |
878 | - } |
|
879 | - else { |
|
874 | + } else { |
|
880 | 875 | return "$keyword " . array_shift($clauses) . "\n"; |
881 | 876 | } |
882 | 877 | } |
@@ -911,8 +906,7 @@ discard block |
||
911 | 906 | break; |
912 | 907 | } |
913 | 908 | } |
914 | - } |
|
915 | - else { |
|
909 | + } else { |
|
916 | 910 | $get_count_optimized = FALSE; |
917 | 911 | } |
918 | 912 | if (!isset($get_count_optimized)) { |
@@ -949,14 +943,11 @@ discard block |
||
949 | 943 | if (!empty($field['count'])) { |
950 | 944 | $string = "COUNT($string)"; |
951 | 945 | $has_aggregate = TRUE; |
952 | - } |
|
953 | - else if (!empty($field['aggregate'])) { |
|
946 | + } else if (!empty($field['aggregate'])) { |
|
954 | 947 | $has_aggregate = TRUE; |
955 | - } |
|
956 | - elseif ($this->distinct && !in_array($fieldname, $this->groupby)) { |
|
948 | + } elseif ($this->distinct && !in_array($fieldname, $this->groupby)) { |
|
957 | 949 | $string = $GLOBALS['db_type'] == 'pgsql' ? "FIRST($string)" : $string; |
958 | - } |
|
959 | - else { |
|
950 | + } else { |
|
960 | 951 | $non_aggregates[] = $fieldname; |
961 | 952 | } |
962 | 953 | if ($field['alias']) { |
@@ -304,8 +304,7 @@ |
||
304 | 304 | $theme_path = drupal_get_path('module', $module_dir) . '/theme'; |
305 | 305 | $theme_file = 'theme.inc'; |
306 | 306 | $path = drupal_get_path('module', $module_dir) . '/plugins'; |
307 | - } |
|
308 | - else { |
|
307 | + } else { |
|
309 | 308 | $theme_path = $path = drupal_get_path('module', $module_dir); |
310 | 309 | $theme_file = "$module.views.inc"; |
311 | 310 | } |
@@ -20,8 +20,7 @@ discard block |
||
20 | 20 | // and move on to form display. See _batch_finished() function. |
21 | 21 | $form_state = $_SESSION['batch_form_state']; |
22 | 22 | unset($_SESSION['batch_form_state']); |
23 | - } |
|
24 | - else { |
|
23 | + } else { |
|
25 | 24 | // If the incoming $_POST contains a form_build_id, we'll check the |
26 | 25 | // cache for a copy of the form in question. If it's there, we don't |
27 | 26 | // have to rebuild the form to proceed. In addition, if there is stored |
@@ -219,8 +218,7 @@ discard block |
||
219 | 218 | if (!$form['#programmed'] && empty($form_state['rebuild']) && empty($form_state['storage'])) { |
220 | 219 | if (!empty($form_state['no_redirect'])) { |
221 | 220 | $form_state['executed'] = TRUE; |
222 | - } |
|
223 | - else { |
|
221 | + } else { |
|
224 | 222 | drupal_redirect_form($form, $form_state['redirect']); |
225 | 223 | } |
226 | 224 | } |
@@ -270,8 +268,7 @@ discard block |
||
270 | 268 | } |
271 | 269 | if (!empty($form_state['ajax'])) { |
272 | 270 | $form_state['js settings']['viewsAjax']['formRelationships'][$element['#id']] = array('num' => $element['#dependency_count'], 'values' => $element['#dependency']); |
273 | - } |
|
274 | - else { |
|
271 | + } else { |
|
275 | 272 | views_add_js('dependent'); |
276 | 273 | $options['viewsAjax']['formRelationships'][$element['#id']] = array('num' => $element['#dependency_count'], 'values' => $element['#dependency']); |
277 | 274 | drupal_add_js($options, 'setting'); |
@@ -61,11 +61,9 @@ discard block |
||
61 | 61 | if (isset($definition['contains']) && is_array($definition['contains'])) { |
62 | 62 | $storage[$option] = array(); |
63 | 63 | $this->_set_option_defaults($storage[$option], $definition['contains'], $level++); |
64 | - } |
|
65 | - elseif (!empty($definition['translatable']) && !empty($definition['default'])) { |
|
64 | + } elseif (!empty($definition['translatable']) && !empty($definition['default'])) { |
|
66 | 65 | $storage[$option] = t($definition['default']); |
67 | - } |
|
68 | - else { |
|
66 | + } else { |
|
69 | 67 | $storage[$option] = isset($definition['default']) ? $definition['default'] : NULL; |
70 | 68 | } |
71 | 69 | } |
@@ -91,11 +89,9 @@ discard block |
||
91 | 89 | } |
92 | 90 | |
93 | 91 | $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array(), FALSE); |
94 | - } |
|
95 | - else if (!empty($definition[$key]['translatable']) && !empty($value)) { |
|
92 | + } else if (!empty($definition[$key]['translatable']) && !empty($value)) { |
|
96 | 93 | $storage[$key] = t($value); |
97 | - } |
|
98 | - else { |
|
94 | + } else { |
|
99 | 95 | $storage[$key] = $value; |
100 | 96 | } |
101 | 97 | } |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | $ops = array(); |
28 | 28 | if (!isset($current_views[$view->name])) { |
29 | 29 | $ops[] = l(t('Convert'), "admin/build/views1/convert/$view->name"); |
30 | - } |
|
31 | - else { |
|
30 | + } else { |
|
32 | 31 | $ops[] = t('Converted'); |
33 | 32 | } |
34 | 33 | $ops[] = l(t('Delete'), "admin/build/views1/delete/$view->name"); |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | if (!empty($ts)) { |
55 | 54 | if (strtolower($ts['sort']) == 'desc') { |
56 | 55 | arsort($sorts); |
57 | - } |
|
58 | - else { |
|
56 | + } else { |
|
59 | 57 | asort($sorts); |
60 | 58 | } |
61 | 59 | } |
@@ -133,8 +131,7 @@ discard block |
||
133 | 131 | if ($view) { |
134 | 132 | views_ui_cache_set($view); |
135 | 133 | drupal_goto('admin/build/views/edit/' . $view->name); |
136 | - } |
|
137 | - else { |
|
134 | + } else { |
|
138 | 135 | return t('Unable to convert view.'); |
139 | 136 | } |
140 | 137 | } |
@@ -332,8 +329,7 @@ discard block |
||
332 | 329 | $field['argoptions']['default_argument_php'] .= ' return $args['. $field['position'] .'];'."\n"; |
333 | 330 | $field['argoptions']['default_argument_php'] .= '}'; |
334 | 331 | $field['argoptions']['validate_fail'] = $actions[$field['argdefault']]; |
335 | - } |
|
336 | - else { |
|
332 | + } else { |
|
337 | 333 | $field['argoptions']['default_action'] = $actions[$field['argdefault']]; |
338 | 334 | } |
339 | 335 | if (!empty($field['title'])) { |
@@ -497,8 +493,7 @@ discard block |
||
497 | 493 | //|| $filters[$filter['field']]['value-type'] == 'array' ) { |
498 | 494 | if ($filter['value'] !== NULL && $filter['value'] !== '') { |
499 | 495 | $filter['value'] = explode(',', $filter['value']); |
500 | - } |
|
501 | - else { |
|
496 | + } else { |
|
502 | 497 | $filter['value'] = array(); |
503 | 498 | } |
504 | 499 | } |
@@ -4,7 +4,8 @@ |
||
4 | 4 | * Caching plugin that provides no caching at all. |
5 | 5 | */ |
6 | 6 | class views_plugin_cache_none extends views_plugin_cache { |
7 | - function cache_start() { /* do nothing */ } |
|
7 | + function cache_start() { |
|
8 | +/* do nothing */ } |
|
8 | 9 | |
9 | 10 | function summary_title() { |
10 | 11 | return t('None'); |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | if ($lifespan = $this->options[$type . '_lifespan']) { |
39 | 39 | $cutoff = time() - $lifespan; |
40 | 40 | return $cutoff; |
41 | - } |
|
42 | - else { |
|
41 | + } else { |
|
43 | 42 | return FALSE; |
44 | 43 | } |
45 | 44 | } |
@@ -47,8 +46,7 @@ discard block |
||
47 | 46 | function cache_set_expire($type) { |
48 | 47 | if ($lifespan = $this->options[$type . '_lifespan']) { |
49 | 48 | return time() + $lifespan; |
50 | - } |
|
51 | - else { |
|
49 | + } else { |
|
52 | 50 | return CACHE_PERMANENT; |
53 | 51 | } |
54 | 52 | } |