From aa4c592bfd5703fcd89a1148d9a0211551d45aca Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 24 Jan 2020 12:51:24 +0100 Subject: [PATCH] Minor - format code --- .../Component/Editor/CkEditor/Toolbar/Survey.php | 4 ++-- .../Editor/CkEditor/Toolbar/SurveyQuestion.php | 11 +++++------ src/CoreBundle/Controller/ResourceController.php | 4 +--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Survey.php b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Survey.php index c3fb6bd78f..50cdb2c7ab 100644 --- a/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Survey.php +++ b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Survey.php @@ -69,7 +69,7 @@ class Survey extends Basic 'BGColor', api_get_configuration_value('translate_html') ? 'Language' : '', ], - [api_get_setting('allow_spellcheck') == 'true' ? 'Scayt' : ''], + ['true' == api_get_setting('allow_spellcheck') ? 'Scayt' : ''], ['Styles', 'Format', 'Font', 'FontSize'], ['PageBreak', 'ShowBlocks', 'Source'], ['Toolbarswitch'], @@ -117,7 +117,7 @@ class Survey extends Basic 'TextColor', 'BGColor', api_get_configuration_value('translate_html') ? 'Language' : '', - 'Source' + 'Source', ], ['Toolbarswitch'], ]; diff --git a/src/CoreBundle/Component/Editor/CkEditor/Toolbar/SurveyQuestion.php b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/SurveyQuestion.php index 4ab20d5f8f..c622f0fb1a 100644 --- a/src/CoreBundle/Component/Editor/CkEditor/Toolbar/SurveyQuestion.php +++ b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/SurveyQuestion.php @@ -16,7 +16,7 @@ class SurveyQuestion extends Basic */ public function getConfig() { - if (api_get_setting('more_buttons_maximized_mode') != 'true') { + if ('true' != api_get_setting('more_buttons_maximized_mode')) { $config['toolbar'] = $this->getNormalToolbar(); } else { $config['toolbar_minToolbar'] = $this->getMinimizedToolbar(); @@ -25,6 +25,7 @@ class SurveyQuestion extends Basic return $config; } + /** * Get the toolbar configuration when CKEditor is maximized. * @@ -68,10 +69,10 @@ class SurveyQuestion extends Basic 'BGColor', api_get_configuration_value('translate_html') ? 'Language' : '', ], - [api_get_setting('allow_spellcheck') == 'true' ? 'Scayt' : ''], + ['true' == api_get_setting('allow_spellcheck') ? 'Scayt' : ''], ['Styles', 'Format', 'Font', 'FontSize'], ['PageBreak', 'ShowBlocks'], - api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], + 'true' == api_get_setting('enabled_wiris') ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], ['Toolbarswitch', 'Source'], ]; } @@ -101,10 +102,8 @@ class SurveyQuestion extends Basic 'BGColor', api_get_configuration_value('translate_html') ? 'Language' : '', ], - api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], + 'true' == api_get_setting('enabled_wiris') ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], ['Toolbarswitch', 'Source'], ]; } - - } diff --git a/src/CoreBundle/Controller/ResourceController.php b/src/CoreBundle/Controller/ResourceController.php index eab10cce23..6df5ab163e 100644 --- a/src/CoreBundle/Controller/ResourceController.php +++ b/src/CoreBundle/Controller/ResourceController.php @@ -915,7 +915,7 @@ class ResourceController extends AbstractResourceController implements CourseCon $disposition = $response->headers->makeDisposition( ResponseHeaderBag::DISPOSITION_ATTACHMENT, - Transliterator::transliterate($zipName) + $zipName //Transliterator::transliterate($zipName) ); $response->headers->set('Content-Disposition', $disposition); $response->headers->set('Content-Type', 'application/octet-stream'); @@ -1079,7 +1079,6 @@ class ResourceController extends AbstractResourceController implements CourseCon throw new NotFoundHttpException($this->trans('File not found for resource')); } - //$fileName = $resourceFile->getOriginalName(); $fileName = $resourceNode->getSlug(); $filePath = $resourceFile->getFile()->getPathname(); $mimeType = $resourceFile->getMimeType(); @@ -1117,7 +1116,6 @@ class ResourceController extends AbstractResourceController implements CourseCon $stream = $repo->getResourceNodeFileStream($resourceNode); - //$stream = $this->fs->readStream($resourceNode); $response = new StreamedResponse(function () use ($stream): void { stream_copy_to_stream($stream, fopen('php://output', 'wb')); });