From 7dffaa21b03df208148a52a6ab6e56b39052582a Mon Sep 17 00:00:00 2001 From: Henning Leutz <leutz@pcsg.de> Date: Fri, 26 Apr 2024 07:48:33 +0200 Subject: [PATCH] style: code style --- src/QUI/FAQ/Controls/Accordion.php | 58 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/QUI/FAQ/Controls/Accordion.php b/src/QUI/FAQ/Controls/Accordion.php index 9177952..46fde3e 100644 --- a/src/QUI/FAQ/Controls/Accordion.php +++ b/src/QUI/FAQ/Controls/Accordion.php @@ -26,23 +26,23 @@ class Accordion extends QUI\Control { // default options $this->setAttributes([ - 'class' => 'quiqqer-faqAccordion', - 'order' => 'order_field', - 'stayOpen' => true, // if true make accordion items stay open when another item is opened - 'openFirst' => true, // the first entry is initially opened - 'listMaxWidth' => 0, // positive numbers only, 0 disabled this option. - 'max' => 10, // max entries - 'parentSite' => null, - 'siteType' => 'quiqqer/faq:types/entry', - 'showMoreButton' => false, - 'moreSite' => '', + 'class' => 'quiqqer-faqAccordion', + 'order' => 'order_field', + 'stayOpen' => true, // if true make accordion items stay open when another item is opened + 'openFirst' => true, // the first entry is initially opened + 'listMaxWidth' => 0, // positive numbers only, 0 disabled this option. + 'max' => 10, // max entries + 'parentSite' => null, + 'siteType' => 'quiqqer/faq:types/entry', + 'showMoreButton' => false, + 'moreSite' => '', 'useFaqStructuredData' => false ]); parent::__construct($attributes); $this->addCSSFile( - dirname(__FILE__).'/Accordion.css' + dirname(__FILE__) . '/Accordion.css' ); $this->setAttribute('cacheable', 0); @@ -57,7 +57,7 @@ class Accordion extends QUI\Control public function getBody(): string { $FAQParentSite = null; - $Engine = QUI::getTemplateManager()->getEngine(); + $Engine = QUI::getTemplateManager()->getEngine(); if ($this->getAttribute('parentSite')) { try { @@ -76,7 +76,7 @@ class Accordion extends QUI\Control $faqSites = $FAQParentSite->getChildren([ 'where' => [ 'active' => 1, - 'type' => $this->getAttribute('siteType'), + 'type' => $this->getAttribute('siteType'), ], 'limit' => $this->getAttribute('max'), 'order' => $this->getAttribute('order') @@ -84,12 +84,12 @@ class Accordion extends QUI\Control // show "more faq" link $showMoreButton = $this->getAttribute('showMoreButton'); - $MoreSite = $FAQParentSite; + $MoreSite = $FAQParentSite; if ($showMoreButton || $this->getAttribute('moreSite')) { if ($this->getAttribute('moreSite')) { try { - $MoreSite = \QUI\Projects\Site\Utils::getSiteByLink($this->getAttribute('moreSite')); + $MoreSite = \QUI\Projects\Site\Utils::getSiteByLink($this->getAttribute('moreSite')); $showMoreButton = true; } catch (QUI\Exception $Exception) { QUI\System\Log::addInfo($Exception->getMessage()); @@ -99,7 +99,7 @@ class Accordion extends QUI\Control $countFaqEntries = $FAQParentSite->getChildren([ 'where' => [ 'active' => 1, - 'type' => $this->getAttribute('siteType'), + 'type' => $this->getAttribute('siteType'), ], 'count' => 1 ]); @@ -113,21 +113,21 @@ class Accordion extends QUI\Control $entries = []; foreach ($faqSites as $FaqSite) { - $short = $FaqSite->getAttribute('short'); + $short = $FaqSite->getAttribute('short'); $content = $FaqSite->getAttribute('content'); if ($short) { - $short = '<div class="quiqqer-faqAccordion-item-content-pageShort text-muted">'.$short.'</div>'; + $short = '<div class="quiqqer-faqAccordion-item-content-pageShort text-muted">' . $short . '</div>'; } if ($content) { - $content = '<div class="quiqqer-faqAccordion-item-content-pageContent">'.$content.'</div>'; + $content = '<div class="quiqqer-faqAccordion-item-content-pageContent">' . $content . '</div>'; } - $entryContent = $short.$content; + $entryContent = $short . $content; $entry = [ - 'entryTitle' => $FaqSite->getAttribute('title'), + 'entryTitle' => $FaqSite->getAttribute('title'), 'entryContent' => $entryContent, ]; @@ -135,22 +135,22 @@ class Accordion extends QUI\Control } $Accordion = new QUI\Bricks\Controls\Accordion([ - 'stayOpen' => \boolval($this->getAttribute('stayOpen')), - 'openFirst' => $this->getAttribute('openFirst'), - 'listMaxWidth' => $this->getAttribute('listMaxWidth'), - 'entries' => $entries, + 'stayOpen' => \boolval($this->getAttribute('stayOpen')), + 'openFirst' => $this->getAttribute('openFirst'), + 'listMaxWidth' => $this->getAttribute('listMaxWidth'), + 'entries' => $entries, 'useFaqStructuredData' => $this->getAttribute('useFaqStructuredData'), ]); $this->addCSSFiles($Accordion->getCSSFiles()); $Engine->assign([ - 'this' => $this, - 'Accordion' => $Accordion, + 'this' => $this, + 'Accordion' => $Accordion, 'showMoreButton' => $showMoreButton, - 'MoreSite' => $MoreSite + 'MoreSite' => $MoreSite ]); - return $Engine->fetch(dirname(__FILE__).'/Accordion.html'); + return $Engine->fetch(dirname(__FILE__) . '/Accordion.html'); } } -- GitLab