customizable administer links
authorzapata <zapata>
Mon, 28 Apr 2003 01:57:14 +0000 (01:57 +0000)
committerzapata <zapata>
Mon, 28 Apr 2003 01:57:14 +0000 (01:57 +0000)
12 files changed:
bundles/admin_en.properties
bundles/admin_es.properties
bundles/admin_eu.properties
bundles/admin_fr.properties
bundles/admin_nl.properties
bundles/admin_tr.properties
source/Mir.java
source/default.properties
source/mircoders/servlet/ServletModuleFileEdit.java
source/mircoders/servlet/ServletModuleLocalizer.java
templates/admin/content.template
templates/admin/start_admin.template

index ad25f77..422376e 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: english
-# $Id: admin_en.properties,v 1.46 2003/04/28 00:44:05 zapata Exp $
+# $Id: admin_en.properties,v 1.47 2003/04/28 01:57:14 zapata Exp $
 
 languagename=English
 
@@ -287,7 +287,6 @@ start.content.new=new article
 start.show=show
 start.open_by_id=open id
 
-start.content.comments=comments
 start.content.hidden=produce all hidden articles
 start.content.not_published=not (yet) published articles
 start.content.with_media=with media
@@ -302,17 +301,15 @@ start.producers.title=GENERATE MANUALLY
 start.producers.produceAllNew=generate all new
 start.producers.advanced=advanced page (use with care!)
 
-start.openpostings.title=OPENPOSTINGS
-start.comments.title=COMMENTS
-start.breaking.title=breaking news
-start.content.title=ARTICLES
 start.administer.title=ADMINISTER
+start.administer.comments=comments
+
+start.breaking.title=breaking news
 start.list.title=LIST
 start.fileedit.includes.title=edit include files
 start.addandedit.title=ADD / EDIT
 start.extra.title=EXTRA
 start.search.title=SEARCH
-start.topics.title=TOPICS
 start.other_media.title=other media
 start.images.title=pictures
 start.video.title=video
index 569eab0..656efd5 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: spanish
-# $Id: admin_es.properties,v 1.27 2003/04/28 00:44:05 zapata Exp $
+# $Id: admin_es.properties,v 1.28 2003/04/28 01:57:14 zapata Exp $
 
 languagename = Castellano
 
@@ -305,7 +305,7 @@ start.content.new = nuevo art\u00edculo
 start.show = mostrar
 start.open_by_id = ID env\u00edo
 
-start.content.comments = comentarios
+start.administer.comments = comentarios
 start.content.hidden = art\u00edculos ocultos
 start.content.not_published = art\u00edculos (aun) sin publicar
 start.content.with_media = con recursos medi\u00e1ticos
index 0c31674..411323f 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: euskera / basque
-# $Id: admin_eu.properties,v 1.11 2003/04/28 00:44:05 zapata Exp $
+# $Id: admin_eu.properties,v 1.12 2003/04/28 01:57:14 zapata Exp $
 
 languagename = Euskera
 
@@ -368,7 +368,7 @@ start.show = Erakutsi
 start.open_by_id = 
 
 # missing (master value = "comments")
-start.content.comments = 
+start.administer.comments = 
 start.content.hidden = aritukulu ezkutukoak
 start.content.not_published = argitaratzeke dauden artikuluak
 start.content.with_media = baliabide mediatikoekin
index fd8d54f..58844a8 100755 (executable)
@@ -299,7 +299,7 @@ start.content.new = Ajouter un article
 start.show = Montrer
 start.open_by_id = Trouver par ID
 
-start.content.comments = Commentaires
+start.administer.comments = Commentaires
 start.content.hidden = Articles cach\u00e9s
 start.content.not_published = Articles non publi\u00e9s
 start.content.with_media = Articles avec m\u00e9dias
index d4ec235..ce9aea8 100755 (executable)
@@ -1,6 +1,6 @@
 ########## admin ##########
 # language: dutch
-# $Id: admin_nl.properties,v 1.7 2003/04/28 00:44:05 zapata Exp $
+# $Id: admin_nl.properties,v 1.8 2003/04/28 01:57:14 zapata Exp $
 
 languagename = Nederlands
 
@@ -303,7 +303,7 @@ start.content.new = Artikel aanmaken
 start.show = bekijken
 start.open_by_id = open nummer
 
-start.content.comments = Commentaren
+start.administer.comments = Commentaren
 start.content.hidden = Ongepubliceerde artikelen
 start.content.not_published = Ongepubliceerde artikelen
 start.content.with_media = Artikelen met multi-media
