@@ -94,8 +94,7 @@ discard block |
||
94 | 94 | foreach ($dependencies as $k => $v) { |
95 | 95 | if (empty($v) || in_array($v, $required)) { |
96 | 96 | unset($dependencies[$k]); |
97 | - } |
|
98 | - else { |
|
97 | + } else { |
|
99 | 98 | $module = features_get_modules($v); |
100 | 99 | if ($module && !empty($module->info['dependencies'])) { |
101 | 100 | // If this dependency depends on the module itself, we have a circular dependency. |
@@ -265,8 +264,7 @@ discard block |
||
265 | 264 | foreach (file_scan_directory(drupal_get_path('module', $module_name), '.*') as $file) { |
266 | 265 | if (in_array($file->name, $deprecated, TRUE)) { |
267 | 266 | features_log(t('The file @filename has been deprecated and can be removed.', array('@filename' => $file->basename)), 'status'); |
268 | - } |
|
269 | - elseif ($file->name === "{$module_name}.features" && empty($code['features'])) { |
|
267 | + } elseif ($file->name === "{$module_name}.features" && empty($code['features'])) { |
|
270 | 268 | $code['features'] = "<?php\n\n// This file is deprecated and can be removed.\n// Please remove include_once('{$module_name}.features.inc') in {$module_name}.module as well.\n"; |
271 | 269 | } |
272 | 270 | } |
@@ -274,8 +272,7 @@ discard block |
||
274 | 272 | // Add a stub module to include the defaults |
275 | 273 | else if (!empty($code['features'])) { |
276 | 274 | $code['module'] = "<?php\n\ninclude_once('{$module_name}.features.inc');\n"; |
277 | - } |
|
278 | - else { |
|
275 | + } else { |
|
279 | 276 | $code['module'] = "<?php\n\n// Drupal needs this blank file.\n"; |
280 | 277 | } |
281 | 278 | return $code; |
@@ -381,8 +378,7 @@ discard block |
||
381 | 378 | $child[] = $k; |
382 | 379 | $output .= features_export_info($v, $child); |
383 | 380 | } |
384 | - } |
|
385 | - else if (!empty($info) && count($parents)) { |
|
381 | + } else if (!empty($info) && count($parents)) { |
|
386 | 382 | $line = array_shift($parents); |
387 | 383 | foreach ($parents as $key) { |
388 | 384 | $line .= is_numeric($key) ? "[]" : "[{$key}]"; |
@@ -444,30 +440,25 @@ discard block |
||
444 | 440 | function features_var_export($var, $prefix = '', $init = TRUE) { |
445 | 441 | if (is_object($var)) { |
446 | 442 | $output = method_exists($var, 'export') ? $var->export() : features_var_export((array) $var); |
447 | - } |
|
448 | - else if (is_array($var)) { |
|
443 | + } else if (is_array($var)) { |
|
449 | 444 | if (empty($var)) { |
450 | 445 | $output = 'array()'; |
451 | - } |
|
452 | - else { |
|
446 | + } else { |
|
453 | 447 | $output = "array(\n"; |
454 | 448 | foreach ($var as $key => $value) { |
455 | 449 | $output .= " '$key' => " . features_var_export($value, ' ', FALSE) . ",\n"; |
456 | 450 | } |
457 | 451 | $output .= ')'; |
458 | 452 | } |
459 | - } |
|
460 | - else if (is_bool($var)) { |
|
453 | + } else if (is_bool($var)) { |
|
461 | 454 | $output = $var ? 'TRUE' : 'FALSE'; |
462 | - } |
|
463 | - else if (is_string($var) && strpos($var, "\n") !== FALSE) { |
|
455 | + } else if (is_string($var) && strpos($var, "\n") !== FALSE) { |
|
464 | 456 | // Replace line breaks in strings with a token for replacement |
465 | 457 | // at the very end. This protects whitespace in strings from |
466 | 458 | // unintentional indentation. |
467 | 459 | $var = str_replace("\n", "***BREAK***", $var); |
468 | 460 | $output = var_export($var, TRUE); |
469 | - } |
|
470 | - else { |
|
461 | + } else { |
|
471 | 462 | $output = var_export($var, TRUE); |
472 | 463 | } |
473 | 464 | |
@@ -621,12 +612,10 @@ discard block |
||
621 | 612 | // Collect defaults for all modules if no module name was specified. |
622 | 613 | if (isset($module_name)) { |
623 | 614 | $modules = array($module_name); |
624 | - } |
|
625 | - else { |
|
615 | + } else { |
|
626 | 616 | if ($component === 'dependencies') { |
627 | 617 | $modules = array_keys(features_get_features()); |
628 | - } |
|
629 | - else { |
|
618 | + } else { |
|
630 | 619 | $modules = array(); |
631 | 620 | foreach (features_get_component_map($component) as $component_modules) { |
632 | 621 | $modules = array_merge($modules, $component_modules); |
@@ -651,8 +640,7 @@ discard block |
||
651 | 640 | if ($alter) { |
652 | 641 | drupal_alter($default_hook, $cache[$component][$m]); |
653 | 642 | } |
654 | - } |
|
655 | - else { |
|
643 | + } else { |
|
656 | 644 | $cache[$component][$m] = FALSE; |
657 | 645 | } |
658 | 646 | } |
@@ -689,21 +677,17 @@ discard block |
||
689 | 677 | if ($object_key = $callback($object)) { |
690 | 678 | $map[$component][$object_key] = $module; |
691 | 679 | } |
692 | - } |
|
693 | - elseif (isset($attribute)) { |
|
680 | + } elseif (isset($attribute)) { |
|
694 | 681 | if (is_object($object) && isset($object->{$attribute})) { |
695 | 682 | $map[$component][$object->{$attribute}] = $module; |
696 | - } |
|
697 | - elseif (is_array($object) && isset($object[$attribute])) { |
|
683 | + } elseif (is_array($object) && isset($object[$attribute])) { |
|
698 | 684 | $map[$component][$object[$attribute]] = $module; |
699 | 685 | } |
700 | - } |
|
701 | - elseif (!isset($attribute) && !isset($callback)) { |
|
686 | + } elseif (!isset($attribute) && !isset($callback)) { |
|
702 | 687 | if (!is_numeric($key)) { |
703 | 688 | $map[$component][$key] = $module; |
704 | 689 | } |
705 | - } |
|
706 | - else { |
|
690 | + } else { |
|
707 | 691 | return FALSE; |
708 | 692 | } |
709 | 693 | } |
@@ -783,8 +767,7 @@ discard block |
||
783 | 767 | $cache[$feature][$component] = FEATURES_NEEDS_REVIEW; |
784 | 768 | } |
785 | 769 | } |
786 | - } |
|
787 | - else { |
|
770 | + } else { |
|
788 | 771 | // Semaphore is still within processing horizon. Do nothing. |
789 | 772 | if ((time() - $semaphore) < FEATURES_SEMAPHORE_TIMEOUT) { |
790 | 773 | $cache[$feature][$component] = FEATURES_REBUILDING; |
@@ -834,8 +817,7 @@ discard block |
||
834 | 817 | if ($is_assoc) { |
835 | 818 | ksort($array); |
836 | 819 | $array = array_filter($array); |
837 | - } |
|
838 | - else { |
|
820 | + } else { |
|
839 | 821 | sort($array); |
840 | 822 | } |
841 | 823 | foreach ($array as $k => $v) { |
@@ -88,8 +88,7 @@ discard block |
||
88 | 88 | $options = features_invoke($component, 'features_export_options'); |
89 | 89 | if ($component === 'dependencies') { |
90 | 90 | $default_value = !empty($feature->info['dependencies']) ? $feature->info['dependencies'] : array(); |
91 | - } |
|
92 | - else { |
|
91 | + } else { |
|
93 | 92 | $default_value = !empty($feature->info['features'][$component]) ? $feature->info['features'][$component] : array(); |
94 | 93 | } |
95 | 94 | if ($options) { |
@@ -119,8 +118,7 @@ discard block |
||
119 | 118 | 'wrapper' => 'features-export-populated', |
120 | 119 | ), |
121 | 120 | ); |
122 | - } |
|
123 | - else { |
|
121 | + } else { |
|
124 | 122 | $form['export']['sources'][$component] = array( |
125 | 123 | '#type' => 'item', |
126 | 124 | '#title' => $component, |
@@ -411,11 +409,9 @@ discard block |
||
411 | 409 | |
412 | 410 | if (!empty($module->info['project status url'])) { |
413 | 411 | $uri = l(truncate_utf8($module->info['project status url'], 35, TRUE, TRUE), $module->info['project status url']); |
414 | - } |
|
415 | - else if (isset($module->info['project'], $module->info['version'], $module->info['datestamp'])) { |
|
412 | + } else if (isset($module->info['project'], $module->info['version'], $module->info['datestamp'])) { |
|
416 | 413 | $uri = l('http://drupal.org', 'http://drupal.org/project/'. $module->info['project']); |
417 | - } |
|
418 | - else { |
|
414 | + } else { |
|
419 | 415 | $uri = t('Unavailable'); |
420 | 416 | } |
421 | 417 | $version = !empty($module->info['version']) ? $module->info['version'] : ''; |
@@ -432,11 +428,9 @@ discard block |
||
432 | 428 | $state .= theme('features_storage_link', FEATURES_NEEDS_REVIEW, NULL, $href); |
433 | 429 | $state .= theme('features_storage_link', FEATURES_OVERRIDDEN, NULL, $href); |
434 | 430 | $state .= theme('features_storage_link', FEATURES_DEFAULT, NULL, $href); |
435 | - } |
|
436 | - elseif (!empty($conflicts[$name])) { |
|
431 | + } elseif (!empty($conflicts[$name])) { |
|
437 | 432 | $state = theme('features_storage_link', FEATURES_CONFLICT, NULL, $href); |
438 | - } |
|
439 | - else { |
|
433 | + } else { |
|
440 | 434 | $state = theme('features_storage_link', FEATURES_DISABLED, NULL, $href); |
441 | 435 | } |
442 | 436 | $form[$package]['state'][$name] = array( |
@@ -505,8 +499,7 @@ discard block |
||
505 | 499 | if (module_exists('diff')) { |
506 | 500 | $item = menu_get_item("admin/build/features/{$feature->name}/diff/{$component}"); |
507 | 501 | $path = ($item && $item['access']) ? $item['href'] : NULL; |
508 | - } |
|
509 | - else { |
|
502 | + } else { |
|
510 | 503 | $path = NULL; |
511 | 504 | } |
512 | 505 | $form['components'][$component] = array( |
@@ -661,8 +654,7 @@ discard block |
||
661 | 654 | '#value' => t('Leave enabled'), |
662 | 655 | '#submit' => array('features_cleanup_form_ignore'), |
663 | 656 | ); |
664 | - } |
|
665 | - else { |
|
657 | + } else { |
|
666 | 658 | drupal_goto('admin/build/features'); |
667 | 659 | } |
668 | 660 | return $form; |
@@ -742,8 +734,7 @@ discard block |
||
742 | 734 | array('data' => t('Overrides'), 'colspan' => 2), |
743 | 735 | ); |
744 | 736 | $output .= theme('diff_table', $header, $rows, array('class' => 'diff features-diff')); |
745 | - } |
|
746 | - else { |
|
737 | + } else { |
|
747 | 738 | $output = "<div class='features-empty'>". t('No changes have been made to this feature.') ."</div>"; |
748 | 739 | } |
749 | 740 | $output = "<div class='features-comparison'>{$output}</div>"; |
@@ -214,8 +214,7 @@ discard block |
||
214 | 214 | '#type' => 'value', |
215 | 215 | '#value' => $node->panels_node['pipeline'], |
216 | 216 | ); |
217 | - } |
|
218 | - else { |
|
217 | + } else { |
|
219 | 218 | $options = array(); |
220 | 219 | foreach ($pipelines as $name => $pipeline) { |
221 | 220 | $options[$name] = check_plain($pipeline->admin_title) . '<div class="description">' . check_plain($pipeline->admin_description) . '</div>'; |
@@ -316,8 +315,7 @@ discard block |
||
316 | 315 | // Because our teasier is never the same as our content, *always* provide |
317 | 316 | // the read more flag. |
318 | 317 | $node->readmore = TRUE; |
319 | - } |
|
320 | - else { |
|
318 | + } else { |
|
321 | 319 | if (!empty($node->panels_node['did'])) { |
322 | 320 | $display = panels_load_display($node->panels_node['did']); |
323 | 321 | $display->css_id = $node->panels_node['css_id']; |
@@ -97,8 +97,7 @@ discard block |
||
97 | 97 | // Add an inner layer wrapper to the pane content before placing it into |
98 | 98 | // draggable portlet |
99 | 99 | $output = "<div class=\"panels-ipe-portlet-content\">$output</div>"; |
100 | - } |
|
101 | - else { |
|
100 | + } else { |
|
102 | 101 | $output = "<div class=\"panels-ipe-portlet-content panels-ipe-empty-pane\">$output</div>"; |
103 | 102 | } |
104 | 103 | // Hand it off to the plugin/theme for placing draggers/buttons |
@@ -217,8 +216,7 @@ discard block |
||
217 | 216 | if (!empty($form_state['clicked_button']['#save-display'])) { |
218 | 217 | // Saved. Save the cache. |
219 | 218 | panels_edit_cache_save($this->cache); |
220 | - } |
|
221 | - else { |
|
219 | + } else { |
|
222 | 220 | // Cancelled. Clear the cache. |
223 | 221 | panels_edit_cache_clear($this->cache); |
224 | 222 | } |
@@ -236,8 +234,7 @@ discard block |
||
236 | 234 | function command_update_pane($pid) { |
237 | 235 | if (is_object($pid)) { |
238 | 236 | $pane = $pid; |
239 | - } |
|
240 | - else { |
|
237 | + } else { |
|
241 | 238 | $pane = $this->display->content[$pid]; |
242 | 239 | } |
243 | 240 | |
@@ -251,8 +248,7 @@ discard block |
||
251 | 248 | function command_add_pane($pid) { |
252 | 249 | if (is_object($pid)) { |
253 | 250 | $pane = $pid; |
254 | - } |
|
255 | - else { |
|
251 | + } else { |
|
256 | 252 | $pane = $this->display->content[$pid]; |
257 | 253 | } |
258 | 254 |
@@ -134,8 +134,7 @@ discard block |
||
134 | 134 | if (!empty($data['hook theme'])) { |
135 | 135 | if (is_array($data['hook theme'])) { |
136 | 136 | $theme += $data['hook theme']; |
137 | - } |
|
138 | - else if (function_exists($data['hook theme'])) { |
|
137 | + } else if (function_exists($data['hook theme'])) { |
|
139 | 138 | $data['hook theme']($theme, $data); |
140 | 139 | } |
141 | 140 | } |
@@ -210,8 +209,7 @@ discard block |
||
210 | 209 | if (!empty($data['hook menu'])) { |
211 | 210 | if (is_array($data['hook menu'])) { |
212 | 211 | $items += $data['hook menu']; |
213 | - } |
|
214 | - else if (function_exists($data['hook menu'])) { |
|
212 | + } else if (function_exists($data['hook menu'])) { |
|
215 | 213 | $data['hook menu']($items, $data); |
216 | 214 | } |
217 | 215 | } |
@@ -454,8 +452,7 @@ discard block |
||
454 | 452 | |
455 | 453 | if (!empty($plugin['theme'])) { |
456 | 454 | return theme($plugin['theme'], $settings, $content, $pane, $display); |
457 | - } |
|
458 | - else { |
|
455 | + } else { |
|
459 | 456 | return theme('panels_pane', $content, $pane, $display); |
460 | 457 | } |
461 | 458 | } |
@@ -604,8 +601,7 @@ discard block |
||
604 | 601 | // If no location specified, use what's set in the pane. |
605 | 602 | if (empty($location)) { |
606 | 603 | $location = $pane->panel; |
607 | - } |
|
608 | - else { |
|
604 | + } else { |
|
609 | 605 | $pane->panel = $location; |
610 | 606 | } |
611 | 607 | |
@@ -960,8 +956,7 @@ discard block |
||
960 | 956 | if (!empty($display->title)) { |
961 | 957 | $watchdog_args['%title'] = $display->title; |
962 | 958 | watchdog('content', 'Panels: saved display "%title" with display id %did', $watchdog_args, WATCHDOG_NOTICE); |
963 | - } |
|
964 | - else { |
|
959 | + } else { |
|
965 | 960 | watchdog('content', 'Panels: saved display with id %did', $watchdog_args, WATCHDOG_NOTICE); |
966 | 961 | } |
967 | 962 | |
@@ -975,8 +970,7 @@ discard block |
||
975 | 970 | function panels_delete_display($display) { |
976 | 971 | if (is_object($display)) { |
977 | 972 | $did = $display->did; |
978 | - } |
|
979 | - else { |
|
973 | + } else { |
|
980 | 974 | $did = $display; |
981 | 975 | } |
982 | 976 | db_query("DELETE FROM {panels_display} WHERE did = %d", $did); |
@@ -1194,8 +1188,7 @@ discard block |
||
1194 | 1188 | // Sometimes type and subtype are the same. Avoid redudant classes. |
1195 | 1189 | if ($type_class != $subtype_class) { |
1196 | 1190 | $vars['classes'] .= " $type_class $subtype_class"; |
1197 | - } |
|
1198 | - else { |
|
1191 | + } else { |
|
1199 | 1192 | $vars['classes'] .= " $type_class"; |
1200 | 1193 | } |
1201 | 1194 | |
@@ -1473,8 +1466,7 @@ discard block |
||
1473 | 1466 | |
1474 | 1467 | if ($handler_name) { |
1475 | 1468 | $handler = &$page->handlers[$handler_name]; |
1476 | - } |
|
1477 | - else { |
|
1469 | + } else { |
|
1478 | 1470 | $handler = &$page->new_handler; |
1479 | 1471 | } |
1480 | 1472 | $cache = new stdClass(); |
@@ -1499,8 +1491,7 @@ discard block |
||
1499 | 1491 | if ($handler_name) { |
1500 | 1492 | $page->handlers[$handler_name]->conf['display'] = $cache->display; |
1501 | 1493 | $page->handler_info[$handler_name]['changed'] |= PAGE_MANAGER_CHANGED_CACHED; |
1502 | - } |
|
1503 | - else { |
|
1494 | + } else { |
|
1504 | 1495 | $page->new_handler->conf['display'] = $cache->display; |
1505 | 1496 | } |
1506 | 1497 | |
@@ -1653,8 +1644,7 @@ discard block |
||
1653 | 1644 | function panels_goto($destination) { |
1654 | 1645 | if (!is_array($destination)) { |
1655 | 1646 | return drupal_goto($destination); |
1656 | - } |
|
1657 | - else { |
|
1647 | + } else { |
|
1658 | 1648 | // Prevent notices by adding defaults |
1659 | 1649 | $destination += array( |
1660 | 1650 | 'query' => NULL, |
@@ -1745,8 +1735,7 @@ discard block |
||
1745 | 1735 | if (!empty($layout['css'])) { |
1746 | 1736 | if (file_exists(path_to_theme() . '/' . $layout['css'])) { |
1747 | 1737 | drupal_add_css(path_to_theme() . '/' . $layout['css']); |
1748 | - } |
|
1749 | - else { |
|
1738 | + } else { |
|
1750 | 1739 | drupal_add_css($layout['path'] . '/' . $layout['css']); |
1751 | 1740 | } |
1752 | 1741 | } |
@@ -1758,8 +1747,7 @@ discard block |
||
1758 | 1747 | $display = $content; |
1759 | 1748 | if (empty($display->cache['method'])) { |
1760 | 1749 | $content = panels_render_panes($display); |
1761 | - } |
|
1762 | - else { |
|
1750 | + } else { |
|
1763 | 1751 | $cache = panels_get_cached_content($display, $display->args, $display->context); |
1764 | 1752 | if ($cache === FALSE) { |
1765 | 1753 | $cache = new panels_cache_object(); |
@@ -60,8 +60,7 @@ |
||
60 | 60 | // Load the display being edited from cache, if possible. |
61 | 61 | if (!empty($_POST) && is_object($cache = panels_edit_cache_get($cache_key))) { |
62 | 62 | $display = &$cache->display; |
63 | - } |
|
64 | - else { |
|
63 | + } else { |
|
65 | 64 | $content_types = ctools_content_get_available_types(); |
66 | 65 | |
67 | 66 | panels_cache_clear('display', $cache_key); |
@@ -133,8 +133,7 @@ |
||
133 | 133 | '#process' => array('ctools_dependent_process'), |
134 | 134 | '#dependency' => array('edit-menu-entry' => array(1)), |
135 | 135 | ); |
136 | - } |
|
137 | - else { |
|
136 | + } else { |
|
138 | 137 | $form['menu']['name'] = array( |
139 | 138 | '#type' => 'value', |
140 | 139 | '#value' => $cache->menu['name'], |
@@ -318,8 +318,7 @@ discard block |
||
318 | 318 | $regions[$region_id] = $default; |
319 | 319 | $regions[$region_id]['pids'] = $panes; |
320 | 320 | } |
321 | - } |
|
322 | - else { |
|
321 | + } else { |
|
323 | 322 | // Some settings exist; iterate through each region and set individually. |
324 | 323 | foreach ($this->plugins['layout']['panels'] as $region_id => $title) { |
325 | 324 | // Ensure this region has at least an empty panes array. |
@@ -327,8 +326,7 @@ discard block |
||
327 | 326 | |
328 | 327 | if (empty($settings[$region_id]['style']) || $settings[$region_id]['style'] == -1) { |
329 | 328 | $regions[$region_id] = $default; |
330 | - } |
|
331 | - else { |
|
329 | + } else { |
|
332 | 330 | $regions[$region_id]['style'] = panels_get_style($settings[$region_id]['style']); |
333 | 331 | $regions[$region_id]['style settings'] = isset($settings['style_settings'][$region_id]) ? $settings['style_settings'][$region_id] : array(); |
334 | 332 | } |
@@ -357,8 +355,7 @@ discard block |
||
357 | 355 | |
358 | 356 | if (empty($this->display->cache['method']) || !empty($this->display->skip_cache)) { |
359 | 357 | return $this->render_layout(); |
360 | - } |
|
361 | - else { |
|
358 | + } else { |
|
362 | 359 | $cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context); |
363 | 360 | if ($cache === FALSE) { |
364 | 361 | $cache = new panels_cache_object(); |
@@ -390,8 +387,7 @@ discard block |
||
390 | 387 | |
391 | 388 | if ($this->admin && !empty($this->plugins['layout']['admin theme'])) { |
392 | 389 | $theme = $this->plugins['layout']['admin theme']; |
393 | - } |
|
394 | - else { |
|
390 | + } else { |
|
395 | 391 | $theme = $this->plugins['layout']['theme']; |
396 | 392 | } |
397 | 393 | $this->rendered['layout'] = theme($theme, check_plain($this->display->css_id), $this->rendered['regions'], $this->display->layout_settings, $this->display, $this->plugins['layout'], $this); |
@@ -408,8 +404,7 @@ discard block |
||
408 | 404 | if (!empty($this->plugins['layout']['css'])) { |
409 | 405 | if (file_exists(path_to_theme() . '/' . $this->plugins['layout']['css'])) { |
410 | 406 | $this->add_css(path_to_theme() . '/' . $this->plugins['layout']['css']); |
411 | - } |
|
412 | - else { |
|
407 | + } else { |
|
413 | 408 | $this->add_css($this->plugins['layout']['path'] . '/' . $this->plugins['layout']['css']); |
414 | 409 | } |
415 | 410 | } |
@@ -441,16 +436,14 @@ discard block |
||
441 | 436 | // private filesystem. |
442 | 437 | ctools_include('css'); |
443 | 438 | ctools_css_add_css($filename, $type, $media, $preprocess); |
444 | - } |
|
445 | - else { |
|
439 | + } else { |
|
446 | 440 | drupal_add_css($filename, $type, $media, $preprocess); |
447 | 441 | } |
448 | 442 | break; |
449 | 443 | case 'inline': |
450 | 444 | if ($path) { |
451 | 445 | $url = file_create_url($filename); |
452 | - } |
|
453 | - else { |
|
446 | + } else { |
|
454 | 447 | $url = base_path() . $filename; |
455 | 448 | } |
456 | 449 | |
@@ -499,8 +492,7 @@ discard block |
||
499 | 492 | // title to bubble up to the top but not actually be used on the pane. |
500 | 493 | if (empty($content->title) && !empty($content->original_title)) { |
501 | 494 | $this->display->stored_pane_title = $content->original_title; |
502 | - } |
|
503 | - else { |
|
495 | + } else { |
|
504 | 496 | $this->display->stored_pane_title = !empty($content->title) ? $content->title : ''; |
505 | 497 | } |
506 | 498 | } |
@@ -548,8 +540,7 @@ discard block |
||
548 | 540 | $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache); |
549 | 541 | if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) { |
550 | 542 | $content = $cache->content; |
551 | - } |
|
552 | - else { |
|
543 | + } else { |
|
553 | 544 | if ($caching) { |
554 | 545 | $cache = new panels_cache_object(); |
555 | 546 | } |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | if (!empty($form_state['clicked_button']['#save-display'])) { |
39 | 39 | drupal_set_message(t('Panel content has been updated.')); |
40 | 40 | panels_save_display($this->display); |
41 | - } |
|
42 | - else { |
|
41 | + } else { |
|
43 | 42 | drupal_set_message(t('Your changes have been discarded.')); |
44 | 43 | } |
45 | 44 | |
@@ -122,8 +121,7 @@ discard block |
||
122 | 121 | if (empty($content_type)) { |
123 | 122 | $block->title = '<em>' . t('Missing content type') . '</em>'; |
124 | 123 | $block->content = t('This pane\'s content type is either missing or has been deleted. This pane will not render.'); |
125 | - } |
|
126 | - else { |
|
124 | + } else { |
|
127 | 125 | $block = ctools_content_admin_info($content_type, $pane->subtype, $pane->configuration, $this->display->context); |
128 | 126 | } |
129 | 127 | |
@@ -294,8 +292,7 @@ discard block |
||
294 | 292 | 'href' => $this->get_url('hide', $pane->pid), |
295 | 293 | 'attributes' => array('class' => 'ctools-use-ajax'), |
296 | 294 | ); |
297 | - } |
|
298 | - else { |
|
295 | + } else { |
|
299 | 296 | $links[] = array( |
300 | 297 | 'title' => t('Enable this pane'), |
301 | 298 | 'href' => $this->get_url('show', $pane->pid), |
@@ -308,8 +305,7 @@ discard block |
||
308 | 305 | 'title' => t('✓Panel title'), |
309 | 306 | 'html' => TRUE, |
310 | 307 | ); |
311 | - } |
|
312 | - else { |
|
308 | + } else { |
|
313 | 309 | $links['panels-set-title'] = array( |
314 | 310 | 'title' => t('Panel title'), |
315 | 311 | 'href' => $this->get_url('panel-title', $pane->pid), |
@@ -546,8 +542,7 @@ discard block |
||
546 | 542 | |
547 | 543 | if (empty($categories)) { |
548 | 544 | $output = t('There are no content types you may add to this display.'); |
549 | - } |
|
550 | - else { |
|
545 | + } else { |
|
551 | 546 | $output = '<div class="panels-add-content-modal">'; |
552 | 547 | $selector = $this->render_category_selector($categories, $category, $region); |
553 | 548 | |
@@ -572,16 +567,13 @@ discard block |
||
572 | 567 | function get_category($content_type) { |
573 | 568 | if (isset($content_type['top level'])) { |
574 | 569 | $category = 'root'; |
575 | - } |
|
576 | - else if (isset($content_type['category'])) { |
|
570 | + } else if (isset($content_type['category'])) { |
|
577 | 571 | if (is_array($content_type['category'])) { |
578 | 572 | list($category, $weight) = $content_type['category']; |
579 | - } |
|
580 | - else { |
|
573 | + } else { |
|
581 | 574 | $category = $content_type['category']; |
582 | 575 | } |
583 | - } |
|
584 | - else { |
|
576 | + } else { |
|
585 | 577 | $category = t('Uncategorized'); |
586 | 578 | } |
587 | 579 | |
@@ -695,8 +687,7 @@ discard block |
||
695 | 687 | $output = '<div class="panels-categories-description">'; |
696 | 688 | $output .= t('Content options are divided by category. Please select a category from the left to proceed.'); |
697 | 689 | $output .= '</div>'; |
698 | - } |
|
699 | - else { |
|
690 | + } else { |
|
700 | 691 | $titles = array_keys($content); |
701 | 692 | natcasesort($titles); |
702 | 693 | |
@@ -736,8 +727,7 @@ discard block |
||
736 | 727 | if (!isset($step) || !isset($this->cache->new_pane)) { |
737 | 728 | $pane = panels_new_pane($type_name, $subtype_name, TRUE); |
738 | 729 | $this->cache->new_pane = &$pane; |
739 | - } |
|
740 | - else { |
|
730 | + } else { |
|
741 | 731 | $pane = &$this->cache->new_pane; |
742 | 732 | } |
743 | 733 | |
@@ -778,13 +768,11 @@ discard block |
||
778 | 768 | |
779 | 769 | // Dismiss the modal. |
780 | 770 | $this->commands[] = ctools_modal_command_dismiss(); |
781 | - } |
|
782 | - else if (!empty($form_state['cancel'])) { |
|
771 | + } else if (!empty($form_state['cancel'])) { |
|
783 | 772 | // If cancelling, return to the activity. |
784 | 773 | list($category_key, $category) = $this->get_category($subtype); |
785 | 774 | $this->ajax_select_content($region, $category_key); |
786 | - } |
|
787 | - else { |
|
775 | + } else { |
|
788 | 776 | // This overwrites any previous commands. |
789 | 777 | $this->commands = ctools_modal_form_render($form_state, $output); |
790 | 778 | } |
@@ -828,13 +816,11 @@ discard block |
||
828 | 816 | if ($output === FALSE || !empty($form_state['cancel'])) { |
829 | 817 | // Dismiss the modal. |
830 | 818 | $this->commands[] = ctools_modal_command_dismiss(); |
831 | - } |
|
832 | - else if (!empty($form_state['complete'])) { |
|
819 | + } else if (!empty($form_state['complete'])) { |
|
833 | 820 | panels_edit_cache_set($this->cache); |
834 | 821 | $this->command_update_pane($pid); |
835 | 822 | $this->commands[] = ctools_modal_command_dismiss(); |
836 | - } |
|
837 | - else { |
|
823 | + } else { |
|
838 | 824 | // This overwrites any previous commands. |
839 | 825 | $this->commands = ctools_modal_form_render($form_state, $output); |
840 | 826 | } |
@@ -879,14 +865,12 @@ discard block |
||
879 | 865 | if ($pid == 'display') { |
880 | 866 | $conf = &$this->display->cache; |
881 | 867 | $title = t('Cache method for this display'); |
882 | - } |
|
883 | - else if (!empty($this->display->content[$pid])) { |
|
868 | + } else if (!empty($this->display->content[$pid])) { |
|
884 | 869 | $pane = &$this->display->content[$pid]; |
885 | 870 | $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); |
886 | 871 | $conf = &$pane->cache; |
887 | 872 | $title = t('Cache method for !subtype_title', array('!subtype_title' => $subtype['title'])); |
888 | - } |
|
889 | - else { |
|
873 | + } else { |
|
890 | 874 | ctools_modal_render(t('Error'), t('Invalid pane id.')); |
891 | 875 | } |
892 | 876 | |
@@ -916,12 +900,10 @@ discard block |
||
916 | 900 | |
917 | 901 | if ($pid != 'display') { |
918 | 902 | $this->command_update_pane($pane); |
919 | - } |
|
920 | - else { |
|
903 | + } else { |
|
921 | 904 | $this->command_update_display_links(); |
922 | 905 | } |
923 | - } |
|
924 | - else { |
|
906 | + } else { |
|
925 | 907 | $this->cache->method = $form_state['method']; |
926 | 908 | panels_edit_cache_set($this->cache); |
927 | 909 | // send them to next form. |
@@ -944,15 +926,13 @@ discard block |
||
944 | 926 | if ($pid == 'display') { |
945 | 927 | $conf = &$this->display->cache; |
946 | 928 | $title = t('Cache settings for this display'); |
947 | - } |
|
948 | - else if (!empty($this->display->content[$pid])) { |
|
929 | + } else if (!empty($this->display->content[$pid])) { |
|
949 | 930 | $pane = &$this->display->content[$pid]; |
950 | 931 | $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); |
951 | 932 | |
952 | 933 | $conf = &$pane->cache; |
953 | 934 | $title = t('Cache settings for !subtype_title', array('!subtype_title' => $subtype['title'])); |
954 | - } |
|
955 | - else { |
|
935 | + } else { |
|
956 | 936 | ctools_modal_render(t('Error'), t('Invalid pane id.')); |
957 | 937 | } |
958 | 938 | |
@@ -983,8 +963,7 @@ discard block |
||
983 | 963 | |
984 | 964 | if ($pid != 'display') { |
985 | 965 | $this->command_update_pane($pane); |
986 | - } |
|
987 | - else { |
|
966 | + } else { |
|
988 | 967 | $this->command_update_display_links(); |
989 | 968 | } |
990 | 969 | } |
@@ -1085,15 +1064,12 @@ discard block |
||
1085 | 1064 | |
1086 | 1065 | if ($type == 'pane') { |
1087 | 1066 | $this->command_update_pane($pane); |
1088 | - } |
|
1089 | - else if ($type == 'region') { |
|
1067 | + } else if ($type == 'region') { |
|
1090 | 1068 | $this->command_update_region_links($pid); |
1091 | - } |
|
1092 | - else { |
|
1069 | + } else { |
|
1093 | 1070 | $this->command_update_display_links(); |
1094 | 1071 | } |
1095 | - } |
|
1096 | - else { |
|
1072 | + } else { |
|
1097 | 1073 | if ($form_state['style'] != $form_state['old_style']) { |
1098 | 1074 | $this->cache->style = $form_state['style']; |
1099 | 1075 | panels_edit_cache_set($this->cache); |
@@ -1134,8 +1110,7 @@ discard block |
||
1134 | 1110 | $conf = &$pane->style['settings']; |
1135 | 1111 | break; |
1136 | 1112 | } |
1137 | - } |
|
1138 | - else { |
|
1113 | + } else { |
|
1139 | 1114 | switch ($type) { |
1140 | 1115 | case 'display': |
1141 | 1116 | $style = panels_get_style((!empty($this->display->panel_settings['style'])) ? $this->display->panel_settings['style'] : 'default'); |
@@ -1237,11 +1212,9 @@ discard block |
||
1237 | 1212 | |
1238 | 1213 | if ($type == 'pane') { |
1239 | 1214 | $this->command_update_pane($pane); |
1240 | - } |
|
1241 | - else if ($type == 'region') { |
|
1215 | + } else if ($type == 'region') { |
|
1242 | 1216 | $this->command_update_region_links($pid); |
1243 | - } |
|
1244 | - else { |
|
1217 | + } else { |
|
1245 | 1218 | $this->command_update_display_links(); |
1246 | 1219 | } |
1247 | 1220 | } |
@@ -1362,8 +1335,7 @@ discard block |
||
1362 | 1335 | if ($id == 'add') { |
1363 | 1336 | $pane->access['plugins'][] = $this->cache->new_plugin; |
1364 | 1337 | $id = max(array_keys($pane->access['plugins'])); |
1365 | - } |
|
1366 | - else if (empty($pane->access['plugins'][$id])) { |
|
1338 | + } else if (empty($pane->access['plugins'][$id])) { |
|
1367 | 1339 | ctools_modal_render(t('Error'), t('Invalid test id.')); |
1368 | 1340 | } |
1369 | 1341 | |
@@ -1466,8 +1438,7 @@ discard block |
||
1466 | 1438 | function command_update_pane($pid) { |
1467 | 1439 | if (is_object($pid)) { |
1468 | 1440 | $pane = $pid; |
1469 | - } |
|
1470 | - else { |
|
1441 | + } else { |
|
1471 | 1442 | $pane = $this->display->content[$pid]; |
1472 | 1443 | } |
1473 | 1444 | |
@@ -1481,8 +1452,7 @@ discard block |
||
1481 | 1452 | function command_add_pane($pid) { |
1482 | 1453 | if (is_object($pid)) { |
1483 | 1454 | $pane = $pid; |
1484 | - } |
|
1485 | - else { |
|
1455 | + } else { |
|
1486 | 1456 | $pane = $this->display->content[$pid]; |
1487 | 1457 | } |
1488 | 1458 |