########## admin ##########
# language: deutsch / german
-# $Id: admin_de.properties,v 1.28 2003/04/26 23:20:24 zapata Exp $
+# $Id: admin_de.properties,v 1.29 2003/04/28 00:44:05 zapata Exp $
languagename=Deutsch
start.content.title=ARTIKEL
start.administer.title=AUFRÄUMEN
start.list.title=LIST
-start.fileedit.title=Includes editieren
+start.fileedit.includes.title=Includes editieren
start.addandedit.title=NEU / ÄNDERN
start.extra.title=EXTRA
start.search.title=SUCHEN
########## admin ##########
# language: english
-# $Id: admin_en.properties,v 1.45 2003/04/26 23:20:24 zapata Exp $
+# $Id: admin_en.properties,v 1.46 2003/04/28 00:44:05 zapata Exp $
languagename=English
start.content.title=ARTICLES
start.administer.title=ADMINISTER
start.list.title=LIST
-start.fileedit.title=edit include files
+start.fileedit.includes.title=edit include files
start.addandedit.title=ADD / EDIT
start.extra.title=EXTRA
start.search.title=SEARCH
########## admin ##########
# language: spanish
-# $Id: admin_es.properties,v 1.26 2003/04/26 23:20:24 zapata Exp $
+# $Id: admin_es.properties,v 1.27 2003/04/28 00:44:05 zapata Exp $
languagename = Castellano
start.content.title = ART\u00cdCULOS
start.administer.title = ADMINISTRAR
start.list.title = LISTA
-start.fileedit.title = editar ficheros
+start.fileedit.includes.title = editar ficheros
start.addandedit.title = A\u00d1ADIR / EDITAR
start.extra.title = EXTRA
start.search.title = BUSCAR
########## admin ##########
# language: euskera / basque
-# $Id: admin_eu.properties,v 1.10 2003/04/26 23:20:24 zapata Exp $
+# $Id: admin_eu.properties,v 1.11 2003/04/28 00:44:05 zapata Exp $
languagename = Euskera
# missing (master value = "LIST")
start.list.title =
# missing (master value = "edit include files")
-start.fileedit.title =
+start.fileedit.includes.title =
# missing (master value = "ADD / EDIT")
start.addandedit.title =
# missing (master value = "EXTRA")
start.content.title = ARTICLES
start.administer.title = ADMINISTRER
start.list.title = LISTES
-start.fileedit.title = \u00c9diter les fichiers include (.inc)
+start.fileedit.includes.title = \u00c9diter les fichiers include (.inc)
start.addandedit.title = AJOUTER / EDITER
start.extra.title = EXTRA
start.search.title = CHERCHER
########## admin ##########
# language: dutch
-# $Id: admin_nl.properties,v 1.6 2003/04/26 23:20:24 zapata Exp $
+# $Id: admin_nl.properties,v 1.7 2003/04/28 00:44:05 zapata Exp $
languagename = Nederlands
start.content.title = Artikelen
start.administer.title = OPRUIMEN
start.list.title = LIJST
-start.fileedit.title = Include bestanden bewerken
+start.fileedit.includes.title = Include bestanden bewerken
start.addandedit.title = VOEG TOE / BEWERK
start.extra.title = EXTRA
start.search.title = ZOEKEN
########## admin ##########
-# $Id: admin_tr.properties,v 1.10 2003/04/09 02:06:06 zapata Exp $
+# $Id: admin_tr.properties,v 1.11 2003/04/28 00:44:05 zapata Exp $
languagename = T\u00fcrk\u00e7e
# missing (master value = "LIST")
start.list.title =
# missing (master value = "edit include files")
-start.fileedit.title =
+start.fileedit.includes.title =
# missing (master value = "ADD / EDIT")
start.addandedit.title =
# missing (master value = "EXTRA")
* 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.
*/
import mircoders.global.MirGlobal;
import mircoders.module.ModuleMessage;
import mircoders.module.ModuleUsers;
-import mircoders.servlet.ServletHelper;
+import mircoders.servlet.*;
import mircoders.storage.DatabaseUsers;
import org.apache.struts.util.MessageResources;
/**
* Mir.java - main servlet, that dispatches to servletmodules
*
- * @author $Author: idfx $
- * @version $Id: Mir.java,v 1.45 2003/04/21 12:42:46 idfx Exp $
+ * @author $Author: zapata $
+ * @version $Id: Mir.java,v 1.46 2003/04/28 00:44:05 zapata Exp $
*
*/
public class Mir extends AbstractServlet {
new CachingRewindableIterator(
new EntityIteratorAdapter( "", "webdb_create desc", 10,
MirGlobal.localizer().dataModel().adapterModel(), "internalMessage", 10, 0)));
+
+ mergeData.put("fileeditentries", ((ServletModuleFileEdit) ServletModuleFileEdit.getInstance()).getEntries());
+
mergeData.put("searchvalue", null);
mergeData.put("searchfield", null);
mergeData.put("searchispublished", null);
# In which order should the topic appear?
Mir.Localizer.Admin.TopicListOrder=title
+# enable deletion of comments/articles?
+Mir.Localizer.Admin.AllowDeleteComment=1
+Mir.Localizer.Admin.AllowDeleteArticle=1
+
# 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
# the generated HTML pages will be stored
Producer.StorageRoot=/pub/Dokumente/Indymedia/de-tech/Mir/produced
-# for FileEdit module
-#
-# where do we find the files? absolute path
-ServletModule.FileEdit.FileDirectory=/pub/Dokumente/Indymedia/de-tech/Mir/produced
-ServletModule.FileEdit.ExtFilter=.*\.inc$
-ServletModule.FileEdit.Recursive=0
+# FileEdit module
+# a list of directories to edit
+# format:
+# <name>:<path>:<file filter>:<0|1 (recursion off or on)> [, ....]
+
+ServletModule.FileEdit.Configuration= \
+ includes:/pub/Dokumente/Indymedia/de-tech/Mir/produced:.*\\.inc:1
#
#
* 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 mir.storage;
* Treiber, Host, User und Passwort, ueber den der Zugriff auf die
* Datenbank erfolgt.
*
- * @version $Id: Database.java,v 1.39 2003/04/21 12:42:47 idfx Exp $
+ * @version $Id: Database.java,v 1.40 2003/04/28 00:44:06 zapata Exp $
* @author rk
*
*/
logger.debug((System.currentTimeMillis() - startTime) + "ms. for: " + sql);
}
catch (SQLException e) {
- logger.debug("Failed: " + (System.currentTimeMillis() - startTime) + "ms. for: " + sql);
+ logger.error("Failed: " + (System.currentTimeMillis() - startTime) + "ms. for: " + sql);
throw e;
}
* 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 mir.util;
-import gnu.regexp.RE;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Vector;
+
+import gnu.regexp.RE;
public class FileFunctions {
protected static final int FILE_COPY_BUFFER_SIZE = 65536;
}
+ public static List getDirectoryContentsAsList(File aDirectory, FilenameFilter aFilter) {
+ Object[] contents = aDirectory.list(aFilter);
+ if (contents==null)
+ return new Vector();
+ else
+ return Arrays.asList(contents);
+ }
+
+
}
\ No newline at end of file
* 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.
*/
import java.util.List;
import java.util.Locale;
import java.util.Map;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import mir.servlet.ServletModule;
import mir.servlet.ServletModuleExc;
import mir.servlet.ServletModuleFailure;
+import mir.servlet.ServletModuleUserExc;
import mir.util.CachingRewindableIterator;
import mir.util.HTTPRequestParser;
import mir.util.JDBCStringRoutines;
}
}
+ public void delete(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc, ServletModuleUserExc, ServletModuleFailure {
+ if (!configuration.getString("Mir.Localizer.Admin.AllowDeleteArticle", "0").equals("1"))
+ throw new ServletModuleExc("Operation not permitted");
+
+ super.delete(req, res);
+ }
+
public void edit(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc
{
String idParam = req.getParameter("id");
* 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.
*/
* ServletModuleContent -
* deliver html for the article admin form.
*
- * @version $Id: ServletModuleContent.java,v 1.50 2003/04/21 12:42:51 idfx Exp $
+ * @version $Id: ServletModuleContent.java,v 1.51 2003/04/28 00:44:06 zapata Exp $
* @author rk, mir-coders
*
*/
public void delete(HttpServletRequest req, HttpServletResponse res) throws ServletModuleExc
{
+ if (!configuration.getString("Mir.Localizer.Admin.AllowDeleteArticle", "0").equals("1"))
+ throw new ServletModuleExc("Operation not permitted");
+
EntityUsers user = _getUser(req);
String idParam = req.getParameter("id");
* 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.
*/
import java.io.FilenameFilter;
import java.io.StringReader;
import java.io.StringWriter;
-import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Vector;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import mir.servlet.ServletModuleFailure;
import mir.util.FileFunctions;
import mir.util.HTTPRequestParser;
+import mir.util.StringRoutines;
import mir.util.URLBuilder;
/*
* Allows one to do a basic edit of a file in a directory specified
* in the config file.
*
- * @author $Author: idfx $
- * @version $Revision: 1.10 $ $Date: 2003/04/21 12:42:51 $
+ * @author $Author: zapata $
+ * @version $Revision: 1.11 $ $Date: 2003/04/28 00:44:06 $
*
*/
private static ServletModuleFileEdit instance = new ServletModuleFileEdit();
public static ServletModule getInstance() { return instance; }
- private File rootDirectory;
- private FilenameFilter filter;
+ private Map directories;
+ private List directoryNames;
+
private FilenameFilter dirFilter;
- private boolean recurse;
+
+ private class FileEditDirectory {
+ private String name;
+ private FileFunctions.RegExpFileFilter filter;
+ private File rootDirectory;
+ private boolean recursive;
+
+ public FileEditDirectory(String aName, String aRootDirectory, String aFilter, boolean aRecursive) {
+ name = aName;
+ rootDirectory = new File(aRootDirectory);
+ filter = new FileFunctions.RegExpFileFilter(aFilter);
+ recursive = aRecursive;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public FileFunctions.RegExpFileFilter getFilter() {
+ return filter;
+ }
+
+ public File getRootDirectory() {
+ return rootDirectory;
+ }
+
+ public boolean getRecursive() {
+ return recursive;
+ }
+ }
private ServletModuleFileEdit() {
super();
logger = new LoggerWrapper("ServletModule.FileEdit");
- rootDirectory = new File(configuration.getString("ServletModule.FileEdit.FileDirectory"));
- recurse = configuration.getString("ServletModule.FileEdit.Recursive", "").equals("1");
+ directories = new HashMap();
+ 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++) {
+ String setting = settings[i].trim();
+
+ if (setting.length() > 0) {
+ List parts = StringRoutines.splitString(setting, ":");
+ if (parts.size() != 4) {
+ logger.error("config error: " + settings[i] + ", 4 parts expected");
+ }
+ else {
+ String name = (String) parts.get(0);
+ String directory = (String) parts.get(1);
+ String filter = (String) parts.get(2);
+ String recursive = (String) parts.get(3);
+
+ directories.put(name, new FileEditDirectory(name, directory, filter,
+ recursive.equals("1") || recursive.toLowerCase().equals("y")));
+ directoryNames.add(name);
+ }
+ }
+ }
+ }
- filter = new FileFunctions.RegExpFileFilter(configuration.getString("ServletModule.FileEdit.ExtFilter"));
dirFilter = new FileFunctions.DirectoryFilter();
templateListString =configuration.getString("ServletModule.FileEdit.ListTemplate");
templateConfirmString =configuration.getString("ServletModule.FileEdit.ConfirmTemplate");
}
+ public List getEntries() {
+ return directoryNames;
+ }
+
+ public FileEditDirectory getDirectory(HttpServletRequest aRequest) throws ServletModuleExc {
+ FileEditDirectory result = (FileEditDirectory) directories.get(aRequest.getParameter("entry"));
+ if (result == null)
+ throw new ServletModuleExc("Unknown entry: " + aRequest.getParameter("entry"));
+
+ return result;
+ }
+
public void list(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
{
- listSubDirectory("/", aRequest, aResponse);
+ listSubDirectory(getDirectory(aRequest), "/", aRequest, aResponse);
}
public void edit(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
{
try {
HTTPRequestParser requestParser = new HTTPRequestParser(aRequest);
+
String filename = requestParser.getParameter("filename");
String subDirectory = requestParser.getParameterWithDefault("subdirectory", "");
if (filename == null)
throw new ServletModuleExc("No filename specified");
- editFile(filename, subDirectory, aRequest, aResponse);
+ editFile(getDirectory(aRequest), filename, subDirectory, aRequest, aResponse);
}
catch (Throwable e) {
throw new ServletModuleFailure(e);
{
try {
HTTPRequestParser requestParser = new HTTPRequestParser(aRequest);
+
String directoryName = requestParser.getParameter("directory");
String subDirectoryName = requestParser.getParameter("subdirectory");
if (directoryName==null | subDirectoryName==null)
throw new ServletModuleExc("No directory/subDirectory specified");
- listSubDirectory(subDirectoryName+File.separator+directoryName, aRequest, aResponse);
+ listSubDirectory(getDirectory(aRequest), subDirectoryName+File.separator+directoryName, aRequest, aResponse);
}
catch (Throwable e) {
throw new ServletModuleFailure(e);
}
}
+
public void update(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
{
- String filename = aRequest.getParameter("filename");
- String subDirectory = aRequest.getParameter("subdirectory");
- String text = aRequest.getParameter("text");
+ HTTPRequestParser requestParser = new HTTPRequestParser(aRequest);
+ String filename = requestParser.getParameter("filename");
+ String subDirectory = requestParser.getParameter("subdirectory");
+ String text = requestParser.getParameter("text");
+ FileEditDirectory directory = getDirectory(aRequest);
try {
- File f = new File(new File(rootDirectory, subDirectory), filename);
+ File f = new File(new File(directory.getRootDirectory(), subDirectory), filename);
- if (validateDirectory(f)) {
+ if (validateDirectory(directory, f)) {
StringReader in = new StringReader(text);
FileWriter out = new FileWriter(f);
in.close();
out.close();
- editFile(filename, subDirectory, aRequest, aResponse);
+ editFile(directory, filename, subDirectory, aRequest, aResponse);
}
}
catch (Throwable e) {
}
}
- public void listSubDirectory(String aSubDirectory, HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
+ public void listSubDirectory(FileEditDirectory aDirectory, String aSubDirectory, HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
{
try {
Map responseData = ServletHelper.makeGenerationData(new Locale[] { getLocale(aRequest), getFallbackLocale(aRequest)});
- File dir = new File(rootDirectory, aSubDirectory);
+ File dir = new File(aDirectory.getRootDirectory(), aSubDirectory);
- if (!validateDirectory(dir) || !dir.isDirectory()) {
- dir = rootDirectory;
+ if (!validateDirectory(aDirectory, dir) || !dir.isDirectory()) {
+ dir = aDirectory.getRootDirectory();
aSubDirectory = "";
}
- responseData.put("filelist", Arrays.asList(dir.list(filter)));
+ responseData.put("filelist", FileFunctions.getDirectoryContentsAsList(dir, aDirectory.getFilter()));
- if (recurse) {
+ if (aDirectory.getRecursive()) {
List dirs = new Vector();
- if (!dir.getCanonicalPath().equals(rootDirectory.getCanonicalPath()))
+ if (!dir.getCanonicalPath().equals(aDirectory.getRootDirectory().getCanonicalPath()))
responseData.put("updir", new File(aSubDirectory).getParent());
- dirs.addAll(Arrays.asList(dir.list(dirFilter)));
+ dirs.addAll(FileFunctions.getDirectoryContentsAsList(dir, dirFilter));
responseData.put("dirlist", dirs);
}
}
responseData.put("subdirectory", aSubDirectory);
+ responseData.put("entry", aDirectory.getName());
ServletHelper.generateResponse(aResponse.getWriter(), responseData, templateListString);
}
}
}
- public void editFile(String aFileName, String aSubDirectory, HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
+ public void editFile(FileEditDirectory aDirectory, String aFileName, String aSubDirectory, HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc
{
try {
- File f = new File(new File(rootDirectory, aSubDirectory), aFileName);
+ File f = new File(new File(aDirectory.getRootDirectory(), aSubDirectory), aFileName);
- if (!validateDirectory(f) || f.isDirectory() || !validateFile(f)) {
- listSubDirectory("", aRequest, aResponse);
+ if (!validateDirectory(aDirectory, f) || f.isDirectory() || !validateFile(aDirectory, f)) {
+ listSubDirectory(aDirectory, "", aRequest, aResponse);
}
else {
Map responseData = ServletHelper.makeGenerationData(new Locale[] { getLocale(aRequest), getFallbackLocale(aRequest)});
urlBuilder.setValue("module", "FileEdit");
urlBuilder.setValue("do", "enter");
+ urlBuilder.setValue("entry", aDirectory.getName());
urlBuilder.setValue("directory", "");
urlBuilder.setValue("subdirectory", aSubDirectory);
in.close();
out.close();
+ responseData.put("entry", aDirectory.getName());
responseData.put("text", out.toString());
responseData.put("filename", aFileName);
responseData.put("subdirectory", aSubDirectory);
}
}
- protected boolean validateDirectory(File aFile) {
+ protected boolean validateDirectory(FileEditDirectory aDirectory, File aFile) {
try {
- return (aFile.getCanonicalPath().startsWith(rootDirectory.getCanonicalPath()));
+ return (aFile.getCanonicalPath().startsWith(aDirectory.getRootDirectory().getCanonicalPath()));
}
catch (Throwable t) {
return false;
}
}
- protected boolean validateFile(File aFile) {
+ protected boolean validateFile(FileEditDirectory aDirectory, File aFile) {
try {
- return filter.accept(aFile.getParentFile(), aFile.getName());
+ return aDirectory.getFilter().accept(aFile.getParentFile(), aFile.getName());
}
catch (Throwable t) {
return false;
<call ListTable(contentlist, data_keys, column_head_texts, column_head_CSS, listrow1CSS, listrow2CSS, footer_css, module_name)>
<call PrevNextPage(module_name)>
<else>
- <P align="center" class="box">${lang("no-matches_found")}</p>
+ <P align="center" class="box">${lang("no_matches_found")}</p>
</if>
<p>
[
<a href="${config.actionRoot}?module=Content&do=edit&id=${entry.to_content.id}">
${lang("edit")}
- </a> |
+ </a> |
<a href="${entry.publicurl}">
${lang("start.show")}
</a> |
${utility.encodeHTML(entry.description)}
<if entry.main_url><br>URL: ${entry.main_url}</if>
- <div class="bg-neutral small">
+ <br>
+<!-- <div class="bg-neutral small">-->
<if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="0">
<list entry.operations as op>
[ <a href="${config.actionRoot}?module=Localizer&do=commentoperation&operation=${op}&id=${entry.id}&returnurl=${utility.encodeURI(thisurl + "#" + entry.id)}">${lang("comment.operation."+op)}</a> ]
</if>
<if entry.operations> | </if>
<a href="${config.actionRoot}?module=Comment&do=edit&id=${entry.id}">${lang("edit")}</a>
- </div>
+<!-- </div>-->
</td>
<td valign="top">
- <a class="small" href="${config.actionRoot}?module=Comment&do=delete&id=${entry.id}&searchtext=${utility.encodeHTML(searchtext)}&searchfield=${utility.encodeHTML(searchfield)}&searchispublished=${searchispublished}&searchorder=${searchorder}&offset=${offset}">[${lang("delete")}]</a>
+ <if config["Mir.Localizer.Admin.AllowDeleteComment"]=="1">
+ <a class="small" href="${config.actionRoot}?module=Comment&do=delete&id=${entry.id}&searchtext=${utility.encodeHTML(searchtext)}&searchfield=${utility.encodeHTML(searchfield)}&searchispublished=${searchispublished}&searchorder=${searchorder}&offset=${offset}">[${lang("delete")}]</a>
+ </if>
</td>
</tr>
</list>
</if>
<else>
-<P align="center" class="box">${lang("no-matches_found")}</p>
+<P align="center" class="box">${lang("no_matches_found")}</p>
</if>
<include "foot.template">
<include "head_nonavi.template">
<form method="post" action="${config.actionRoot}">
<table><tr><td>
- <p class="box-head" align="center"><b>${lang("confirm.really-delete")}</b></p>
+ <p class="box-head" align="center"><b>${lang("confirm.really_delete")}</b></p>
<p class="box" align="center">
<input type="hidden" name="module" value="${data.module}">
<input type="hidden" name="do" value="delete">
</td>
<td valign="top" class="listcommand">
<if showactions=="1">
- <a href="${config.actionRoot}?module=Content&do=delete&id=${entry.id}&where=${utility.encodeURI(where)}&order=${utility.encodeURI(order)}&offset=${utility.encodeURI(offset)}">[${lang("delete")}]</a>
+ <if config["Mir.Localizer.Admin.AllowDeleteArticle"]=="1">
+ <a href="${config.actionRoot}?module=Content&do=delete&id=${entry.id}&where=${utility.encodeURI(where)}&order=${utility.encodeURI(order)}&offset=${utility.encodeURI(offset)}">[${lang("delete")}]</a>
+ </if>
</if>
</td>
</tr>
<else>
-<p align="center" class="box">${lang("no-matches_found")}</p>
+<p align="center" class="box">${lang("no_matches_found")}</p>
</if>
<include "foot.template">
<form action="${config.actionRoot}" method="post">
<input type="hidden" name="module" value="FileEdit">
<input type="hidden" name="filename" value="${filename}">
+ <input type="hidden" name="entry" value="${entry}">
<input type="hidden" name="subdirectory" value="${subdirectory}">
<input type="hidden" name="do" value="update">
<input type="submit" name="save" value="${lang("save")}">
<include "head.template">
-<table cellpadding="16"><tr><td valign="top">
-
-
-<if dirlist || updir>
-<table border="0" cellpadding="2" cellspacing="2">
-
- <tr>
- <td class="table-head"><b>${lang("fileeditlist.dirname")}</b></td>
- <td class="table-head"> </td>
- </tr>
- <assign grey="0">
-
-<if updir>
- <tr class="list1">
- <td> .. </td>
- <td><a class="tablecommand" href="${config.actionRoot}?module=FileEdit&do=enter&subdirectory=${utility.encodeURI(updir)}&directory=">${lang("edit")}</a></td>
- </tr>
-</if>
-
-<if dirlist>
- <list dirlist as entry>
- <if grey=="1">
- <assign grey="0">
- <tr class="listrow1">
- <else>
- <tr class="listrow2">
- <assign grey="1">
- </if>
- <td> ${entry} </td>
- <td class="tablecommand"><a href="${config.actionRoot}?module=FileEdit&do=enter&subdirectory=${utility.encodeURI(subdirectory)}&directory=${utility.encodeURI(entry)}">${lang("edit")}</a></td>
- </tr>
- </list>
- </if>
-
-</table>
-</if>
-
-
-</td>
-<td valign="top">
-
-
-<if filelist || updir || dirlist>
-
-</if>
-
-<if filelist>
-
-<table border="0" cellpadding="2" cellspacing="2">
-
- <tr>
- <td class="table-head"><b>${lang("fileeditlist.filename")}</b></td>
- <td class="table-head"> </td>
- </tr>
-<assign grey="0">
-<list filelist as entry>
- <if grey=="1">
- <assign grey="0"><tr class="listrow1">
- <else><tr class="listrow2">
- <assign grey="1">
- </if>
- <td>${entry} </td>
- <td class="tablecommand"><a href="${config.actionRoot}?module=FileEdit&do=edit&subdirectory=${utility.encodeURI(subdirectory)}&filename=${utility.encodeURI(entry)}">${lang("edit")}</a></td>
- </tr>
-</list>
-</table>
-
-</td></tr></table>
-
-
-<P>
-<else>
- <P align="center" class="box">${lang("no-matches_found")}</p>
-</if>
-<include "foot.template">
-</body>
+ <table cellpadding="16">
+ <tr>
+ <td valign="top">
+
+
+ <if dirlist || updir>
+ <table border="0" cellpadding="2" cellspacing="2">
+
+ <tr>
+ <td class="table-head"><b>${lang("fileeditlist.dirname")}</b></td>
+ <td class="table-head"> </td>
+ </tr>
+ <assign grey="0">
+
+ <if updir>
+ <tr class="list1">
+ <td> .. </td>
+ <td><a class="tablecommand" href="${config.actionRoot}?module=FileEdit&do=enter&entry=${entry}&subdirectory=${utility.encodeURI(updir)}&directory=">${lang("edit")}</a></td>
+ </tr>
+ </if>
+
+ <if dirlist>
+ <list dirlist as item>
+ <if grey=="1">
+ <assign grey="0">
+ <tr class="listrow1">
+ <else>
+ <tr class="listrow2">
+ <assign grey="1">
+ </if>
+ <td> ${item} </td>
+ <td class="tablecommand"><a href="${config.actionRoot}?module=FileEdit&do=enter&entry=${entry}&subdirectory=${utility.encodeURI(subdirectory)}&directory=${utility.encodeURI(item)}">${lang("edit")}</a></td>
+ </tr>
+ </list>
+ </if>
+
+ </table>
+ </if>
+
+
+ </td>
+ <td valign="top">
+
+ <table border="0" cellpadding="2" cellspacing="2">
+
+ <tr>
+ <td class="table-head"><b>${lang("fileeditlist.filename")}</b></td>
+ <td class="table-head"> </td>
+ </tr>
+ <if filelist>
+ <assign grey="0">
+ <list filelist as item>
+ <if grey=="1">
+ <assign grey="0">
+ <tr class="listrow1">
+ <else>
+ <tr class="listrow2">
+ <assign grey="1">
+ </if>
+ <td>${item} </td>
+ <td class="tablecommand"><a href="${config.actionRoot}?module=FileEdit&do=edit&entry=${entry}&subdirectory=${utility.encodeURI(subdirectory)}&filename=${utility.encodeURI(item)}">${lang("edit")}</a></td>
+ </tr>
+ </list>
+ <else>
+ <tr><td colspan="2">
+ <P align="center" class="box">${lang("no_matches_found")}</p>
+ </tr></tr>
+ </if>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ <P>
+
+ <include "foot.template">
+ </body>
</html>
</list>
<else>
- <tr><td><div class="box" align="center"><b>${lang("no-matches_found")}</b></div></td></tr>
+ <tr><td><div class="box" align="center"><b>${lang("no_matches_found")}</b></div></td></tr>
</if>
</tr>
<else>
- <tr><td align="center" class="box" colspan="7">${lang("no-matches_found")}</td></tr>
+ <tr><td align="center" class="box" colspan="7">${lang("no_matches_found")}</td></tr>
</if>
</table>
<a href="${config.actionRoot}?module=Mediafolder&do=list&where=${data.where}&nextoffset=${data.next}&next=weiter">${lang("list.next")}</a>
</if>
<else>
- <P align="center" class="box">${lang("no-matches_found")}</p>
+ <P align="center" class="box">${lang("no_matches_found")}</p>
</if>
<p>
<p class="box-head"><b>${lang("start.extra.title")}</b></p>
<p class="box">
- <a href="${config.actionRoot}?module=Hidden&do=list">> ${lang("start.content.hidden")}</a><br>
- <a href="${config.actionRoot}?module=FileEdit&do=list">> ${lang("start.fileedit.title")}</a>
+ <a href="${config.actionRoot}?module=Hidden&do=list">> ${lang("start.content.hidden")}</a>
+ <list fileeditentries as e>
+ <br>
+ <a href="${config.actionRoot}?module=FileEdit&do=list&entry=${e}">> ${lang("start.fileedit."+e+".title")}</a>
+ </list>
</p>
</td>