Changed HTML structure for clipboard API
authorAlexander Ebert <ebert@woltlab.com>
Tue, 20 Sep 2011 12:57:47 +0000 (14:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 20 Sep 2011 12:57:47 +0000 (14:57 +0200)
wcfsetup/install/files/acp/templates/userList.tpl
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php

index e82897aac197a4f6cc4891c825339f1bcc6e1225..1d8526b519c136f3e2ea91e4190c813817c3a786 100644 (file)
        </nav>
        
        {hascontent}
-               <table class="clipboardContainer" data-type="com.woltlab.wcf.user">
+               <table data-type="com.woltlab.wcf.user" class="clipboardContainer">
                        <thead>
                                <tr class="tableHead">
                                        <th class="columnMark"><label><input type="checkbox" class="clipboardMarkAll" /></label></th>
-                                       <th class="columnID columnUserID{if $sortField == 'userID'} active{/if}" colspan="2"><a href="index.php?page=UserList&amp;searchID={@$searchID}&amp;action={@$encodedAction}&amp;pageNo={@$pageNo}&amp;sortField=userID&amp;sortOrder={if $sortField == 'userID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@SID_ARG_2ND}">{lang}wcf.user.userID{/lang}{if $sortField == 'userID'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
-                                       <th class="columnTitle columnUsername{if $sortField == 'username'} active{/if}"><a href="index.php?page=UserList&amp;searchID={@$searchID}&amp;action={@$encodedAction}&amp;pageNo={@$pageNo}&amp;sortField=username&amp;sortOrder={if $sortField == 'username' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@SID_ARG_2ND}">{lang}wcf.user.username{/lang}{if $sortField == 'username'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                       <th class="columnUserID{if $sortField == 'userID'} active{/if}" colspan="2"><a href="index.php?page=UserList&amp;searchID={@$searchID}&amp;action={@$encodedAction}&amp;pageNo={@$pageNo}&amp;sortField=userID&amp;sortOrder={if $sortField == 'userID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@SID_ARG_2ND}">{lang}wcf.user.userID{/lang}{if $sortField == 'userID'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                       <th class="columnUsername{if $sortField == 'username'} active{/if}"><a href="index.php?page=UserList&amp;searchID={@$searchID}&amp;action={@$encodedAction}&amp;pageNo={@$pageNo}&amp;sortField=username&amp;sortOrder={if $sortField == 'username' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@SID_ARG_2ND}">{lang}wcf.user.username{/lang}{if $sortField == 'username'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
                                        
                                        {foreach from=$columnHeads key=column item=columnLanguageVariable}
-                                               <th class="columnText column{$column|ucfirst}{if $sortField == $column} active{/if}"><a href="index.php?page=UserList&amp;searchID={@$searchID}&amp;action={@$encodedAction}&amp;pageNo={@$pageNo}&amp;sortField={$column}&amp;sortOrder={if $sortField == $column && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@SID_ARG_2ND}">{lang}{$columnLanguageVariable}{/lang}{if $sortField == $column} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                               <th class="column{$column|ucfirst}{if $sortField == $column} active{/if}"><a href="index.php?page=UserList&amp;searchID={@$searchID}&amp;action={@$encodedAction}&amp;pageNo={@$pageNo}&amp;sortField={$column}&amp;sortOrder={if $sortField == $column && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@SID_ARG_2ND}">{lang}{$columnLanguageVariable}{/lang}{if $sortField == $column} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
                                        {/foreach}
                                        
                                        {if $additionalColumnHeads|isset}{@$additionalColumnHeads}{/if}
@@ -61,7 +61,7 @@
                                {content}
                                        {foreach from=$users item=user}
                                                <tr id="userRow{@$user->userID}">
-                                                       <td class="columnMark"><label><input type="checkbox" data-objectID="{@$user->userID}" class="clipboardItem" /></label></td>
+                                                       <td class="columnMark"><input type="checkbox" class="clipboardItem" data-objectID="{@$user->userID}" /></td>
                                                        <td class="columnIcon">
                                                                {if $user->editable}
                                                                        <a href="index.php?form=UserEdit&amp;userID={@$user->userID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/edit1.svg" alt="" title="{lang}wcf.acp.user.edit{/lang}" class="balloonTooltip" /></a>
                                                
                                                                {if $additionalButtons[$user->userID]|isset}{@$additionalButtons[$user->userID]}{/if}
                                                        </td>
-                                                       <td class="columnID columnUserID"><p>{@$user->userID}</p></td>
-                                                       <td class="columnTitle columnUsername"><p>{if $user->editable}<a title="{lang}wcf.acp.user.edit{/lang}" href="index.php?form=UserEdit&amp;userID={@$user->userID}{@SID_ARG_2ND}">{$user->username}</a>{else}{$user->username}{/if}</p></td>
+                                                       <td class="columnUserID columnID"><p>{@$user->userID}</p></td>
+                                                       <td class="columnUsername columnName columnText"><p>{if $user->editable}<a title="{lang}wcf.acp.user.edit{/lang}" href="index.php?form=UserEdit&amp;userID={@$user->userID}{@SID_ARG_2ND}">{$user->username}</a>{else}{$user->username}{/if}</p></td>
                                        
                                                        {foreach from=$columnHeads key=column item=columnLanguageVariable}
-                                                               <td class="columnText column{$column|ucfirst}"><p>{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}</p></td>
+                                                               <td class="column{$column|ucfirst}"><p>{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}</p></td>
                                                        {/foreach}
                                        
                                                        {if $additionalColumns[$user->userID]|isset}{@$additionalColumns[$user->userID]}{/if}
@@ -95,7 +95,7 @@
        <div class="contentFooter">
                {@$pagesLinks}
                
-               <div class="clipboardEditor" data-type="com.woltlab.wcf.user"></div>
+               <div data-types="[ 'com.woltlab.wcf.user' ]" class="clipboardEditor"></div>
                
                <nav class="largeButtons">
                        <ul>
index 43b8a5d83ab6360271f432b9aeab3e316dd442b3..0bbe0a9fb7d71b9cb113c04ba8d09efc9c42bab3 100644 (file)
@@ -678,8 +678,9 @@ WCF.Clipboard = {
                var $containers = {};
                $('.clipboardEditor').each(function(index, container) {
                        var $container = $(container);
-                       var $typeName = $container.data('type');
-                       if ($typeName) {
+                       var $types = eval($container.data('types'));
+                       for (var $i = 0, $length = $types.length; $i < $length; $i++) {
+                               var $typeName = $types[$i];
                                $containers[$typeName] = $container;
                        }
                        
@@ -697,17 +698,21 @@ WCF.Clipboard = {
                        
                        // create container
                        var $container = $containers[$typeName];
+                       var $list = $container.children('ul');
+                       if ($list.length == 0) {
+                               $list = $('<ul></ul>').appendTo($container);
+                       }
+                       
                        var $editor = data.items[$typeName];
-                       var $label = $('<span>' + $editor.label + '</span>').appendTo($container).click(function(event) {
-                               var $span = $(event.target);
-                               $span.next().toggle();
+                       var $label = $('<li><span>' + $editor.label + '</span></li>').appendTo($list).click(function(event) {
+                               $(event.target).next().toggle();
                        });
-                       var $list = $('<ol></ol>').appendTo($container).hide();
+                       var $itemList = $('<ol></ol>').appendTo($label).hide();
                        
                        // create editor items
                        for (var $itemIndex in $editor.items) {
                                var $item = $editor.items[$itemIndex];
-                               var $listItem = $('<li>' + $item.label + '</li>').appendTo($list);
+                               var $listItem = $('<li>' + $item.label + '</li>').appendTo($itemList);
                                $listItem.data('actionName', $item.actionName).data('parameters', $item.parameters);
                                $listItem.data('internalData', $item.internalData).data('url', $item.url).data('type', $typeName);
                                
index 361327a6a30a33c21bfc10d51e5e8f5357281146..54f3e668f0c7841ded54f99014c128f0b64a716b 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\clipboard\action;
+use wcf\data\user\group\UserGroup;
 use wcf\system\clipboard\ClipboardEditorItem;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;