Author: mfang
Date: 2009-06-02 08:22:09 +0200 (Tue, 02 Jun 2009)
New Revision: 35546

Modified:
   
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/assettrash.jsp
   
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/contenttrash.jsp
   
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/recyclebin.js
Log:
CMSC-1006 Create a 'pages' tag for using inside the Editors and use it by 
default for paging

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/assettrash.jsp
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/assettrash.jsp
 2009-06-02 06:21:18 UTC (rev 35545)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/assettrash.jsp
 2009-06-02 06:22:09 UTC (rev 35546)
@@ -1,5 +1,6 @@
 <%...@page language="java" contentType="text/html;charset=utf-8"
 %><%...@include file="globals.jsp" 
+%><%@ taglib prefix="edit" tagdir="/WEB-INF/tags/edit" 
 %><%...@page import="com.finalist.cmsc.repository.*" 
 %><mm:content type="text/html" encoding="UTF-8" expires="0">
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
@@ -17,6 +18,7 @@
 <c:set var="direction">
    <c:out value="${direction =='up'?'down':'up' }"/>
 </c:set>
+<c:set var="pagerDOToffset"><%=request.getParameter("pager.offset")%></c:set>
 <body>
 <div class="tabs">
     <!-- active TAB -->
@@ -76,19 +78,20 @@
             
                               <c:set var="listSize"><mm:size/></c:set>
                               <c:set var="offset" value="${not empty 
param.offset ? param.offset : '0'}"/>
+                              <c:set var="extraparams" 
value="&sortBy=${sortBy}&direction=${direction}"/>
                               
                               <mm:listnodes jspvar="node" 
max="${resultsPerPage}" offset="${offset*resultsPerPage}">
                                  <mm:first>
-                                    <%...@include file="../pages.jsp" %>
+                                    <edit:pages search="false" 
totalElements="${listSize}" offset="${offset}" extraparams="${extraparams}"/>
                                      <table>
                                        <thead>
                                           <tr>
                                              <th style="width: 56px;"></th>
-                                             <th style="width: 68px;"><a 
href="assettrash.jsp?sortBy=otype&direction=${direction}" 
class="headerlink"><fmt:message key="locate.typecolumn" /></a></th>
-                                             <th><a 
href="assettrash.jsp?sortBy=title&direction=${direction}" 
class="headerlink"><fmt:message key="locate.titlecolumn" /></a></th>
-                                             <th style="width: 50px;"><a 
href="assettrash.jsp?sortBy=creator&direction=${direction}" 
class="headerlink"><fmt:message key="locate.authorcolumn" /></a></th>
-                                             <th style="width: 120px;"><a 
href="assettrash.jsp?sortBy=lastmodifieddate&direction=${direction}" 
class="headerlink"><fmt:message key="locate.lastmodifiedcolumn" /></a></th>
-                                             <th style="width: 60px;"><a 
href="assettrash.jsp?sortBy=number&direction=${direction}" 
class="headerlink"><fmt:message key="locate.numbercolumn" /></a></th>
+                                             <th style="width: 68px;"><a 
href="assettrash.jsp?sortBy=otype&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.typecolumn" /></a></th>
+                                             <th><a 
href="assettrash.jsp?sortBy=title&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.titlecolumn" /></a></th>
+                                             <th style="width: 50px;"><a 
href="assettrash.jsp?sortBy=creator&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.authorcolumn" /></a></th>
+                                             <th style="width: 120px;"><a 
href="assettrash.jsp?sortBy=lastmodifieddate&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.lastmodifiedcolumn" /></a></th>
+                                             <th style="width: 60px;"><a 
href="assettrash.jsp?sortBy=number&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.numbercolumn" /></a></th>
                                           </tr>
                                        </thead>
                                        <tbody class="hover">
@@ -97,8 +100,8 @@
                                  <tr <mm:even 
inverse="true">class="swap"</mm:even>>
                                     <td nowrap>
                                        <a 
