Added enable/disable button for styles
authorAlexander Ebert <ebert@woltlab.com>
Fri, 12 Oct 2012 02:43:10 +0000 (04:43 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 12 Oct 2012 02:43:10 +0000 (04:43 +0200)
acptemplates/styleList.tpl
files/lib/acp/form/StyleAddForm.class.php

index c88b7fd578607201dbe5771e886ba19c548293e5..58a00ee640263929c8cbb78170f0914cd42d51f0 100644 (file)
@@ -4,6 +4,7 @@
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
+               new WCF.Action.Toggle('wcf\\data\\style\\StyleAction', $('.buttonList'));
                new WCF.ACP.Style.List();
        });
        //]]>
@@ -46,7 +47,8 @@
                                        <ul class="buttonList" data-style-id="{@$style->styleID}">
                                                <li><a href="{link controller='StyleEdit' id=$style->styleID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><img src="{@$__wcf->getPath()}icon/edit.svg" class="icon16" alt="" /></a></li>
                                                {if !$style->isDefault}
-                                                       {if !$style->disabled}<li><a title="{lang}wcf.acp.style.button.setAsDefault{/lang}" class="jsSetAsDefault jsTooltip"><img src="{@$__wcf->getPath()}icon/default.svg" class="icon16" alt="" /></a></li>{/if}
+                                                       <li><img src="{@$__wcf->getPath()}icon/{if $style->disabled}disabled{else}enabled{/if}.svg" title="{lang}wcf.global.button.{if $style->disabled}enable{else}disable{/if}{/lang}" alt="" class="icon16 jsToggleButton jsTooltip" data-object-id="{@$style->styleID}" /></li>
+                                                       <li><a title="{lang}wcf.acp.style.button.setAsDefault{/lang}" class="jsSetAsDefault jsTooltip"><img src="{@$__wcf->getPath()}icon/default.svg" class="icon16 jsTooltip" alt="" /></a></li>
                                                        <li><a title="{lang}wcf.global.button.delete{/lang}" class="jsDelete jsTooltip" data-confirm-message="{lang}wcf.acp.style.delete.confirmMessage{/lang}"><img src="{@$__wcf->getPath()}icon/delete.svg" class="icon16" alt="" /></a></li>
                                                {/if}
                                        </ul>
index 2e8dd98c460d7058d12b1545f8d021516771abe3..2de0593999dfa53e7cb649d7cd1090ffd6e5b084 100644 (file)
@@ -389,6 +389,7 @@ class StyleAddForm extends ACPForm {
                        'data' => array(
                                'styleName' => $this->styleName,
                                'templateGroupID' => $this->templateGroupID,
+                               'disabled' => 1, // styles are disabled by default
                                'styleDescription' => ($this->styleDescription ? $this->styleDescription : null),
                                'styleVersion' => $this->styleVersion,
                                'styleDate' => $this->styleDate,