index 57b228b..b078499 100755 (executable)
@@ -1,5 +1,5 @@
 ########## admin ##########
-# $Id: admin_tr.properties,v 1.11 2003/04/28 00:44:05 zapata Exp $
+# $Id: admin_tr.properties,v 1.12 2003/04/28 01:57:14 zapata Exp $
 
 languagename = T\u00fcrk\u00e7e
 
@@ -379,7 +379,7 @@ start.show = g\u00f6ster
 start.open_by_id = 
 
 # missing (master value = "comments")
-start.content.comments = 
+start.administer.comments = 
 # missing (master value = "produce all hidden articles")
 start.content.hidden = 
 start.content.not_published = hen\u00fcz yay\u0131mlanmam\u0131\u015f makaleler
index 01af8f3..820c41b 100755 (executable)
@@ -38,13 +38,18 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Vector;
-
 import javax.servlet.ServletException;
 import javax.servlet.UnavailableException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.struts.util.MessageResources;
+import freemarker.template.SimpleHash;
+import freemarker.template.SimpleList;
+import freemarker.template.SimpleScalar;
+import freemarker.template.TemplateModel;
+
 import mir.config.MirPropertiesConfiguration;
 import mir.entity.adapter.EntityIteratorAdapter;
 import mir.generator.FreemarkerGenerator;
@@ -63,16 +68,11 @@ import mircoders.entity.EntityUsers;
 import mircoders.global.MirGlobal;
 import mircoders.module.ModuleMessage;
 import mircoders.module.ModuleUsers;
-import mircoders.servlet.*;
+import mircoders.servlet.ServletHelper;
+import mircoders.servlet.ServletModuleFileEdit;
+import mircoders.servlet.ServletModuleLocalizer;
 import mircoders.storage.DatabaseUsers;
 
-import org.apache.struts.util.MessageResources;
-
-import freemarker.template.SimpleHash;
-import freemarker.template.SimpleList;
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModel;
-
 
 
 
@@ -80,7 +80,7 @@ import freemarker.template.TemplateModel;
  * Mir.java - main servlet, that dispatches to servletmodules
  *
  * @author $Author: zapata $
- * @version $Id: Mir.java,v 1.46 2003/04/28 00:44:05 zapata Exp $
+ * @version $Id: Mir.java,v 1.47 2003/04/28 01:57:14 zapata Exp $
  *
  */
 public class Mir extends AbstractServlet {
@@ -464,6 +464,7 @@ public class Mir extends AbstractServlet {
                  MirGlobal.localizer().dataModel().adapterModel(), "internalMessage", 10, 0)));
 
       mergeData.put("fileeditentries", ((ServletModuleFileEdit) ServletModuleFileEdit.getInstance()).getEntries());
+      mergeData.put("administeroperations", ((ServletModuleLocalizer) ServletModuleLocalizer.getInstance()).getAdministerOperations());
 
       mergeData.put("searchvalue", null);
       mergeData.put("searchfield", null);
index c488215..57833f9 100755 (executable)
@@ -107,6 +107,11 @@ Mir.Localizer.Admin.TopicListOrder=title
 Mir.Localizer.Admin.AllowDeleteComment=1
 Mir.Localizer.Admin.AllowDeleteArticle=1
 
+# enable deletion of comments/articles?
+Mir.Localizer.Admin.AdministerOperations= \
+   comments:module=Comment&do=list
+
+
 # Which producers need to be called after an article (resp. a comment) is posted
 Mir.Localizer.OpenPosting.ContentProducers= media.new;articles.changed;startpage.generate;synchronization.run
 Mir.Localizer.OpenPosting.CommentProducers= articles.changed;synchronization.run
index 63218ed..c925782 100755 (executable)
@@ -59,7 +59,7 @@ import mir.util.URLBuilder;
  *  in the config file.
  *
  * @author $Author: zapata $
- * @version $Revision: 1.11 $ $Date: 2003/04/28 00:44:06 $
+ * @version $Revision: 1.12 $ $Date: 2003/04/28 01:57:14 $
  *
  */
 
@@ -112,11 +112,6 @@ public class ServletModuleFileEdit extends ServletModule
     directoryNames = new Vector();
 
     String settings[] = configuration.getStringArray("ServletModule.FileEdit.Configuration");