href="javascript:infoAsset('<mm:field name="number" />', '<mm:nodeinfo 
type="type"/>')"><img src="../gfx/icons/info.png" width="16" height="16" 
alt="<fmt:message key="recyclebin.info" />" title="<fmt:message 
key="recyclebin.info" />"/></a>
-                                       <a 
href="javascript:permanentDelete('<mm:field name="number" />', '<fmt:message 
key="recyclebin.removeconfirm" />', '${offset}','asset');"><img 
src="../gfx/icons/delete.png" width="16" height="16" alt="<fmt:message 
key="recyclebin.remove" />" title="<fmt:message key="recyclebin.remove" 
/>"/></a>
-                                       <a 
href="javascript:restoreAsset('<mm:field name="number" />', '${offset}');"><img 
src="../gfx/icons/restore.png" width="16" height="16" alt="<fmt:message 
key="recyclebin.restore" />" title="<fmt:message key="recyclebin.restore" 
/>"/></a>
+                                       <a 
href="javascript:permanentDelete('<mm:field name="number" />', '<fmt:message 
key="recyclebin.removeconfirm" />', '${offset}', 
'${pagerDOToffset}','asset');"><img src="../gfx/icons/delete.png" width="16" 
height="16" alt="<fmt:message key="recyclebin.remove" />" title="<fmt:message 
key="recyclebin.remove" />"/></a>
+                                       <a 
href="javascript:restoreAsset('<mm:field name="number" />', '${offset}', 
'${pagerDOToffset}');"><img src="../gfx/icons/restore.png" width="16" 
height="16" alt="<fmt:message key="recyclebin.restore" />" title="<fmt:message 
key="recyclebin.restore" />"/></a>
                                     </td>
                                     <td>
                                       <mm:nodeinfo type="guitype"/>
@@ -125,7 +128,7 @@
                               <mm:last>
                                     </tbody>
                                  </table>
-           <%...@include file="../pages.jsp" %>
+           <edit:pages search="false" totalElements="${listSize}" 
offset="${offset}" extraparams="${extraparams}"/>
                               </mm:last>
                           </mm:listnodes>
                         </mm:relatednodescontainer>                   

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/contenttrash.jsp
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/contenttrash.jsp
       2009-06-02 06:21:18 UTC (rev 35545)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/contenttrash.jsp
       2009-06-02 06:22:09 UTC (rev 35546)
@@ -1,5 +1,6 @@
 <%...@page language="java" contentType="text/html;charset=utf-8"
 %><%...@include file="globals.jsp" 
+%><%@ taglib prefix="edit" tagdir="/WEB-INF/tags/edit" 
 %><%...@page import="com.finalist.cmsc.repository.*" 
 %><mm:content type="text/html" encoding="UTF-8" expires="0">
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
@@ -17,6 +18,7 @@
 <c:set var="direction">
    <c:out value="${direction =='up'?'down':'up' }"/>
 </c:set>
+<c:set var="pagerDOToffset"><%=request.getParameter("pager.offset")%></c:set>
 <body>
 <div class="tabs">
     <!-- active TAB -->
@@ -76,20 +78,21 @@
             
                               <c:set var="listSize"><mm:size/></c:set>
                               <c:set var="offset" value="${not empty 
param.offset ? param.offset : '0'}"/>
-                              
+                              <c:set var="extraparams" 
value="&sortBy=${sortBy}&direction=${direction}"/>
+
                               <mm:listnodes jspvar="node" 
max="${resultsPerPage}" offset="${offset*resultsPerPage}">
                                  <mm:first>
                                    
-                                 <%...@include file="../pages.jsp" %>
+                                 <edit:pages search="false" 
totalElements="${listSize}" offset="${offset}" extraparams="${extraparams}"/>
                                      <table>
                                        <thead>
                                           <tr>
                                              <th style="width: 56px;"></th>
-                                             <th style="width: 68px;"><a 
href="contenttrash.jsp?sortBy=otype&direction=${direction}" 
class="headerlink"><fmt:message key="locate.typecolumn" /></a></th>
-                                             <th><a 
href="contenttrash.jsp?sortBy=title&direction=${direction}" 
class="headerlink"><fmt:message key="locate.titlecolumn" /></a></th>
-                                             <th style="width: 50px;"><a 
href="contenttrash.jsp?sortBy=creator&direction=${direction}" 
class="headerlink"><fmt:message key="locate.authorcolumn" /></a></th>
-                                             <th style="width: 120px;"><a 
href="contenttrash.jsp?sortBy=lastmodifieddate&direction=${direction}" 
class="headerlink"><fmt:message key="locate.lastmodifiedcolumn" /></a></th>
-                                             <th style="width: 60px;"><a 
href="contenttrash.jsp?sortBy=number&direction=${direction}" 
class="headerlink"><fmt:message key="locate.numbercolumn" /></a></th>
+                                             <th style="width: 68px;"><a 
href="contenttrash.jsp?sortBy=otype&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.typecolumn" /></a></th>
+                                             <th><a 
href="contenttrash.jsp?sortBy=title&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.titlecolumn" /></a></th>
+                                             <th style="width: 50px;"><a 
href="contenttrash.jsp?sortBy=creator&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.authorcolumn" /></a></th>
+                                             <th style="width: 120px;"><a 
href="contenttrash.jsp?sortBy=lastmodifieddate&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.lastmodifiedcolumn" /></a></th>
+                                             <th style="width: 60px;"><a 
href="contenttrash.jsp?sortBy=number&direction=${direction}&offset=${offset}&pager.offset=${pagerDOToffset}"
 class="headerlink"><fmt:message key="locate.numbercolumn" /></a></th>
                                           </tr>
                                        </thead>
                                        <tbody class="hover">
