Update of 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources
In directory james.mmbase.org:/tmp/cvs-serv12334/src/webapp/editors/resources

Modified Files:
        attachmentsearch.jsp imagesearch.jsp urlsearch.jsp 
Log Message:
CMSC-1069(Add mass deleting function in the jsp.)


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources
See also: http://www.mmbase.org/jira/browse/CMSC-1069


Index: attachmentsearch.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources/attachmentsearch.jsp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- attachmentsearch.jsp        8 Oct 2008 08:04:45 -0000       1.16
+++ attachmentsearch.jsp        10 Oct 2008 05:09:56 -0000      1.17
@@ -19,6 +19,21 @@
       function showInfo(objectnumber) {
          openPopupWindow('attachmentinfo', '500', '500', 
'attachmentinfo.jsp?objectnumber='+objectnumber);
         }
+      function confirmDelete(){
+         var checkboxs = document.getElementsByTagName("input");
+         var num = 0;
+         for (i = 0; i < checkboxs.length; i++) {
+           if (checkboxs[i].type == 'checkbox' && 
checkboxs[i].name.indexOf('chk_') == 0 && checkboxs[i].checked) {
+             num++;
+           }
+         }
+         if(num > 0){
+           del = confirm("<fmt:message key="secondaryedit.mass.sure"/> "+num+" 
<fmt:message key="secondaryedit.mass.elements"/> ?");
+           if(del){
+             document.forms['imageform'].submit();
+           }
+         }
+        }
    </script>
 </cmscedit:head>
 <body>
@@ -63,9 +78,17 @@
             <mm:import externid="offset" jspvar="offset" 
vartype="Integer">0</mm:import>
             <c:if test="${resultCount > 0}">
                <[EMAIL PROTECTED] file="../repository/searchpages.jsp" %>
+               <form 
action="SecondaryContentMassDeleteAction.do?object_type=attachments" 
method="post" name="attachform">
                <table>
+                     <tr>
+                        <th><input type="submit" 
onclick="confirmDelete();return false;" value="<fmt:message 
key="secondaryedit.mass.delete"/>"/></th>
+                     </tr>
                   <tr class="listheader">
-                     <th> </th>
+                        <th>
+                           <c:if test="${fn:length(results) >1}">
+                              <input type="checkbox"  name="selectall"  
onclick="selectAll(this.checked, 'attachform', 'chk_');" value="on"/>
+                           </c:if>
+                        </th>
                      <th nowrap="true"><a href="javascript:orderBy('title')" 
class="headerlink" ><fmt:message key="attachmentsearch.titlecolumn" /></a></th>
                      <th nowrap="true"><a 
href="javascript:orderBy('filename')" class="headerlink" ><fmt:message 
key="attachmentsearch.filenamecolumn" /></a></th>
                      <th nowrap="true"><a 
href="javascript:orderBy('size')"><fmt:message 
key="attachmentsearch.filesizecolumn" /></a></th>
@@ -77,6 +100,9 @@
                         <mm:import 
id="url">javascript:selectElement('<mm:field name="number"/>', '<mm:field 
name="title" escape="js-single-quotes"/>','<mm:attachment 
escape="js-single-quotes"/>');</mm:import>
                         <tr <c:if test="${useSwapStyle}">class="swap"</c:if> 
href="<mm:write referid="url"/>">
                            <td style="white-space:nowrap;">
+                                 <c:if test="${fn:length(results) >1}">
+                                    <input type="checkbox"  
name="chk_<mm:field name="number" />" value="<mm:field name="number" />" 
onClick="document.forms['attachform'].elements.selectall.checked=false;"/>
+                                 </c:if>
                               <c:if test="${action != 'select'}">
                                  <a href="<mm:url 
page="../WizardInitAction.do">
                                     <mm:param name="objectnumber"><mm:field 
name="number" /></mm:param>
@@ -114,6 +140,7 @@
                      </mm:listnodes>
                   </tbody>
                </table>
+               </form>
             </c:if>
             <c:if test="${resultCount == 0 && param.title != null}">
                <fmt:message key="attachmentsearch.noresult" />


Index: imagesearch.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources/imagesearch.jsp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- imagesearch.jsp     8 Oct 2008 08:04:45 -0000       1.16
+++ imagesearch.jsp     10 Oct 2008 05:09:56 -0000      1.17
@@ -21,6 +21,22 @@
       function showInfo(objectnumber) {
          openPopupWindow('imageinfo', '900', '500', 
'imageinfo.jsp?objectnumber='+objectnumber);
         }
+      
+      function confirmDelete(){
+         var checkboxs = document.getElementsByTagName("input");
+         var num = 0;
+         for (i = 0; i < checkboxs.length; i++) {
+           if (checkboxs[i].type == 'checkbox' && 
checkboxs[i].name.indexOf('chk_') == 0 && checkboxs[i].checked) {
+             num++;
+           }
+         }
+         if(num > 0){
+           del = confirm("<fmt:message key="secondaryedit.mass.sure"/> "+num+" 
<fmt:message key="secondaryedit.mass.elements"/> ?");
+           if(del){
+             document.forms['imageform'].submit();
+           }
+         }
+        }
    </script>
 </cmscedit:head>
 <body>
@@ -61,9 +77,17 @@
          <mm:import externid="offset" jspvar="offset" 
vartype="Integer">0</mm:import>
          <c:if test="${resultCount > 0}">
             <[EMAIL PROTECTED] file="../repository/searchpages.jsp" %>
+         <form action="SecondaryContentMassDeleteAction.do?object_type=images" 
method="post" name="imageform">
             <table>
+               <tr>
+                  <th><input type="submit" onclick="confirmDelete();return 
false;" value="<fmt:message key="secondaryedit.mass.delete"/>"/></th>
+               </tr>
                <tr class="listheader">
-                  <th width="55"> </th>
+                  <th width="55">
+                     <c:if test="${fn:length(results) >1}">
+                        <input type="checkbox"  name="selectall"  
onclick="selectAll(this.checked, 'imageform', 'chk_');" value="on"/>
+                     </c:if>
+                  </th>
                   <th nowrap="true"><a href="javascript:orderBy('title')" 
class="headerlink"><fmt:message key="imagesearch.titlecolumn" /></a></th>
                   <th nowrap="true"><a href="javascript:orderBy('filename')" 
class="headerlink"><fmt:message key="imagesearch.filenamecolumn" /></a></th>
                   <th nowrap="true"><a 
href="javascript:orderBy('filesize')"><fmt:message key="imagesearch.sizecolumn" 
/></a></th>
@@ -79,6 +103,9 @@
                      </mm:field>
                      <tr <c:if test="${useSwapStyle}">class="swap"</c:if> 
href="<mm:write referid="url"/>">
                         <td style="white-space:nowrap;">
+                           <c:if test="${fn:length(results) >1}">
+                              <input type="checkbox"  name="chk_<mm:field 
name="number" />" value="<mm:field name="number" />" 
onClick="document.forms['imageform'].elements.selectall.checked=false;"/>
+                           </c:if>
                            <c:if test="${action != 'select'}">
                               <a href="<mm:url page="../WizardInitAction.do">
                                  <mm:param name="objectnumber"><mm:field 
name="number" /></mm:param>
@@ -117,6 +144,7 @@
                </mm:listnodes>
             </tbody>
          </table>
+          </form>
 </c:if>
 <c:if test="${resultCount == 0 && param.title != null}">
    <fmt:message key="imagesearch.noresult" />


Index: urlsearch.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources/urlsearch.jsp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- urlsearch.jsp       8 Oct 2008 07:25:48 -0000       1.14
+++ urlsearch.jsp       10 Oct 2008 05:09:56 -0000      1.15
@@ -17,6 +17,21 @@
    function showInfo(objectnumber,returnUrl) {
       openPopupWindow('urlinfo', '500', '500', 
'urlinfo.jsp?objectnumber='+objectnumber+'&returnUrl='+returnUrl);
      }
+   function confirmDelete(){
+      var checkboxs = document.getElementsByTagName("input");
+      var num = 0;
+      for (i = 0; i < checkboxs.length; i++) {
+        if (checkboxs[i].type == 'checkbox' && 
checkboxs[i].name.indexOf('chk_') == 0 && checkboxs[i].checked) {
+          num++;
+        }
+      }
+      if(num > 0){
+        del = confirm("<fmt:message key="secondaryedit.mass.sure"/> "+num+" 
<fmt:message key="secondaryedit.mass.elements"/> ?");
+        if(del){
+          document.forms['imageform'].submit();
+        }
+      }
+   }
 </script>
 </cmscedit:head>
 <body>
@@ -55,10 +70,17 @@
       externid="resultCount" jspvar="resultCount" 
vartype="Integer">0</mm:import> <mm:import
       externid="offset" jspvar="offset" vartype="Integer">0</mm:import> <c:if 
test="${resultCount > 0}">
       <[EMAIL PROTECTED] file="../repository/searchpages.jsp"%>
-
+      <form action="SecondaryContentMassDeleteAction.do?object_type=urls" 
method="post" name="urlform">
       <table border="0" width="100%" class="listcontent">
+            <tr>
+               <th><input type="submit" onclick="confirmDelete();return 
false;" value="<fmt:message key="secondaryedit.mass.delete"/>"/></th>
+            </tr>
          <tr class="listheader">
-            <th></th>
+               <th>
+                  <c:if test="${fn:length(results) >1}">
+                     <input type="checkbox"  name="selectall"  
onclick="selectAll(this.checked, 'urlform', 'chk_');" value="on"/>
+                  </c:if>
+               </th>
             <th nowrap="true"><a href="javascript:orderBy('name')" 
class="headerlink"><fmt:message
                key="urlsearch.namecolumn" /></a></th>
             <th nowrap="true"><a href="javascript:orderBy('url')" 
class="headerlink" ><fmt:message key="urlsearch.urlcolumn" /></a></th>
@@ -71,6 +93,9 @@
                      name="name" escape="js-single-quotes"/>','<mm:field 
name="url" />');</mm:import>
                <tr <c:if test="${useSwapStyle}">class="swap"</c:if> 
href="<mm:write referid="url"/>">
                   <td style="white-space:nowrap;">
+                        <c:if test="${fn:length(results) >1}">
+                           <input type="checkbox"  name="chk_<mm:field 
name="number" />" value="<mm:field name="number" />" 
onClick="document.forms['urlform'].elements.selectall.checked=false;"/>
+                        </c:if>
                         <c:if test="${action != 'select'}">
                      <a href="<mm:url page="../WizardInitAction.do">
                                                   <mm:param 
name="objectnumber"><mm:field name="number" /></mm:param>
@@ -116,6 +141,7 @@
             </mm:listnodes>
          </tbody>
       </table>
+      </form>
    </c:if>
 <c:if test="${resultCount == 0 && param.name != null}">
 <fmt:message key="urlsearch.noresult" />
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to