-/*
-ServletModule.FileEdit.FileDirectory=/pub/Dokumente/Indymedia/de-tech/Mir/produced
-ServletModule.FileEdit.ExtFilter=.*\.inc$
-ServletModule.FileEdit.Recursive=0
-*/
 
     if (settings!=null) {
       for (int i = 0; i < settings.length; i++) {
index bc6214b..1498178 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with  any library licensed under the Apache Software License, 
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library 
- * (or with modified versions of the above that use the same license as the above), 
- * and distribute linked combinations including the two.  You must obey the 
- * GNU General Public License in all respects for all of the code used other than 
- * the above mentioned libraries.  If you modify this file, you may extend this 
- * exception to your version of the file, but you are not obligated to do so.  
+ * the code of this program with  any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two.  You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries.  If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
  * If you do not wish to do so, delete this exception statement from your version.
  */
 package mircoders.servlet;
 
-import java.util.List;
+import java.util.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -40,7 +40,7 @@ import mir.log.LoggerWrapper;
 import mir.servlet.ServletModule;
 import mir.servlet.ServletModuleExc;
 import mir.servlet.ServletModuleFailure;
-import mir.util.StringRoutines;
+import mir.util.*;
 import mircoders.entity.EntityComment;
 import mircoders.entity.EntityContent;
 import mircoders.entity.EntityUsers;
@@ -57,17 +57,43 @@ public class ServletModuleLocalizer extends ServletModule {
 
   private ModuleContent contentModule;
   private ModuleComment commentModule;
+  private List administerOperations;
 
   private ServletModuleLocalizer() {
     try {
+      logger = new LoggerWrapper("ServletModule.Localizer");
+
       contentModule = new ModuleContent(DatabaseContent.getInstance());
       commentModule = new ModuleComment(DatabaseComment.getInstance());
 
-      logger = new LoggerWrapper("ServletModule.Localizer");
+      administerOperations = new Vector();
+
+      String settings[] = configuration.getStringArray("Mir.Localizer.Admin.AdministerOperations");
+
+      if (settings!=null) {
+        for (int i = 0; i < settings.length; i++) {
+          String setting = settings[i].trim();
+
+          if (setting.length() > 0) {
+            List parts = StringRoutines.splitString(setting, ":");
+            if (parts.size() != 2) {
+              logger.error("config error: " + settings[i] + ", 2 parts expected");
+            }
+            else {
+              Map entry = new HashMap();
+              entry.put("name", (String) parts.get(0));
+              entry.put("url", (String) parts.get(1));
+              administerOperations.add(entry);
+            }
+          }
+        }
+      }
     }
     catch (Exception e) {
       logger.error("ServletModuleLocalizer could not be initialized: " + e.getMessage());
     }
+
+
   }
 
   private EntityAdapter getActiveUser(HttpServletRequest aRequest) throws ServletModuleExc {
@@ -193,4 +219,7 @@ public class ServletModuleLocalizer extends ServletModule {
     redirect(aResponse, returnUrlString);
   }
 
+  public List getAdministerOperations() throws ServletModuleExc {
+    return administerOperations;
+  }
 }
\ No newline at end of file
index 20c9a28..026a7a5 100755 (executable)
@@ -12,6 +12,7 @@
 <form method="post" action="${config.actionRoot}">
        <input type="hidden" name="module" value="Content">
        <input type="hidden" name="id" value="${utility.encodeHTML(article.id)}">
+       <input type="hidden" name="returnurl" value="${utility.encodeHTML(returnurl)}">
        <if new=="1">
                <input type="hidden" name="do" value="insert">
        <else>
index 3cd1c90..3c248a9 100755 (executable)
                <!-- ###### left column ###### -->
                <p class="box-head"><b>${lang("start.administer.title")}</b></p>
                <p class="box"> 
-                       
+                 <list administeroperations as a>
+          <a href="${config.actionRoot}?${a.url}">${lang("start.administer."+a.name)}</a><br>
+                 </list>
+<!--      
                        <a href="${config.actionRoot}?module=Content&do=list&where=is_published%3d'1'%20and%20to_article_type%3D0&order=webdb_create%20desc">&gt; ${lang("start.allarticlesoftype", lang("articletypes.openposting"))}</a>      
                        <br>
                        <a href="${config.actionRoot}?module=Comment&do=list">
                                &gt; ${lang("start.content.comments")}
                        </a>
+-->                    
                </p>
 
                <p class="box-head"><b>${lang("start.list.title")}</b></p>