@@ -98,8 +101,8 @@
                                  <tr <mm:even 
inverse="true">class="swap"</mm:even>>
                                     <td nowrap>
                                        <a 
href="javascript:infoContent('<mm:field name="number" />', '<mm:nodeinfo 
type="type"/>')"><img src="../gfx/icons/info.png" width="16" height="16" 
alt="<fmt:message key="recyclebin.info" />" title="<fmt:message 
key="recyclebin.info" />"/></a>
-                                       <a 
href="javascript:permanentDelete('<mm:field name="number" />', '<fmt:message 
key="recyclebin.removeconfirm" />', '${offset}', 'content');"><img 
src="../gfx/icons/delete.png" width="16" height="16" alt="<fmt:message 
key="recyclebin.remove" />" title="<fmt:message key="recyclebin.remove" 
/>"/></a>
-                                       <a 
href="javascript:restoreContent('<mm:field name="number" />', 
'${offset}');"><img src="../gfx/icons/restore.png" width="16" height="16" 
alt="<fmt:message key="recyclebin.restore" />" title="<fmt:message 
key="recyclebin.restore" />"/></a>
+                                       <a 
href="javascript:permanentDelete('<mm:field name="number" />', '<fmt:message 
key="recyclebin.removeconfirm" />', '${offset}', '${pagerDOToffset}', 
'content');"><img src="../gfx/icons/delete.png" width="16" height="16" 
alt="<fmt:message key="recyclebin.remove" />" title="<fmt:message 
key="recyclebin.remove" />"/></a>
+                                       <a 
href="javascript:restoreContent('<mm:field name="number" />', '${offset}', 
'${pagerDOToffset}');"><img src="../gfx/icons/restore.png" width="16" 
height="16" alt="<fmt:message key="recyclebin.restore" />" title="<fmt:message 
key="recyclebin.restore" />"/></a>
                                     </td>
                                     <td>
                                       <mm:nodeinfo type="guitype"/>
@@ -121,7 +124,7 @@
                               <mm:last>
                                     </tbody>
                                  </table>
-                                 <%...@include file="../pages.jsp" %>
+                                 <edit:pages search="false" 
totalElements="${listSize}" offset="${offset}" extraparams="${extraparams}"/>
                               </mm:last>
                           </mm:listnodes>
                         </mm:relatednodescontainer>

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/recyclebin.js
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/recyclebin.js
  2009-06-02 06:21:18 UTC (rev 35545)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/recyclebin.js
  2009-06-02 06:22:09 UTC (rev 35546)
@@ -1,15 +1,16 @@
-   function restoreAsset(objectnumber, offset) {
-       return restore(objectnumber, offset, "RestoreAssetAction.do");
+   function restoreAsset(objectnumber, offset, pagerDOToffset) {
+       return restore(objectnumber, offset, pagerDOToffset, 
"RestoreAssetAction.do");
    }
    
-   function restoreContent(objectnumber, offset) {
-          return restore(objectnumber, offset, "RestoreAction.do");
+   function restoreContent(objectnumber, offset, pagerDOToffset) {
+          return restore(objectnumber, offset, pagerDOToffset, 
"RestoreAction.do");
    }
 
-   function restore(objectnumber, offset, url) {
+   function restore(objectnumber, offset, pagerDOToffset, url) {
        url += "?objectnumber=" + objectnumber;
        url += "&returnurl=" + escape(document.location);
        url += "&offset=" + offset;
+       url += "&pager.offset=" + pagerDOToffset;
        document.location.href = url;
    }
    
@@ -34,13 +35,14 @@
       openPopupWindow('contentinfo', '500', '500', url);
    }
     
-    function permanentDelete(objectnumber, message, offset, type) {
+    function permanentDelete(objectnumber, message, offset, pagerDOToffset, 
type) {
        if (confirm(message)) {
           var url = "DeleteAction.do";
           url += "?objectnumber=" + objectnumber;
           url += "&returnurl=" + escape(document.location);
-             url += "&offset=" + offset;
-             url += "&type=" + type;
+          url += "&offset=" + offset;
+          url += "&type=" + type;
+          url += "&pager.offset=" + pagerDOToffset;
 
           document.location.href = url;
        }

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to