From 140badb63e9c2c7118f2d7d2d66960e172735b95 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 23 May 2025 15:21:45 +0200 Subject: [PATCH] Fixes --- .../docker-compose.local.dev.yml | 21 ++-- src/new/src/PSC/Kernel.php | 6 +- .../Shop/ThemeBundle/PSCShopThemeBundle.php | 8 +- .../PluginBundle/Compiler/PluginCompiler.php | 11 +- .../PSCSystemPluginExtension.php | 7 +- .../EventListener/RequestListener.php | 7 +- .../Routing/PluginRouteLoader.php | 17 ++- src/new/tests/RefreshDatabaseTrait.php | 2 - .../controllers/PreflightController.php | 110 +++++++++--------- 9 files changed, 105 insertions(+), 84 deletions(-) diff --git a/.docker/docker-compose/docker-compose.local.dev.yml b/.docker/docker-compose/docker-compose.local.dev.yml index ec07d2215..bcbe5c7e7 100644 --- a/.docker/docker-compose/docker-compose.local.dev.yml +++ b/.docker/docker-compose/docker-compose.local.dev.yml @@ -8,7 +8,16 @@ services: - ${APPLICATION_CODE_PATH_HOST?}:${APPLICATION_CODE_PATH_CONTAINER?} php-cron: environment: + - PHP_IDE_CONFIG=${PHP_IDE_CONFIG?} - APP_ENV=dev + networks: + - network + cap_add: + - "SYS_PTRACE" + security_opt: + - "seccomp=unconfined" + extra_hosts: + - host.docker.internal:host-gateway volumes: - ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?} web: @@ -28,18 +37,6 @@ services: volumes: - ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?} - php-cron: - environment: - - PHP_IDE_CONFIG=${PHP_IDE_CONFIG?} - networks: - - network - cap_add: - - "SYS_PTRACE" - security_opt: - - "seccomp=unconfined" - extra_hosts: - - host.docker.internal:host-gateway - chrome: ports: - "7900:7900" diff --git a/src/new/src/PSC/Kernel.php b/src/new/src/PSC/Kernel.php index a2894b975..146fe3058 100755 --- a/src/new/src/PSC/Kernel.php +++ b/src/new/src/PSC/Kernel.php @@ -21,7 +21,11 @@ class Kernel extends BaseKernel try { if (extension_loaded('mongodb')) { - $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + if ($_ENV['APP_ENV'] == 'test') { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin; + } else { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + } $plugins = $collection->find(array('installed' => true)); diff --git a/src/new/src/PSC/Shop/ThemeBundle/PSCShopThemeBundle.php b/src/new/src/PSC/Shop/ThemeBundle/PSCShopThemeBundle.php index ac077decf..d766a66b5 100755 --- a/src/new/src/PSC/Shop/ThemeBundle/PSCShopThemeBundle.php +++ b/src/new/src/PSC/Shop/ThemeBundle/PSCShopThemeBundle.php @@ -25,7 +25,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; */ class PSCShopThemeBundle extends Bundle { - public function build(ContainerBuilder $container) { parent::build($container); @@ -33,7 +32,12 @@ class PSCShopThemeBundle extends Bundle try { if (extension_loaded('mongodb')) { - $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + if ($_ENV['APP_ENV'] == 'test') { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin; + } else { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + } + $plugins = $collection->find(array('installed' => true)); foreach ($plugins as $plugin) { diff --git a/src/new/src/PSC/System/PluginBundle/Compiler/PluginCompiler.php b/src/new/src/PSC/System/PluginBundle/Compiler/PluginCompiler.php index 14d55f7b0..287317f81 100755 --- a/src/new/src/PSC/System/PluginBundle/Compiler/PluginCompiler.php +++ b/src/new/src/PSC/System/PluginBundle/Compiler/PluginCompiler.php @@ -18,13 +18,18 @@ class PluginCompiler implements CompilerPassInterface public function process(ContainerBuilder $container) { try { - $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + if ($_ENV['APP_ENV'] == 'test') { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin; + } else { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + } + $plugins = $collection->find(array('installed' => true)); /** - * @var Plugin $plugin + * @var Plugin $plugin */ foreach ($plugins as $plugin) { - $container->get('doctrine_mongodb.odm.default_metadata_driver')->addDriver(new AnnotationDriver(new AnnotationReader(), $container->getParameter('kernel.project_dir') . '/var/plugins/' . $plugin['path'] . '/Document'), $plugin['path']); + $container->get('doctrine_mongodb.odm.default_metadata_driver')->addDriver(new AnnotationDriver(new AnnotationReader(), $container->getParameter('kernel.project_dir') . '/var/plugins/' . $plugin['path'] . '/Document'), $plugin['path']); } } catch (\Exception $e) { var_dump($e->getMessage()); diff --git a/src/new/src/PSC/System/PluginBundle/DependencyInjection/PSCSystemPluginExtension.php b/src/new/src/PSC/System/PluginBundle/DependencyInjection/PSCSystemPluginExtension.php index a5c3993da..fd0e557d1 100755 --- a/src/new/src/PSC/System/PluginBundle/DependencyInjection/PSCSystemPluginExtension.php +++ b/src/new/src/PSC/System/PluginBundle/DependencyInjection/PSCSystemPluginExtension.php @@ -47,7 +47,12 @@ class PSCSystemPluginExtension extends Extension implements PrependExtensionInte $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('services.yml'); try { - $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + if ($_ENV['APP_ENV'] == 'test') { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin; + } else { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + } + $plugins = $collection->find(array('installed' => true)); foreach ($plugins as $plugin) { if (file_exists($container->getParameter('kernel.project_dir') . '/var/plugins/' . $plugin['path'] . '/Resources/config/services.yml')) { diff --git a/src/new/src/PSC/System/PluginBundle/EventListener/RequestListener.php b/src/new/src/PSC/System/PluginBundle/EventListener/RequestListener.php index b83b3f2b1..d7dee35ef 100755 --- a/src/new/src/PSC/System/PluginBundle/EventListener/RequestListener.php +++ b/src/new/src/PSC/System/PluginBundle/EventListener/RequestListener.php @@ -25,7 +25,12 @@ class RequestListener public function onKernelRequest(RequestEvent $event) { try { - $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + if ($_ENV['APP_ENV'] == 'test') { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin; + } else { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + } + } catch (\Exception $e) { return; } diff --git a/src/new/src/PSC/System/PluginBundle/Routing/PluginRouteLoader.php b/src/new/src/PSC/System/PluginBundle/Routing/PluginRouteLoader.php index e66a32963..37c23f9a5 100755 --- a/src/new/src/PSC/System/PluginBundle/Routing/PluginRouteLoader.php +++ b/src/new/src/PSC/System/PluginBundle/Routing/PluginRouteLoader.php @@ -15,10 +15,10 @@ use Symfony\Component\Yaml\Yaml; class PluginRouteLoader extends Loader { protected $rootDir; -/** - * DynamicRouteLoader constructor. - * - */ + /** + * DynamicRouteLoader constructor. + * + */ public function __construct($rootDir) { $this->rootDir = $rootDir; @@ -37,9 +37,14 @@ class PluginRouteLoader extends Loader { $routes = new RouteCollection(); try { - $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + if ($_ENV['APP_ENV'] == 'test') { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc_test->Plugin; + } else { + $collection = (new \MongoDB\Client('mongodb://mongodb/'))->psc->Plugin; + } + $plugins = $collection->find(array('installed' => true)); - /** @var Plugin $plugin */ + /** @var Plugin $plugin */ foreach ($plugins as $plugin) { if (file_exists($this->rootDir . '/var/plugins/' . $plugin['path'] . '/Resources/config/routing.yml')) { $importedRoutes = $this->import($this->rootDir . '/var/plugins/' . $plugin['path'] . '/Resources/config/routing.yml', 'yaml'); diff --git a/src/new/tests/RefreshDatabaseTrait.php b/src/new/tests/RefreshDatabaseTrait.php index b4b68f470..116bb6c9f 100755 --- a/src/new/tests/RefreshDatabaseTrait.php +++ b/src/new/tests/RefreshDatabaseTrait.php @@ -157,8 +157,6 @@ trait RefreshDatabaseTrait $doc->clear(); } - - return $kernel; } diff --git a/src/old/application/modules/default/controllers/PreflightController.php b/src/old/application/modules/default/controllers/PreflightController.php index 45f74f914..fdbe0f338 100755 --- a/src/old/application/modules/default/controllers/PreflightController.php +++ b/src/old/application/modules/default/controllers/PreflightController.php @@ -35,7 +35,6 @@ */ class PreflightController extends TP_Controller_Action { - protected $_extAllow = 'ppt,inx,idml,indd,qxd,ps,cdr,cdx,jpg,gif,pdf,xls,docx,png,doc,jpeg,tif,tiff,ai,eps,psd,phtml,zip,jrxml,ttf,otf,plt,csv,docx,xlsx,pptx,svg'; protected function FileSize($file, $setup = null) @@ -47,8 +46,7 @@ class PreflightController extends TP_Controller_Action return number_format($FZ / pow(1024, $I = floor(log($FZ, 1024))), ($i >= 1) ? 2 : 0) . ' ' . $FS[$I]; } elseif ($setup == 'INT') { return number_format($FZ); - } - else { + } else { return number_format($FZ / pow(1024, $setup), ($setup >= 1) ? 2 : 0) . ' ' . $FS[$setup]; } } @@ -142,10 +140,10 @@ class PreflightController extends TP_Controller_Action $xml = file_get_contents(APPLICATION_PATH . '/articles/' . $this->frontend, null); } - if($article->typ == 100) { + if ($article->typ == 100) { $xml = $article->getPluginSettings('saxoprint', 'uploadXML'); } - if($article->typ == 101) { + if ($article->typ == 101) { $xml = $article->getPluginSettings('wmd', 'uploadXML'); } @@ -162,7 +160,7 @@ class PreflightController extends TP_Controller_Action $checksMessages = array(); foreach ($xml as $article) { - if((string)$article->name != $this->_getParam('kalk_artikel') || !$this->_getParam('kalk_artikel', false)) { + if ((string)$article->name != $this->_getParam('kalk_artikel') || !$this->_getParam('kalk_artikel', false)) { continue; } foreach ($article->uploads->children() as $upload) { @@ -193,7 +191,7 @@ class PreflightController extends TP_Controller_Action } } - if ($isPdf && ((int)$check->check_site_count > 0 || $check->check_site_count_rel != "")) { + if (false && $isPdf && ((int)$check->check_site_count > 0 || $check->check_site_count_rel != "")) { try { $p = new pdflib(); @@ -221,10 +219,10 @@ class PreflightController extends TP_Controller_Action } elseif (strpos($check->check_site_count_rel, '+')) { $sum = explode("+", $check->check_site_count_rel); $seitenCount = 0; - foreach($sum as $sumKey) { + foreach ($sum as $sumKey) { $seitenCount += $this->_getParam($sumKey); } - if($seitenCount != $anzahlSeiten) { + if ($seitenCount != $anzahlSeiten) { $checksMessages[] = array( 'message' => str_replace("{value}", $seitenCount, $check->check_site_count_error_message), 'nr' => $check->nr @@ -234,14 +232,14 @@ class PreflightController extends TP_Controller_Action } elseif (strpos($check->check_site_count_rel, '*')) { $sum = explode("*", $check->check_site_count_rel); $seitenCount = 0; - foreach($sum as $sumKey) { - if($seitenCount == 0) { + foreach ($sum as $sumKey) { + if ($seitenCount == 0) { $seitenCount = $this->_getParam($sumKey); - }else{ + } else { $seitenCount = $seitenCount * $this->_getParam($sumKey); } } - if($seitenCount != $anzahlSeiten) { + if ($seitenCount != $anzahlSeiten) { $checksMessages[] = array( 'message' => str_replace("{value}", $seitenCount, $check->check_site_count_error_message), 'nr' => $check->nr @@ -372,7 +370,7 @@ class PreflightController extends TP_Controller_Action $boxes[] = "ArtBox"; } - if ($isPdf && $check->check_fonts_embedded) { + if (false && $isPdf && $check->check_fonts_embedded) { $p = new pdflib(); $indoc = $p->open_pdi_document($file, ""); @@ -380,7 +378,7 @@ class PreflightController extends TP_Controller_Action for ($i = 0; $i < $fontcount; $i++) { - if($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) { + if ($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) { $checksMessages[] = array( 'message' => $check->check_fonts_embedded_error_message, 'nr' => $check->nr @@ -391,7 +389,7 @@ class PreflightController extends TP_Controller_Action } } - if ($isPdf && count($boxes) > 0 && count($checks) > 0) { + if (false && $isPdf && count($boxes) > 0 && count($checks) > 0) { $isFormat = false; @@ -404,10 +402,10 @@ class PreflightController extends TP_Controller_Action foreach ($checks as $ck) { - if (!$isFormat - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) >= $ck['width_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) <= $ck['width_to'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/height")) >= $ck['height_from'] + if (!$isFormat + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) >= $ck['width_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) <= $ck['width_to'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/height")) >= $ck['height_from'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/height")) <= $ck['height_to'] ) { @@ -416,14 +414,14 @@ class PreflightController extends TP_Controller_Action foreach ($boxes as $key => $box) { try { - if (!$isFormat && ((round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) >= $ck['width_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to']) - || (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to'])) + if (!$isFormat && ((round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) >= $ck['width_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to']) + || (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to'])) ) { $isFormat = true; @@ -529,7 +527,7 @@ class PreflightController extends TP_Controller_Action } } - if ($isPdf && ((int)$check->check_site_count || $check->check_site_count_rel)) { + if (false && $isPdf && ((int)$check->check_site_count || $check->check_site_count_rel)) { $p = new pdflib(); $indoc = $p->open_pdi_document($file, ""); @@ -673,7 +671,7 @@ class PreflightController extends TP_Controller_Action $boxes[] = "ArtBox"; } - if ($isPdf && $check->check_fonts_embedded) { + if (false && $isPdf && $check->check_fonts_embedded) { $p = new pdflib(); $indoc = $p->open_pdi_document($file, ""); @@ -681,7 +679,7 @@ class PreflightController extends TP_Controller_Action for ($i = 0; $i < $fontcount; $i++) { - if($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) { + if ($p->pcos_get_number($indoc, "fonts[" . $i . "]/embedded") == 0) { $checksMessages[] = array( 'message' => $check->check_fonts_embedded_error_message, 'nr' => $check->nr @@ -692,7 +690,7 @@ class PreflightController extends TP_Controller_Action } } - if ($isPdf && count($boxes) > 0 && count($checks) > 0) { + if (false && $isPdf && count($boxes) > 0 && count($checks) > 0) { $isFormat = false; @@ -705,10 +703,10 @@ class PreflightController extends TP_Controller_Action foreach ($checks as $ck) { - if (!$isFormat - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) >= $ck['width_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) <= $ck['width_to'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/height")) >= $ck['height_from'] + if (!$isFormat + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) >= $ck['width_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/width")) <= $ck['width_to'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/height")) >= $ck['height_from'] && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/height")) <= $ck['height_to'] ) { @@ -717,14 +715,14 @@ class PreflightController extends TP_Controller_Action foreach ($boxes as $key => $box) { try { - if (!$isFormat && (( round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) >= $ck['width_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to']) - || (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from'] - && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")-$p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to'])) + if (!$isFormat && ((round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) >= $ck['width_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]")) <= $ck['width_to'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) >= $ck['height_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]")) <= $ck['height_to']) + || (round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) >= $ck['width_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[2]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[0]")) <= $ck['width_to'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) >= $ck['height_from'] + && round($p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[3]") - $p->pcos_get_number($indoc, "pages[" . 0 . "]/" . $box . "[1]")) <= $ck['height_to'])) ) { $isFormat = true; @@ -1009,10 +1007,10 @@ class PreflightController extends TP_Controller_Action - if($article->typ == 100) { + if ($article->typ == 100) { $xml = $article->getPluginSettings('saxoprint', 'uploadXML'); } - if($article->typ == 101) { + if ($article->typ == 101) { $xml = $article->getPluginSettings('wmd', 'uploadXML'); } @@ -1021,25 +1019,25 @@ class PreflightController extends TP_Controller_Action $uploads = array(); $params = $this->_getAllParams(); - if($config = $article->getPluginSettings('uploads', 'config')) { + if ($config = $article->getPluginSettings('uploads', 'config')) { $config = json_decode($config, true); - if(is_array($config['uploads'])) { + if (is_array($config['uploads'])) { foreach ($config['uploads'] as $upload) { $up[] = array( 'id' => (string)$upload['id'], 'name' => (string)$upload['name'], - 'description' => (string)$upload['description']??'' + 'description' => (string)$upload['description'] ?? '' ); - if($this->_getParam('which', false)) { + if ($this->_getParam('which', false)) { $uploads[$this->_getParam('which', 'false')] = $up; - }else{ + } else { $uploads['Kalk'] = $up; } } } } - if(empty($uploads)) { + if (empty($uploads)) { foreach ($xml as $article) { $up = array(); foreach ($article->uploads->children() as $upload) { @@ -1057,13 +1055,13 @@ class PreflightController extends TP_Controller_Action } } - + $this->view->clearVars(); - if($this->_getParam('which', false)) { + if ($this->_getParam('which', false)) { $this->view->uploads = $uploads[$this->_getParam('which')]; - }elseif(count($uploads) > 0) { + } elseif (count($uploads) > 0) { $this->view->uploads = array_shift($uploads); - }else{ + } else { $this->view->uploads = []; } $this->view->success = true;