@@ -417,12 +417,10 @@ |
||
417 | 417 | if (empty($option)) |
418 | 418 | { |
419 | 419 | return $redcorePath; |
420 | - } |
|
421 | - elseif ($fromOption) |
|
420 | + } elseif ($fromOption) |
|
422 | 421 | { |
423 | 422 | return $extensionPath; |
424 | - } |
|
425 | - elseif (!is_dir($extensionPath) || $fromRedcore) |
|
423 | + } elseif (!is_dir($extensionPath) || $fromRedcore) |
|
426 | 424 | { |
427 | 425 | return $redcorePath . '/' . $option; |
428 | 426 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | $originalTableName = $translationTable->table; |
83 | 83 | |
84 | 84 | // Get the aliases for the path from the node to the root node. |
85 | - $db = JFactory::getDbo(); |
|
85 | + $db = JFactory::getDbo(); |
|
86 | 86 | $query = $db->getQuery(true) |
87 | 87 | ->select('COALESCE(translation.alias, original.alias) AS alias') |
88 | 88 | ->where('n.lft BETWEEN original.lft AND original.rgt') |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | $base . '/views/' . $view . '/tmpl', |
441 | 441 | $base . '/view/' . $view . '/tmpl' |
442 | 442 | ); |
443 | - $path = JPath::find($tplFolders, $layout . '.xml'); |
|
443 | + $path = JPath::find($tplFolders, $layout . '.xml'); |
|
444 | 444 | |
445 | 445 | if (is_file($path)) |
446 | 446 | { |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $base . '/view/' . $view, |
471 | 471 | $base . '/views/' . $view |
472 | 472 | ); |
473 | - $metaPath = JPath::find($metadataFolders, 'metadata.xml'); |
|
473 | + $metaPath = JPath::find($metadataFolders, 'metadata.xml'); |
|
474 | 474 | |
475 | 475 | if (is_file($path = JPath::clean($metaPath))) |
476 | 476 | { |
@@ -176,8 +176,7 @@ discard block |
||
176 | 176 | if (version_compare(JVERSION, '3.0', '<') && !empty($column['formname25'])) |
177 | 177 | { |
178 | 178 | $formName = !empty($column['formname']) ? $column['formname25'] : $column['name']; |
179 | - } |
|
180 | - else |
|
179 | + } else |
|
181 | 180 | { |
182 | 181 | $formName = !empty($column['formname']) ? $column['formname'] : $column['name']; |
183 | 182 | } |
@@ -234,8 +233,7 @@ discard block |
||
234 | 233 | |
235 | 234 | // Load the data into the form after the plugins have operated. |
236 | 235 | $form->bind($formData); |
237 | - } |
|
238 | - catch (Exception $e) |
|
236 | + } catch (Exception $e) |
|
239 | 237 | { |
240 | 238 | return false; |
241 | 239 | } |
@@ -270,12 +268,10 @@ discard block |
||
270 | 268 | if ($tableName == 'modules') |
271 | 269 | { |
272 | 270 | $form = self::preprocessFormModules($form, $data); |
273 | - } |
|
274 | - elseif ($tableName == 'menus') |
|
271 | + } elseif ($tableName == 'menus') |
|
275 | 272 | { |
276 | 273 | $form = self::preprocessFormMenu($form, $data); |
277 | - } |
|
278 | - elseif ($tableName == 'plugins') |
|
274 | + } elseif ($tableName == 'plugins') |
|
279 | 275 | { |
280 | 276 | $form = self::preprocessFormPlugins($form, $data); |
281 | 277 | } |
@@ -427,8 +423,7 @@ discard block |
||
427 | 423 | if (isset($args['layout'])) |
428 | 424 | { |
429 | 425 | $layout = $args['layout']; |
430 | - } |
|
431 | - else |
|
426 | + } else |
|
432 | 427 | { |
433 | 428 | $layout = 'default'; |
434 | 429 | } |
@@ -476,8 +471,7 @@ discard block |
||
476 | 471 | { |
477 | 472 | $formFile = $path; |
478 | 473 | } |
479 | - } |
|
480 | - else |
|
474 | + } else |
|
481 | 475 | { |
482 | 476 | // Now check for a component manifest file |
483 | 477 | $path = JPath::clean($base . '/metadata.xml'); |
@@ -512,8 +506,7 @@ discard block |
||
512 | 506 | if ($isNew = false) |
513 | 507 | { |
514 | 508 | $path = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $option . '/config.xml'); |
515 | - } |
|
516 | - else |
|
509 | + } else |
|
517 | 510 | { |
518 | 511 | $path = 'null'; |
519 | 512 | } |
@@ -742,20 +735,17 @@ discard block |
||
742 | 735 | if (empty($item->rctranslations_language)) |
743 | 736 | { |
744 | 737 | return array('badge' => 'label label-danger', 'status' => 'JNONE'); |
745 | - } |
|
746 | - elseif ($item->rctranslations_state != 1) |
|
738 | + } elseif ($item->rctranslations_state != 1) |
|
747 | 739 | { |
748 | 740 | return array('badge' => 'label label-danger', 'status' => 'JUNPUBLISHED'); |
749 | - } |
|
750 | - else |
|
741 | + } else |
|
751 | 742 | { |
752 | 743 | $originalValues = new JRegistry; |
753 | 744 | |
754 | 745 | if (is_array($item->rctranslations_originals)) |
755 | 746 | { |
756 | 747 | $originalValues->loadArray($item->rctranslations_originals); |
757 | - } |
|
758 | - else |
|
748 | + } else |
|
759 | 749 | { |
760 | 750 | $originalValues->loadString((string) $item->rctranslations_originals); |
761 | 751 | } |
@@ -827,8 +817,7 @@ discard block |
||
827 | 817 | if (array_filter($data, 'strlen')) |
828 | 818 | { |
829 | 819 | return true; |
830 | - } |
|
831 | - else |
|
820 | + } else |
|
832 | 821 | { |
833 | 822 | return false; |
834 | 823 | } |
@@ -90,8 +90,7 @@ |
||
90 | 90 | if (is_array($value)) |
91 | 91 | { |
92 | 92 | array_merge($this->attribs[$attribute], $value); |
93 | - } |
|
94 | - else |
|
93 | + } else |
|
95 | 94 | { |
96 | 95 | $this->attribs[$attribute][] = $value; |
97 | 96 | } |
@@ -96,8 +96,7 @@ discard block |
||
96 | 96 | new RecursiveDirectoryIterator($parentPath), |
97 | 97 | RecursiveIteratorIterator::SELF_FIRST |
98 | 98 | ); |
99 | - } |
|
100 | - else |
|
99 | + } else |
|
101 | 100 | { |
102 | 101 | $iterator = new DirectoryIterator($parentPath); |
103 | 102 | } |
@@ -120,8 +119,7 @@ discard block |
||
120 | 119 | } |
121 | 120 | } |
122 | 121 | } |
123 | - } |
|
124 | - catch (UnexpectedValueException $e) |
|
122 | + } catch (UnexpectedValueException $e) |
|
125 | 123 | { |
126 | 124 | // Exception will be thrown if the path is not a directory. Ignore it. |
127 | 125 | } |
@@ -333,8 +331,7 @@ discard block |
||
333 | 331 | if ($prepend) |
334 | 332 | { |
335 | 333 | array_unshift(self::$prefixes[$prefix], $path); |
336 | - } |
|
337 | - else |
|
334 | + } else |
|
338 | 335 | { |
339 | 336 | self::$prefixes[$prefix][] = $path; |
340 | 337 | } |
@@ -368,8 +365,7 @@ discard block |
||
368 | 365 | if (!isset(self::$classAliasesInverse[$original])) |
369 | 366 | { |
370 | 367 | self::$classAliasesInverse[$original] = array($alias); |
371 | - } |
|
372 | - else |
|
368 | + } else |
|
373 | 369 | { |
374 | 370 | self::$classAliasesInverse[$original][] = $alias; |
375 | 371 | } |
@@ -429,8 +425,7 @@ discard block |
||
429 | 425 | if ($prepend) |
430 | 426 | { |
431 | 427 | array_unshift(self::$namespaces[$type][$namespace], $path); |
432 | - } |
|
433 | - else |
|
428 | + } else |
|
434 | 429 | { |
435 | 430 | self::$namespaces[$type][$namespace][] = $path; |
436 | 431 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function preprocessUpdates($parent) |
258 | 258 | { |
259 | - $manifest = $parent->get('manifest'); |
|
259 | + $manifest = $parent->get('manifest'); |
|
260 | 260 | |
261 | 261 | if (isset($manifest->update)) |
262 | 262 | { |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | protected function installTranslations($parent) |
633 | 633 | { |
634 | 634 | // Required objects |
635 | - $manifest = $parent->get('manifest'); |
|
635 | + $manifest = $parent->get('manifest'); |
|
636 | 636 | |
637 | 637 | if (method_exists('RTranslationTable', 'batchContentElements')) |
638 | 638 | { |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | { |
641 | 641 | foreach ($nodes as $node) |
642 | 642 | { |
643 | - $extName = (string) $node->attributes()->name; |
|
643 | + $extName = (string) $node->attributes()->name; |
|
644 | 644 | |
645 | 645 | try |
646 | 646 | { |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | // If it's installing redcore as dependency |
671 | 671 | if (get_called_class() != 'Com_RedcoreInstallerScript' && $type != 'discover_install') |
672 | 672 | { |
673 | - $manifest = $this->getManifest($parent); |
|
673 | + $manifest = $this->getManifest($parent); |
|
674 | 674 | |
675 | 675 | if ($manifest->redcore) |
676 | 676 | { |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | } |
995 | 995 | } |
996 | 996 | |
997 | - if($type == 'update') |
|
997 | + if ($type == 'update') |
|
998 | 998 | { |
999 | 999 | $db = JFactory::getDbo(); |
1000 | 1000 | $db->setQuery('TRUNCATE ' . $db->qn('#__redcore_schemas')) |
@@ -1346,7 +1346,7 @@ discard block |
||
1346 | 1346 | protected function uninstallWebservices($parent) |
1347 | 1347 | { |
1348 | 1348 | // Required objects |
1349 | - $manifest = $this->getManifest($parent); |
|
1349 | + $manifest = $this->getManifest($parent); |
|
1350 | 1350 | |
1351 | 1351 | if (!$manifest) |
1352 | 1352 | { |
@@ -1404,7 +1404,7 @@ discard block |
||
1404 | 1404 | protected function uninstallCli($parent) |
1405 | 1405 | { |
1406 | 1406 | // Required objects |
1407 | - $manifest = $this->getManifest($parent); |
|
1407 | + $manifest = $this->getManifest($parent); |
|
1408 | 1408 | |
1409 | 1409 | if (!$manifest) |
1410 | 1410 | { |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | { |
1599 | 1599 | if (method_exists('RComponentHelper', 'displayComponentInfo')) |
1600 | 1600 | { |
1601 | - $manifest = $this->getManifest($parent); |
|
1601 | + $manifest = $this->getManifest($parent); |
|
1602 | 1602 | echo RComponentHelper::displayComponentInfo((string) $manifest->name, $message); |
1603 | 1603 | } |
1604 | 1604 | } |
@@ -380,8 +380,7 @@ discard block |
||
380 | 380 | if ((string) $manifest['client'] == 'administrator') |
381 | 381 | { |
382 | 382 | $sourcePath = JPATH_ADMINISTRATOR . '/modules/' . $this->extensionElement; |
383 | - } |
|
384 | - else |
|
383 | + } else |
|
385 | 384 | { |
386 | 385 | $sourcePath = JPATH_SITE . '/modules/' . $this->extensionElement; |
387 | 386 | } |
@@ -553,12 +552,12 @@ discard block |
||
553 | 552 | { |
554 | 553 | $installer->setAdapter('module'); |
555 | 554 | $result = $installer->install($extPath); |
556 | - } |
|
557 | - elseif ($extId = $this->searchExtension($extName, 'module', '-1')) |
|
558 | - // Discover install |
|
555 | + } elseif ($extId = $this->searchExtension($extName, 'module', '-1')) { |
|
556 | + // Discover install |
|
559 | 557 | { |
560 | 558 | $result = $installer->discover_install($extId); |
561 | 559 | } |
560 | + } |
|
562 | 561 | |
563 | 562 | $this->_storeStatus('modules', array('name' => $extName, 'client' => $extClient, 'result' => $result)); |
564 | 563 | } |
@@ -594,12 +593,12 @@ discard block |
||
594 | 593 | { |
595 | 594 | $installer->setAdapter('plugin'); |
596 | 595 | $result = $installer->install($extPath); |
597 | - } |
|
598 | - elseif ($extId = $this->searchExtension($extName, 'plugin', '-1', $extGroup)) |
|
599 | - // Discover install |
|
596 | + } elseif ($extId = $this->searchExtension($extName, 'plugin', '-1', $extGroup)) { |
|
597 | + // Discover install |
|
600 | 598 | { |
601 | 599 | $result = $installer->discover_install($extId); |
602 | 600 | } |
601 | + } |
|
603 | 602 | |
604 | 603 | // Store the result to show install summary later |
605 | 604 | $this->_storeStatus('plugins', array('name' => $extName, 'group' => $extGroup, 'result' => $result)); |
@@ -645,8 +644,7 @@ discard block |
||
645 | 644 | try |
646 | 645 | { |
647 | 646 | RTranslationTable::batchContentElements($extName, 'install'); |
648 | - } |
|
649 | - catch (Exception $e) |
|
647 | + } catch (Exception $e) |
|
650 | 648 | { |
651 | 649 | // We are already setting message queue so we don't need to set it here as well |
652 | 650 | } |
@@ -840,8 +838,7 @@ discard block |
||
840 | 838 | if ($folder && file_exists($src . '/' . $folder)) |
841 | 839 | { |
842 | 840 | $source = $src . '/' . $folder; |
843 | - } |
|
844 | - else |
|
841 | + } else |
|
845 | 842 | { |
846 | 843 | // Cli folder does not exist |
847 | 844 | continue; |
@@ -1276,8 +1273,7 @@ discard block |
||
1276 | 1273 | try |
1277 | 1274 | { |
1278 | 1275 | $translationTableModel->delete($deleteId); |
1279 | - } |
|
1280 | - catch (Exception $e) |
|
1276 | + } catch (Exception $e) |
|
1281 | 1277 | { |
1282 | 1278 | JFactory::getApplication()->enqueueMessage(JText::sprintf('LIB_REDCORE_TRANSLATIONS_DELETE_ERROR', $e->getMessage()), 'error'); |
1283 | 1279 | } |
@@ -1378,8 +1374,7 @@ discard block |
||
1378 | 1374 | if (is_dir($path)) |
1379 | 1375 | { |
1380 | 1376 | $val = JFolder::delete($path); |
1381 | - } |
|
1382 | - else |
|
1377 | + } else |
|
1383 | 1378 | { |
1384 | 1379 | $val = JFile::delete($path); |
1385 | 1380 | } |
@@ -1444,8 +1439,7 @@ discard block |
||
1444 | 1439 | if (is_dir($path)) |
1445 | 1440 | { |
1446 | 1441 | $val = JFolder::delete($path); |
1447 | - } |
|
1448 | - else |
|
1442 | + } else |
|
1449 | 1443 | { |
1450 | 1444 | $val = JFile::delete($path); |
1451 | 1445 | } |
@@ -1663,8 +1657,7 @@ discard block |
||
1663 | 1657 | { |
1664 | 1658 | return false; |
1665 | 1659 | } |
1666 | - } |
|
1667 | - catch (Exception $e) |
|
1660 | + } catch (Exception $e) |
|
1668 | 1661 | { |
1669 | 1662 | JFactory::getApplication()->enqueueMessage( |
1670 | 1663 | JText::_('COM_REDCORE_INSTALL_UNABLE_TO_CHECK_VERSION'), |
@@ -1699,8 +1692,7 @@ discard block |
||
1699 | 1692 | if (isset($manifest->element)) |
1700 | 1693 | { |
1701 | 1694 | $element = (string) $manifest->element; |
1702 | - } |
|
1703 | - else |
|
1695 | + } else |
|
1704 | 1696 | { |
1705 | 1697 | $element = (string) $manifest->name; |
1706 | 1698 | } |