From: zapata Date: Mon, 28 Apr 2003 01:57:14 +0000 (+0000) Subject: customizable administer links X-Git-Tag: BEFORE_MERGE_1_1~137 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=51765026ed320df19dbcbdb4cf8a89f08da19bde;p=mir.git customizable administer links --- diff --git a/bundles/admin_en.properties b/bundles/admin_en.properties index ad25f776..422376e1 100755 --- a/bundles/admin_en.properties +++ b/bundles/admin_en.properties @@ -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 diff --git a/bundles/admin_es.properties b/bundles/admin_es.properties index 569eab03..656efd52 100755 --- a/bundles/admin_es.properties +++ b/bundles/admin_es.properties @@ -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 diff --git a/bundles/admin_eu.properties b/bundles/admin_eu.properties index 0c316742..411323f1 100755 --- a/bundles/admin_eu.properties +++ b/bundles/admin_eu.properties @@ -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 diff --git a/bundles/admin_fr.properties b/bundles/admin_fr.properties index fd8d54fe..58844a8d 100755 --- a/bundles/admin_fr.properties +++ b/bundles/admin_fr.properties @@ -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 diff --git a/bundles/admin_nl.properties b/bundles/admin_nl.properties index d4ec235a..ce9aea86 100755 --- a/bundles/admin_nl.properties +++ b/bundles/admin_nl.properties @@ -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 diff --git a/bundles/admin_tr.properties b/bundles/admin_tr.properties index 57b228bc..b078499a 100755 --- a/bundles/admin_tr.properties +++ b/bundles/admin_tr.properties @@ -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 diff --git a/source/Mir.java b/source/Mir.java index 01af8f37..820c41b6 100755 --- a/source/Mir.java +++ b/source/Mir.java @@ -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); diff --git a/source/default.properties b/source/default.properties index c4882154..57833f98 100755 --- a/source/default.properties +++ b/source/default.properties @@ -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 diff --git a/source/mircoders/servlet/ServletModuleFileEdit.java b/source/mircoders/servlet/ServletModuleFileEdit.java index 63218edc..c9257821 100755 --- a/source/mircoders/servlet/ServletModuleFileEdit.java +++ b/source/mircoders/servlet/ServletModuleFileEdit.java @@ -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++) { diff --git a/source/mircoders/servlet/ServletModuleLocalizer.java b/source/mircoders/servlet/ServletModuleLocalizer.java index bc6214b3..14981787 100755 --- a/source/mircoders/servlet/ServletModuleLocalizer.java +++ b/source/mircoders/servlet/ServletModuleLocalizer.java @@ -18,18 +18,18 @@ * 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 diff --git a/templates/admin/content.template b/templates/admin/content.template index 20c9a284..026a7a57 100755 --- a/templates/admin/content.template +++ b/templates/admin/content.template @@ -12,6 +12,7 @@
+ diff --git a/templates/admin/start_admin.template b/templates/admin/start_admin.template index 3cd1c905..3c248a90 100755 --- a/templates/admin/start_admin.template +++ b/templates/admin/start_admin.template @@ -15,12 +15,16 @@

${lang("start.administer.title")}

- + + ${lang("start.administer."+a.name)}
+
+

${lang("start.list.title")}