Revert some auto formatting
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 26 Jan 2024 15:45:19 +0000 (16:45 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 26 Jan 2024 15:45:19 +0000 (16:45 +0100)
com.woltlab.wcf/templates/shared_colorFormField.tpl
com.woltlab.wcf/templates/shared_wysiwyg.tpl
wcfsetup/install/files/acp/templates/articleAdd.tpl
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/template/SetupTemplateEngine.class.php
wcfsetup/install/files/lib/system/template/TemplateEngine.class.php

index 962b8b58708e8efa7073030d5091026bcb2330c8..e5918a75c2abd30596378557681756c81153b734 100644 (file)
@@ -1,21 +1,21 @@
 {if $field->isImmutable()}
-    <span class="colorPickerButton">
-        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
-    </span>
+       <span class="colorPickerButton">
+               <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
+       </span>
 {else}
-    <a href="#" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
-        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
-    </a>
-    <input type="hidden" {*
+       <a href="#" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
+               <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
+       </a>
+       <input type="hidden" {*
         *}id="{$field->getPrefixedId()}" {*
         *}name="{$field->getPrefixedId()}" {*
         *}value="{$field->getValue()}"{*
     *}>
        {include file='shared_colorPickerJavaScript'}
 
-    <script data-relocate="true">
-        require(['WoltLabSuite/Core/Ui/Color/Picker'], (UiColorPicker) => {
-            UiColorPicker.fromSelector("#{@$field->getPrefixedId()|encodeJS}_colorPickerButton");
-        });
-    </script>
+       <script data-relocate="true">
+               require(['WoltLabSuite/Core/Ui/Color/Picker'], (UiColorPicker) => {
+                       UiColorPicker.fromSelector("#{@$field->getPrefixedId()|encodeJS}_colorPickerButton");
+               });
+       </script>
 {/if}
index 5bda1bb1372919fcd6b0a20a97a9d37cb0a2d4b6..5300ed5691aafb1ad24f58e2e03818e950222776 100644 (file)
@@ -3,55 +3,55 @@
 {event name='wysiwyg'}
 
 <script data-eager="true">
-  {
-    let stylesheet = document.getElementById("ckeditor5-stylesheet");
-    if (stylesheet === null) {
-      stylesheet = document.createElement("link");
-      stylesheet.rel = "stylesheet";
-      stylesheet.type = "text/css";
-      stylesheet.href = "{$__wcf->getPath()}style/ckeditor5.css";
-      stylesheet.id = "ckeditor5-stylesheet";
+{
+  let stylesheet = document.getElementById("ckeditor5-stylesheet");
+  if (stylesheet === null) {
+    stylesheet = document.createElement("link");
+    stylesheet.rel = "stylesheet";
+    stylesheet.type = "text/css";
+    stylesheet.href = "{$__wcf->getPath()}style/ckeditor5.css";
+    stylesheet.id = "ckeditor5-stylesheet";
 
-      document.querySelector("link[rel=\"stylesheet\"]").before(stylesheet);
-    }
+    document.querySelector('link[rel="stylesheet"]').before(stylesheet);
   }
+}
 </script>
 <script data-relocate="true">
   require([
     "WoltLabSuite/Core/Component/Ckeditor",
     "WoltLabSuite/Core/prism-meta",
-         {@$__wcf->getBBCodeHandler()->getEditorLocalization()}
+    {@$__wcf->getBBCodeHandler()->getEditorLocalization()}
   ], (
     { setupCkeditor },
-    PrismMeta,
+    PrismMeta
   ) => {
-         {jsphrase name='wcf.ckeditor.code.fileName'}
-         {jsphrase name='wcf.ckeditor.code.lineNumber'}
-         {jsphrase name='wcf.ckeditor.marker.error'}
-         {jsphrase name='wcf.ckeditor.marker.info'}
-         {jsphrase name='wcf.ckeditor.marker.success'}
-         {jsphrase name='wcf.ckeditor.marker.warning'}
-         {jsphrase name='wcf.ckeditor.quote'}
-         {jsphrase name='wcf.ckeditor.quote.author'}
-         {jsphrase name='wcf.ckeditor.quoteFrom'}
-         {jsphrase name='wcf.editor.button.group.format'}
-         {jsphrase name='wcf.editor.button.group.list'}
-         {jsphrase name='wcf.editor.button.spoiler'}
-         {jsphrase name='wcf.editor.restoreDraft'}
-         {jsphrase name='wcf.editor.restoreDraft.preview'}
-         {jsphrase name='wcf.editor.restoreDraft.restoreOrDiscard'}
+    {jsphrase name='wcf.ckeditor.code.fileName'}
+    {jsphrase name='wcf.ckeditor.code.lineNumber'}
+    {jsphrase name='wcf.ckeditor.marker.error'}
+    {jsphrase name='wcf.ckeditor.marker.info'}
+    {jsphrase name='wcf.ckeditor.marker.success'}
+    {jsphrase name='wcf.ckeditor.marker.warning'}
+    {jsphrase name='wcf.ckeditor.quote'}
+    {jsphrase name='wcf.ckeditor.quote.author'}
+    {jsphrase name='wcf.ckeditor.quoteFrom'}
+    {jsphrase name='wcf.editor.button.group.format'}
+    {jsphrase name='wcf.editor.button.group.list'}
+    {jsphrase name='wcf.editor.button.spoiler'}
+    {jsphrase name='wcf.editor.restoreDraft'}
+    {jsphrase name='wcf.editor.restoreDraft.preview'}
+    {jsphrase name='wcf.editor.restoreDraft.restoreOrDiscard'}
 
-         {include file='mediaJavaScript'}
+    {include file='mediaJavaScript'}
 
     const element = document.getElementById('{$wysiwygSelector|encodeJS}');
     if (element === null) {
-      throw new Error("Unable to find the source element '{$wysiwygSelector|encodeJS}' for the editor.");
+      throw new Error("Unable to find the source element '{$wysiwygSelector|encodeJS}' for the editor.")
     }
 
     let enableAttachments = element.dataset.disableAttachments !== "true";
-         {if !$attachmentHandler|empty && !$attachmentHandler->canUpload()}
+    {if !$attachmentHandler|empty && !$attachmentHandler->canUpload()}
     enableAttachments = false;
-         {/if}
+    {/if}
 
     const features = {
       alignment: true,
     };
 
     const bbcodes = [
-               {foreach from=$__wcf->getBBCodeHandler()->getButtonBBCodes(true) item=__bbcode}
-      {
-        icon: '{@$__bbcode->getIcon()|encodeJS}',
-        name: '{@$__bbcode->bbcodeTag|encodeJS}',
-        label: '{@$__bbcode->getButtonLabel()|encodeJS}',
-      },
-               {/foreach}
+      {foreach from=$__wcf->getBBCodeHandler()->getButtonBBCodes(true) item=__bbcode}
+        {
+          icon: '{@$__bbcode->getIcon()|encodeJS}',
+          name: '{@$__bbcode->bbcodeTag|encodeJS}',
+          label: '{@$__bbcode->getButtonLabel()|encodeJS}',
+        },
+      {/foreach}
     ];
     if (features.media) {
       bbcodes.push({
     const codeBlockLanguages = [
       { language: "", label: '{jslang}wcf.editor.code.highlighter.detect{/jslang}' },
       { language: "plain", label: '{jslang}wcf.editor.code.highlighter.plain{/jslang}' },
-               {foreach from=$__wcf->getBBCodeHandler()->getCodeBlockLanguages() item=__codeBlockLanguage}
-      {
-        language: '{@$__codeBlockLanguage|encodeJS}',
-        label: PrismMeta.default['{@$__codeBlockLanguage|encodeJS}'].title,
-      },
-               {/foreach}
+      {foreach from=$__wcf->getBBCodeHandler()->getCodeBlockLanguages() item=__codeBlockLanguage}
+        { language: '{@$__codeBlockLanguage|encodeJS}', label: PrismMeta.default['{@$__codeBlockLanguage|encodeJS}'].title },
+      {/foreach}
     ];
 
     void setupCkeditor(element, features, bbcodes, codeBlockLanguages, '{@$__wcf->getBBCodeHandler()->getCkeditorLicenseKey()|encodeJS}');
   });
-</script>
+</script>
\ No newline at end of file
index 4bdd137ed9773d329a292be1be3cbc35efa2a8af..fdf5db4562bff8fd5649a6fc2b30bf9b7f61c01b 100644 (file)
                                                        <dd>
                                                                <textarea name="content[{@$availableLanguage->languageID}]" id="content{@$availableLanguage->languageID}" class="wysiwygTextarea" data-autosave="com.woltlab.wcf.article{$action|ucfirst}-{if $action == 'edit'}{@$articleID}{else}0{/if}-{@$availableLanguage->languageID}">{if !$content[$availableLanguage->languageID]|empty}{$content[$availableLanguage->languageID]}{/if}</textarea>
                                                                
-                                                               {include file='shared_wysiwygCmsToolbar' wysiwygSelector='content'|concat:$availableLanguage->languageID}
-                                                               {include file='shared_wysiwyg' wysiwygSelector='content'|concat:$availableLanguage->languageID}
+                                                               {include file='__wysiwygCmsToolbar' wysiwygSelector='content'|concat:$availableLanguage->languageID}
+                                                               {include file='wysiwyg' wysiwygSelector='content'|concat:$availableLanguage->languageID}
                                                                
                                                                {if $errorField == 'content'|concat:$availableLanguage->languageID}
                                                                        <small class="innerError">
index 8da47de1b67494c629fd09ca633f88c41eaf3dcd..db88ffb24cd31c90b84745abda0853e0275576dd 100644 (file)
@@ -741,6 +741,7 @@ class WCF
         if (ENABLE_ENTERPRISE_MODE) {
             $wcf = new TemplateScriptingCore($wcf);
         }
+
         self::getTPL()->registerPrefilter(['event', 'hascontent', 'lang', 'jsphrase', 'jslang', 'csrfToken', 'icon']);
         self::getTPL()->assign([
             '__wcf' => $wcf,
@@ -804,7 +805,6 @@ class WCF
         if (self::$tplObj !== null) {
             self::getTPL()->setLanguageID(self::getLanguage()->languageID);
             EmailTemplateEngine::getInstance()->setLanguageID(self::getLanguage()->languageID);
-            WCF::getTPL()->setLanguageID(self::getLanguage()->languageID);
         }
     }
 
index 141d43ceceb2ea236523ba7550a7d66b80a810e1..354fb9abbc374d7ac4503f607fe98165087d4d79 100644 (file)
@@ -8,7 +8,6 @@ namespace wcf\system\template;
  * @author  Alexander Ebert
  * @copyright   2001-2019 WoltLab GmbH
  * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @since 6.1
  */
 class SetupTemplateEngine extends TemplateEngine
 {
index f24695be81c052bd92ab496d5d0f7ace7768833b..ef96e3409add60dccfdee5e8eb29d26941d6157d 100755 (executable)
@@ -126,7 +126,7 @@ class TemplateEngine extends SingletonFactory
 
     protected $tagStack = [];
 
-    private int $sharedTemplateGroupID = 0;
+    private int $sharedTemplateGroupID;
 
     /**
      * @inheritDoc
@@ -137,14 +137,6 @@ class TemplateEngine extends SingletonFactory
         $this->pluginNamespace = 'wcf\system\template\plugin\\';
         $this->compileDir = WCF_DIR . 'templates/compiled/';
 
-        $sql = "SELECT  templateGroupID
-                FROM    wcf" . WCF_N . "_template_group
-                WHERE   templateGroupFolderName = ?";
-        $statement = WCF::getDB()->prepareStatement($sql);
-        $statement->execute(['_wcf_shared/']);
-
-        $this->sharedTemplateGroupID = $statement->fetchSingleColumn();
-
         $this->loadTemplateGroupCache();
         $this->assignSystemVariables();
     }
@@ -915,9 +907,23 @@ class TemplateEngine extends SingletonFactory
     protected function getCompileDir(string $templateName): string
     {
         if ($this->isSharedTemplate($templateName)) {
-            return $this->compileDir . $this->sharedTemplateGroupID;
+            return $this->compileDir . $this->getSharedTemplateGroupID();
         } else {
             return $this->compileDir . $this->getTemplateGroupID();
         }
     }
+
+    private function getSharedTemplateGroupID(): int
+    {
+        if (!isset($this->sharedTemplateGroupID)) {
+            $sql = "SELECT  templateGroupID
+                FROM    wcf" . WCF_N . "_template_group
+                WHERE   templateGroupFolderName = ?";
+            $statement = WCF::getDB()->prepareStatement($sql);
+            $statement->execute(['_wcf_shared/']);
+
+            $this->sharedTemplateGroupID = $statement->fetchSingleColumn();
+        }
+        return $this->sharedTemplateGroupID;
+    }
 }