Added some more variables to style editor
authorAlexander Ebert <ebert@woltlab.com>
Thu, 25 Oct 2012 16:01:51 +0000 (18:01 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 25 Oct 2012 16:01:51 +0000 (18:01 +0200)
acptemplates/styleAdd.tpl
files/lib/acp/form/StyleAddForm.class.php
language/de.xml

index d99b2f0d711b68ad0b1d2b00bc5855a8521a7159..5e198c08c6d4bbdae73d01e0c4c407a2bb6e0ab8 100644 (file)
@@ -69,6 +69,7 @@
                                <li><a href="#general">{lang}wcf.acp.style.general{/lang}</a></li>
                                <li><a href="#globals">{lang}wcf.acp.style.globals{/lang}</a></li>
                                <li><a href="#colors">{lang}wcf.acp.style.colors{/lang}</a></li>
+                               <li><a href="#advanced">{lang}wcf.acp.style.advanced{/lang}</a></li>
                        </ul>
                </nav>
                
                                
                                <dl>
                                        <dd><label>
-                                               <input type="checkbox" id="useFluidLayout" name="useFluidLayout" value="1"{if $useFluidLayout} checked="checked"{/if} />
+                                               <input type="checkbox" id="useFluidLayout" name="useFluidLayout" value="1"{if $variables[useFluidLayout]} checked="checked"{/if} />
                                                <span>{lang}wcf.acp.style.globals.useFluidLayout{/lang}</span>
                                        </label></dd>
                                </dl>
                                                </dd>
                                        </dl>
                                </div>
+                               <dl>
+                                       <dt><label for="pageLogo">{lang}wcf.acp.style.globals.pageLogo{/lang}</label></dt>
+                                       <dd>
+                                               <input type="text" name="pageLogo" id="pageLogo" value="{$variables[pageLogo]}" class="long" />
+                                               <small>{lang}wcf.acp.style.globals.pageLogo.description{/lang}</small>
+                                       </dd>
+                               </dl>
                        </fieldset>
                        
                        {* font *}
                
                {* colors *}
                <div id="colors" class="container containerPadding tabMenuContainer tabMenuContent">
+                       <fieldset>
+                               <legend>{lang}wcf.acp.style.colors.page{/lang}</legend>
+                               
+                               {* page *}
+                               <ul class="colorList">
+                                       <li>{include file='styleVariableColor' variableName='wcfPageBackgroundColor' languageVariable='backgroundColor'}</li>
+                                       <li>{include file='styleVariableColor' variableName='wcfPageColor' languageVariable='color'}</li>
+                                       <li>{include file='styleVariableColor' variableName='wcfPageLinkColor' languageVariable='linkColor'}</li>
+                                       <li>{include file='styleVariableColor' variableName='wcfPageLinkHoverColor' languageVariable='linkHoverColor'}</li>
+                               </ul>
+                       </fieldset>
+                       
                        <fieldset>
                                <legend>{lang}wcf.acp.style.colors.content{/lang}</legend>
                                
                                </ul>
                        </fieldset>
                </div>
+               
+               {* advanced *}
+               <div id="advanced" class="container containerPadding tabMenuContainer tabMenuContent">
+                       <p class="info">{lang}wcf.acp.style.advanced.syntax{/lang}</p>
+                       
+                       <fieldset class="marginTop">
+                               <legend>{lang}wcf.acp.style.advanced.individualLess{/lang}</legend>
+                               
+                               <textarea rows="20" cols="40" name="individualLess">{$variables[individualLess]}</textarea>
+                               <small>{lang}wcf.acp.style.advanced.individualLess.description{/lang}</small>
+                       </fieldset>
+                       
+                       <fieldset>
+                               <legend>{lang}wcf.acp.style.advanced.overrideLess{/lang}</legend>
+                               
+                               <p class="warning">{lang}wcf.acp.style.advanced.overrideLess.warning{/lang}</p>
+                               
+                               <textarea rows="20" cols="40" name="overrideLess" class="marginTop">{$variables[overrideLess]}</textarea>
+                               <small>{lang}wcf.acp.style.advanced.overrideLess.description{/lang}</small>
+                       </fieldset>
+               </div>
        </div>
        
        <div class="formSubmit">
index 2de0593999dfa53e7cb649d7cd1090ffd6e5b084..d7edea55ae70c15c48a0088ee86de03014966ba5 100644 (file)
@@ -157,16 +157,16 @@ class StyleAddForm extends ACPForm {
        public $tmpHash = '';
        
        /**
-        * fluid or fixed layout
-        * @var boolean
+        * list of variables and their value
+        * @var array<string>
         */
-       public $useFluidLayout = true;
+       public $variables = array();
        
        /**
-        * list of variables and their value
+        * list of specialized variables
         * @var array<string>
         */
-       public $variables = array();
+       public $specialVariables = array();
        
        /**
         * @see wcf\page\IPage::readParameters()
@@ -214,7 +214,11 @@ class StyleAddForm extends ACPForm {
                        }
                }
                
-               $this->useFluidLayout = (isset($_POST['useFluidLayout']));
+               // read specialized variables
+               foreach ($this->specialVariables as $variableName) {
+                       if (isset($_POST[$variableName])) $this->variables[$variableName] = StringUtil::trim($_POST[$variableName]);
+               }
+               $this->variables['useFluidLayout'] = (isset($_POST['useFluidLayout'])) ? 1 : 0;
                
                // style data
                if (isset($_POST['authorName'])) $this->authorName = StringUtil::trim($_POST['authorName']);
@@ -346,6 +350,10 @@ class StyleAddForm extends ACPForm {
                        'wcfInputHoverBorderColor',
                        'wcfLinkColor',
                        'wcfLinkHoverColor',
+                       'wcfPageBackgroundColor',
+                       'wcfPageColor',
+                       'wcfPageLinkColor',
+                       'wcfPageLinkHoverColor',
                        'wcfTabularBoxBackgroundColor',
                        'wcfTabularBoxColor',
                        'wcfTabularBoxHoverColor',
@@ -363,6 +371,14 @@ class StyleAddForm extends ACPForm {
                        'wcfLayoutFluidGap'
                );
                
+               // set specialized variables
+               $this->specialVariables = array(
+                       'individualLess',
+                       'overrideLess',
+                       'pageLogo',
+                       'useFluidLayout'
+               );
+               
                EventHandler::getInstance()->fireAction($this, 'setVariables');
        }
        
@@ -415,7 +431,6 @@ class StyleAddForm extends ACPForm {
                $this->iconPath = 'icon/';
                $this->imagePath = 'images/';
                $this->templateGroupID = 0;
-               $this->useFluidLayout = true;
                
                // reload variables
                $this->readStyleVariables();
@@ -447,7 +462,6 @@ class StyleAddForm extends ACPForm {
                        'styleVersion' => $this->styleVersion,
                        'templateGroupID' => $this->templateGroupID,
                        'tmpHash' => $this->tmpHash,
-                       'useFluidLayout' => $this->useFluidLayout,
                        'variables' => $this->variables
                ));
        }
index 241677b3be6285590b1cde067ea77404cf98115e..81089b273817001062331e5c025ce8dcc520d4ee 100644 (file)
@@ -8,6 +8,13 @@
        
        <category name="wcf.acp.style">
                <item name="wcf.acp.style.add"><![CDATA[Stil hinzufügen]]></item>
+               <item name="wcf.acp.style.advanced"><![CDATA[Erweiterte Einstellungen]]></item>
+               <item name="wcf.acp.style.advanced.individualLess"><![CDATA[Individuelles CSS und LESS]]></item>
+               <item name="wcf.acp.style.advanced.individualLess.description"><![CDATA[Die Eingabe wird am Ende des Stils eingefügt und kann vollständig aus CSS bestehen. Sie haben zusätzlich den Zugriff auf LESS und alle von Community Framework zur Verfügung gestellten Mixins.]]></item>
+               <item name="wcf.acp.style.advanced.overrideLess"><![CDATA[Überschreiben von LESS-Variablen]]></item>
+               <item name="wcf.acp.style.advanced.overrideLess.description"><![CDATA[Sie können innerhalb dieser Eingabe beliebige LESS-Variablen überschreiben, die nicht durch den Stil-Editor direkt bearbeitbar ist. Beim Bezug auf andere Variablen muss sichergestellt werden, dass diese in der Reihenfolge vorher definiert wurden. Die Syntax muss wie folgt lauten: &bdquo;@variableName: variableValue;&ldquo;]]></item>
+               <item name="wcf.acp.style.advanced.overrideLess.warning"><![CDATA[Fehlerhafte Eingaben führen dazu, dass der Stil nicht erzeugt werden kann. Überschreiben Sie LESS-Variablen nur, wenn Sie sich den Auswirkungen bewusst sind und eine Änderung anderweitig nicht möglich ist.]]></item>
+               <item name="wcf.acp.style.advanced.syntax"><![CDATA[Sie können sowohl CSS als auch <a href="{@$__wcf->getPath()}acp/dereferrer.php?url=http://www.lesscss.org">LESS</a> verwenden. Bitte beachten Sie, dass der Stil nicht erzeugt werden kann, wenn der LESS-Code ungültig ist.]]></item>
                <item name="wcf.acp.style.authorName"><![CDATA[Autor]]></item>
                <item name="wcf.acp.style.authorURL"><![CDATA[Website]]></item>
                <item name="wcf.acp.style.button.exportStyle"><![CDATA[Export starten]]></item>
                <item name="wcf.acp.style.colors.container"><![CDATA[Container]]></item>
                <item name="wcf.acp.style.colors.content"><![CDATA[Inhaltsbereich]]></item>
                <item name="wcf.acp.style.colors.color"><![CDATA[Schriftfarbe]]></item>
-               <item name="wcf.acp.style.colors.dimmedColor"><![CDATA[Schriftfarbe (abgedunkelt)]]></item>
+               <item name="wcf.acp.style.colors.dimmedColor"><![CDATA[Schriftfarbe (abgeschwächt)]]></item>
                <item name="wcf.acp.style.colors.formInput"><![CDATA[Eingabeelemente in Formularen]]></item>
                <item name="wcf.acp.style.colors.hoverBackgroundColor"><![CDATA[Hintergrundfarbe (Hover)]]></item>
                <item name="wcf.acp.style.colors.hoverBorderColor"><![CDATA[Rahmenfarbe (Hover)]]></item>
                <item name="wcf.acp.style.colors.hoverColor"><![CDATA[Schriftfarbe (Hover)]]></item>
                <item name="wcf.acp.style.colors.linkColor"><![CDATA[Linkfarbe]]></item>
                <item name="wcf.acp.style.colors.linkHoverColor"><![CDATA[Linkfarbe (Hover)]]></item>
+               <item name="wcf.acp.style.colors.page"><![CDATA[Seite]]></item>
                <item name="wcf.acp.style.colors.primaryBackgroundColor"><![CDATA[Hintergrundfarbe (primär)]]></item>
                <item name="wcf.acp.style.colors.primaryBorderColor"><![CDATA[Rahmenfarbe (primär)]]></item>
                <item name="wcf.acp.style.colors.primaryColor"><![CDATA[Schriftfarbe (primär)]]></item>