comment.article=del artículo\r
\r
commentlist.htmltitle=lista de comentarios\r
-commentlist.produced=producido\r
+commentlist.published=publicado\r
commentlist.hidden=oculto\r
-commentlist.search=buscar!\r
+commentlist.search=buscar!
+
+commentlist.order.datedesc= date (desc.) # needs translation
+commentlist.order.dateasc= date (asc.) # needs translation
+commentlist.order.articletitle= article title # needs translation
+\r
\r
# confirm\r
confirm.htmltitle=confirmar borrado\r
content.modificationdate=último cambio\r
content.status=Estado\r
content.type=Tipo de artículo\r
+content.published=publicado
+content.comments=Comentarios\r
\r
contentlist.htmltitle=lista de contenidos\r
\r
########## admin ##########
# language: deutsch / german
-# $Id: admin_de.properties,v 1.17 2002/11/30 20:21:00 zapata Exp $
+# $Id: admin_de.properties,v 1.18 2002/12/01 22:12:25 zapata Exp $
# general
yes=ja
comment.article=zu artikel
commentlist.htmltitle=commentlist
-commentlist.produced=produziert
+commentlist.published=publiziert
commentlist.hidden=versteckt
commentlist.search=go!
+commentlist.order.datedesc= date (desc.) # needs translation
+commentlist.order.dateasc= date (asc.) # needs translation
+commentlist.order.articletitle= article title # needs translation
+
+
# confirm
confirm.htmltitle=confirm delete
confirm.really_delete=Datensatz wirklich löschen?
content.import_date=Importiert
content.lastchange_date=zuletzt geäendert
content.create_date=Datum
+content.published=publiziert
+content.comments=Ergänzungen
contentlist.htmltitle=contentlist
########## admin ##########
# language: english
-# $Id: admin_en.properties,v 1.25 2002/11/30 20:21:00 zapata Exp $
+# $Id: admin_en.properties,v 1.26 2002/12/01 22:12:25 zapata Exp $
# general
yes=yes
comment.article=for article
commentlist.htmltitle=Comments
-commentlist.produced=produced
+commentlist.published=published
commentlist.hidden=hidden
commentlist.search=go!
+commentlist.order.datedesc= date (desc.)
+commentlist.order.dateasc= date (asc.)
+commentlist.order.articletitle= article title
+
+
# confirm
confirm.htmltitle=confirm delete
confirm.really_delete=Do you really want to delete this entry?
content.import_date=Import date
content.lastchange_date=Last modified
content.create_date=Date
+content.published=published
+content.comments=Comments
+
contentlist.htmltitle=Articles
########## admin ##########
# language: espanol / spanish
-# $Id: admin_es.properties,v 1.9 2002/11/30 20:21:00 zapata Exp $
+# $Id: admin_es.properties,v 1.10 2002/12/01 22:12:25 zapata Exp $
# general
yes=sí
comment.article=del artículo
commentlist.htmltitle=lista de comentarios
-commentlist.produced=producido
+commentlist.published=publicado
commentlist.hidden=oculto
commentlist.search=buscar!
+commentlist.order.datedesc= date (desc.) # needs translation
+commentlist.order.dateasc= date (asc.) # needs translation
+commentlist.order.articletitle= article title # needs translation
+
+
# confirm
confirm.htmltitle=confirmar borrado
confirm.really_delete=Desea borrar esta entrada?
content.modificationdate=último cambio
content.status=Estado
content.type=Tipo de artículo
+content.published=publicado
+content.comments=Comentarios
contentlist.htmltitle=lista de contenidos
comment.article=del artículo
commentlist.htmltitle=lista de comentarios
-commentlist.produced=producido
+commentlist.published=publicado
commentlist.hidden=oculto
commentlist.search=buscar!
+commentlist.order.datedesc= date (desc.) # needs translation
+commentlist.order.dateasc= date (asc.) # needs translation
+commentlist.order.articletitle= article title # needs translation
+
+
# confirm
confirm.htmltitle=confirmar borrado
confirm.really_delete=Desea borrar esta entrada?
content.modificationdate=último cambio
content.status=Estado
content.type=Tipo de artículo
+content.published=publicado
+content.comments=Comentarios
contentlist.htmltitle=lista de contenidos
comment.article=del artículo
commentlist.htmltitle=lista de comentarios
-commentlist.produced=producido
+commentlist.published=publicado
commentlist.hidden=oculto
commentlist.search=buscar!
+commentlist.order.datedesc= date (desc.) # needs translation
+commentlist.order.dateasc= date (asc.) # needs translation
+commentlist.order.articletitle= article title # needs translation
+
+
# confirm
confirm.htmltitle=confirmar borrado
confirm.really_delete=Desea borrar esta entrada?
content.modificationdate=último cambio
content.status=Estado
content.type=Tipo de artículo
+content.published=publicado
+content.comments=Comentarios
contentlist.htmltitle=lista de contenidos
theLog = Logfile.getInstance(MirConfig.getProp("Home") + MirConfig.getProp("Entity.Logfile"));
}
- /**
- * Constructor.
- */
+ /**
+ * Constructor.
+ */
public EntityList(){ }
- /* get/set EntityClass of Objects stored in EntityList */
+/* get/set EntityClass of Objects stored in EntityList */
public void setStorage(StorageObject storage) { this.theStorage=storage; }
public StorageObject getStorage() { return theStorage; }
public void setLimit(int limit) { this.limit = limit; }
- /**
- * Sets the WHERE clause that fetched the Entities of this EntityList from the database.
- * @param wc The string that contains the WHERE clause
- */
- public void setWhere(String wc) {
- this.whereClause = wc;
- }
-
- /**
- * Returns the WHERE clause that returned this EntityList from the database
- * @return whereClause The WHERE clause
- */
- public String getWhere() {
- return whereClause;
- }
-
-
- /**
- * Sets the sorting criterium of this EntityList
- * @param oc
- */
- public void setOrder(String oc) {
- this.orderClause = oc;
- }
-
- /**
- * Returns the sorting criterium.
- * @return orderClause The sort order
- */
- public String getOrder() {
- return orderClause;
- }
-
- /**
- * Sets the number of rows that match the WHERE clause
- * @param i The number of rows that match the WHERE clause
- */
- public void setCount(int i) {
- this.count = i;
- }
-
- /**
- * Returns the number of rows that match the WHERE clause
- * @return The number of rows ...
- */
- public int getCount() {
- return count;
- }
-
- /**
- * Sets the offset
- * @param i The offset
- */
- public void setOffset(int i) {
- offset = i;
- }
-
- /**
- * Returns the offset
- * @return offset
- */
- public int getOffset() {
- return offset;
- }
-
- /**
- * Sets the offset of the next batch of Entities.
- * @param i The next offset
- */
- public void setNextBatch(int i) {
- offsetnext = i;
- }
-
- /**
- * Returns the offset of the next batch of Entities.
- * @return offset of the next batch
- */
- public int getNextBatch() {
- return offsetnext;
- }
-
- /**
- * Returns whether there is a next batch within the WHERE clause
- * @return true if yes, false if no.
- */
- public boolean hasNextBatch() {
- return (offsetnext >= 0);
- }
-
- /**
- * Sets the offset of the previous batch.
- * @param i the previous offset
- */
- public void setPrevBatch(int i) {
- offsetprev = i;
- }
-
- /**
- * Returns the offset of the previous batch.
- * @return offset of the previous batch
- */
- public int getPrevBatch() {
- return offsetprev;
- }
-
- /**
- * Returns whether there is a previous batch.
- * @return true if yes, false if no
- */
- public boolean hasPrevBatch() {
- return (offsetprev >= 0);
- }
-
- /**
- * Returns the start index of the batch.
- * @return
- */
- public int getFrom() {
- return offset+1;
- }
-
- /**
- * Returns the end index of the batch.
- * @return
- */
- public int getTo() {
- if (hasNextBatch())
- return offsetnext;
- else
- return count;
- }
+ /**
+ * Sets the WHERE clause that fetched the Entities of this EntityList from the database.
+ * @param wc The string that contains the WHERE clause
+ */
+ public void setWhere(String wc) {
+ this.whereClause = wc;
+ }
+
+ /**
+ * Returns the WHERE clause that returned this EntityList from the database
+ * @return whereClause The WHERE clause
+ */
+ public String getWhere() {
+ return whereClause;
+ }
+
+
+ /**
+ * Sets the sorting criterium of this EntityList
+ * @param oc
+ */
+ public void setOrder(String oc) {
+ this.orderClause = oc;
+ }
+
+ /**
+ * Returns the sorting criterium.
+ * @return orderClause The sort order
+ */
+ public String getOrder() {
+ return orderClause;
+ }
+
+ /**
+ * Sets the number of rows that match the WHERE clause
+ * @param i The number of rows that match the WHERE clause
+ */
+ public void setCount(int i) {
+ this.count = i;
+ }
+
+ /**
+ * Returns the number of rows that match the WHERE clause
+ * @return The number of rows ...
+ */
+ public int getCount() {
+ return count;
+ }
+
+ /**
+ * Sets the offset
+ * @param i The offset
+ */
+ public void setOffset(int i) {
+ offset = i;
+ }
+
+ /**
+ * Returns the offset
+ * @return offset
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Sets the offset of the next batch of Entities.
+ * @param i The next offset
+ */
+ public void setNextBatch(int i) {
+ offsetnext = i;
+ }
+
+ /**
+ * Returns the offset of the next batch of Entities.
+ * @return offset of the next batch
+ */
+ public int getNextBatch() {
+ return offsetnext;
+ }
+
+ /**
+ * Returns whether there is a next batch within the WHERE clause
+ * @return true if yes, false if no.
+ */
+ public boolean hasNextBatch() {
+ return (offsetnext >= 0);
+ }
+
+ /**
+ * Sets the offset of the previous batch.
+ * @param i the previous offset
+ */
+ public void setPrevBatch(int i) {
+ offsetprev = i;
+ }
+
+ /**
+ * Returns the offset of the previous batch.
+ * @return offset of the previous batch
+ */
+ public int getPrevBatch() {
+ return offsetprev;
+ }
+
+ /**
+ * Returns whether there is a previous batch.
+ * @return true if yes, false if no
+ */
+ public boolean hasPrevBatch() {
+ return (offsetprev >= 0);
+ }
+
+ /**
+ * Returns the start index of the batch.
+ * @return
+ */
+ public int getFrom() {
+ return offset+1;
+ }
+
+ /**
+ * Returns the end index of the batch.
+ * @return
+ */
+ public int getTo() {
+ if (hasNextBatch())
+ return offsetnext;
+ else
+ return count;
+ }
/**
* Inserts an Entity into the EntityList.
public void add (Entity anEntity) {
if (anEntity!=null)
- theEntityArrayList.add(anEntity);
+ theEntityArrayList.add(anEntity);
else
- theLog.printWarning("EntityList: add called with empty Entity");
+ theLog.printWarning("EntityList: add called with empty Entity");
}
}
- // The following methods have to be implemented
- // for this class to be an implementation of the
- // TemplateListModel of the Freemarker packages
+// The following methods have to be implemented
+// for this class to be an implementation of the
+// TemplateListModel of the Freemarker packages
public TemplateModel get(int i) { return elementAt(i); }
public boolean isRewound() { return (freemarkerListPointer==-1) ? true : false; }
public TemplateModel next() {
if (hasNext()) {
- freemarkerListPointer++;return get(freemarkerListPointer); }
+ freemarkerListPointer++;return get(freemarkerListPointer); }
else return null;
}
}
- // Methods to implement StorableObject
+// Methods to implement StorableObject
public Set getNotifyOnReleaseSet() { return null; }
public StoreIdentifier getStoreIdentifier() {
if ( theStorage!=null ) {
return
- new StoreIdentifier( this, StoreContainerType.STOC_TYPE_ENTITYLIST,
- StoreUtil.getEntityListUniqueIdentifierFor( theStorage.getTableName(),
- whereClause, orderClause, offset, limit ));
+ new StoreIdentifier( this, StoreContainerType.STOC_TYPE_ENTITYLIST,
+ StoreUtil.getEntityListUniqueIdentifierFor( theStorage.getTableName(),
+ whereClause, orderClause, offset, limit ));
}
theLog.printWarning("EntityList could not return StoreIdentifier");
return null;
--- /dev/null
+package mir.util;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+public class HTTPRequestParser {
+ private HttpServletRequest request;
+
+ public HTTPRequestParser(HttpServletRequest aRequest) {
+ request = aRequest;
+ }
+
+ public boolean hasParameter(String aName) {
+ return request.getParameter(aName)!=null;
+ }
+
+ public String getParameterWithDefault(String aName, String aDefault) {
+ if (hasParameter(aName))
+ return request.getParameter(aName);
+ else
+ return aDefault;
+ }
+
+ public String getParameter(String aName) {
+ return getParameterWithDefault(aName, "");
+ }
+
+ public int getIntegerWithDefault(String aName, int aDefault) {
+ int result = aDefault;
+ String value = getParameter(aName);
+
+ try {
+ result = Integer.parseInt(value);
+ }
+ catch (Throwable t) {
+ }
+ return result;
+ }
+}
\ No newline at end of file
--- /dev/null
+package mir.util;
+
+import java.util.*;
+
+public class URLBuilder {
+ private Map keyValues;
+ private String base;
+
+ public URLBuilder(String aBase) {
+ keyValues = new HashMap();
+ base = aBase;
+ }
+
+ public URLBuilder() {
+ this("");
+ }
+
+ public void setValue(String aKey, String aValue) {
+ keyValues.put(aKey, aValue);
+ }
+
+ public void setValue(String aKey, int aValue) {
+ keyValues.put(aKey, Integer.toString(aValue));
+ }
+
+ public void deleteKey(String aKey) {
+ keyValues.remove(aKey);
+ }
+
+ public String getQuery() {
+ StringBuffer query = new StringBuffer();
+ Iterator i;
+
+ i = keyValues.entrySet().iterator();
+
+ while(i.hasNext()) {
+ Map.Entry entry = (Map.Entry) i.next();
+
+ query.append(HTMLRoutines.encodeURL((String) entry.getKey()));
+ query.append("=");
+ query.append(HTMLRoutines.encodeURL((String) entry.getValue()));
+
+ if (i.hasNext())
+ query.append("&");
+ }
+
+ return query.toString();
+ }
+
+ public String getUrl() {
+ return base + "?" + getQuery();
+ }
+}
\ No newline at end of file
/**
* This class maps one line of the comment-table to a java-object.
*
- * @author $Author: mh $
- * @version $Revision: 1.10 $ $Date: 2002/09/01 22:05:53 $
+ * @author $Author: zapata $
+ * @version $Revision: 1.11 $ $Date: 2002/12/01 22:13:37 $
*/
{
if (theStringValues != null) {
if (!theStringValues.containsKey("is_published")) {
- theStringValues.put("is_published","0");
- }
+ theStringValues.put("is_published","0");
+ }
- if (theStringValues.containsKey("main_url")){
- if (((String)theStringValues.get("main_url")).equalsIgnoreCase("http://")) {
- theStringValues.remove("main_url");
- } else if ((!((String)theStringValues.get("main_url")).startsWith("http://"))
- && ((String)theStringValues.get("main_url")).length()>0){
- theStringValues.put("main_url","http://"+((String)theStringValues.get("main_url")));
- }
- }
+ if (theStringValues.containsKey("main_url")){
+ if (((String)theStringValues.get("main_url")).equalsIgnoreCase("http://")) {
+ theStringValues.remove("main_url");
+ }
+ else if ((!((String)theStringValues.get("main_url")).startsWith("http://"))
+ && ((String)theStringValues.get("main_url")).length()>0) {
+ theStringValues.put("main_url","http://"+((String)theStringValues.get("main_url")));
+ }
+ }
}
super.setValues(theStringValues);
}
- /**
- * overridden method getValue to include formatted date into every
- * entityContent
- */
+ /**
+ * overridden method getValue to include formatted date into every
+ * entityContent
+ */
- public String getValue(String field)
+ public String getValue(String field)
{
String returnField = null;
if (field!=null)
{
if (field.equals("date_formatted") || field.equals("webdb_create_short"))
{
- if (hasValueForField("webdb_create"))
- returnField = StringUtil.dateToReadableDate(getValue("webdb_create"));
- }
+ if (hasValueForField("webdb_create"))
+ returnField = StringUtil.dateToReadableDate(getValue("webdb_create"));
+ }
else if (field.equals("description_parsed")) {
/** @todo the config stuff should be moved to StringUtil */
String extLinkName = MirConfig.getProp("Producer.ExtLinkName");
return super.getValue(field);
}
return returnField;
- }
-
-
+ }
}
private ServletModuleComment() {
logger = new LoggerWrapper("ServletModule.Comment");
+
templateListString = MirConfig.getProp("ServletModule.Comment.ListTemplate");
templateObjektString = MirConfig.getProp("ServletModule.Comment.ObjektTemplate");
templateConfirmString = MirConfig.getProp("ServletModule.Comment.ConfirmTemplate");
+
try {
mainModule = new ModuleComment(DatabaseComment.getInstance());
moduleContent = new ModuleContent(DatabaseContent.getInstance());
}
}
- public void list(HttpServletRequest req, HttpServletResponse res)
- throws ServletModuleException
+ public void list(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleException
{
- // Parameter auswerten
- SimpleHash mergeData = new SimpleHash();
- String query_text = req.getParameter("query_text");
- mergeData.put("query_text",query_text);
- if (query_text!=null) mergeData.put("query_text_encoded",URLEncoder.encode(query_text));
- String query_field = req.getParameter("query_field");
- mergeData.put("query_field",query_field);
- String query_is_published = req.getParameter("query_is_published");
- mergeData.put("query_is_published",query_is_published);
-
- String offset = req.getParameter("offset");
- if (offset==null || offset.equals("")) offset="0";
- mergeData.put("offset",offset);
-
- // patching order
- String order = req.getParameter("order");
- if(order!=null) {
- mergeData.put("order", order);
- mergeData.put("order_encoded", URLEncoder.encode(order));
- if (order.equals("webdb_create")) order="webdb_create desc";
- }
+ HTTPRequestParser requestParser = new HTTPRequestParser(aRequest);
- // sql basteln
- String whereClause=""; boolean isFirst=true;
- if (query_text!=null && !query_text.equalsIgnoreCase("")) {
- whereClause += "lower("+query_field+") like lower('%"+query_text+"%')"; isFirst=false;}
- if (query_is_published != null && !query_is_published.equals("")) {
- if (isFirst==false) whereClause+=" and ";
- whereClause += "is_published='"+query_is_published+"'";
- isFirst=false;
- }
+ String where = requestParser.getParameter("where");
+ String order = requestParser.getParameter("order");
+ int offset = requestParser.getIntegerWithDefault("offset", 0);
- logger.debug("list comments: whereclause = " + whereClause + ", order = " + order + ", offset = " + offset);
+ returnCommentList(aRequest, aResponse, where, order, offset);
+ }
- // fetch und ausliefern
- try {
+ public void search(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleException
+ {
+ HTTPRequestParser requestParser = new HTTPRequestParser(aRequest);
- if (query_text!=null || query_is_published!=null ) {
- EntityList theList = mainModule.getByWhereClause(whereClause, order, (new Integer(offset)).intValue());
- if (theList!=null && theList.size()>0) {
-
- //make articleHash for comment
- StringBuffer buf= new StringBuffer("id in (");boolean first=true;
- for(int i=0;i<theList.size();i++) {
- if (first==false) buf.append(",");
- first=false;
- buf.append(theList.elementAt(i).getValue("to_media"));
- }
- buf.append(")");
- SimpleHash articleHash = HTMLTemplateProcessor.makeSimpleHash(moduleContent.getByWhereClause(buf.toString(),-1));
- mergeData.put("articleHash", articleHash);
-
- // get comment
- mergeData.put("contentlist",theList);
- mergeData.put("count", (new Integer(theList.getCount())).toString());
- mergeData.put("from", (new Integer(theList.getFrom())).toString());
- mergeData.put("to", (new Integer(theList.getTo())).toString());
- if (theList.hasNextBatch())
- mergeData.put("next", (new Integer(theList.getNextBatch())).toString());
- if (theList.hasPrevBatch())
- mergeData.put("prev", (new Integer(theList.getPrevBatch())).toString());
- }
- }
- // raus damit
- HTMLTemplateProcessor.process(res, templateListString, mergeData, res.getWriter(), getLocale(req));
- }
- catch (ModuleException e) {throw new ServletModuleException(e.toString());}
- catch (IOException e) {throw new ServletModuleException(e.toString());}
- catch (Exception e) {throw new ServletModuleException(e.toString());}
- }
+ String queryField = "";
+ String searchField = requestParser.getParameter("searchfield");
+ String searchText = requestParser.getParameter("searchtext");
+ String searchIsPublished = requestParser.getParameter("searchispublished");
+ String searchOrder = requestParser.getParameter("searchorder");
- public void showArticleCommentList(Object aWriter, int anOffset, int anArticleId, Locale aLocale) throws ServletModuleException {
- int nrCommentsPerPage = 20;
+ String whereClause = " (1=1) ";
+ String orderClause = "webdb_create desc";
- Object comments;
- Map generationData;
- Generator generator;
- int totalNrComments;
- EntityAdapterModel model;
- MessageResources messages = MessageResources.getMessageResources("bundles.admin");
+ if (searchIsPublished.equals("0")) {
+ whereClause=whereClause + "is_published='f'";
+ }
+ else if (searchIsPublished.equals("1")) {
+ whereClause=whereClause + "is_published='t'";
+ }
- try {
- generator = MirGlobal.localizer().generators().makeAdminGeneratorLibrary().makeGenerator("admin/commentlist2.template");
- model = MirGlobal.localizer().dataModel().adapterModel();
+ if (!searchField.equals("") && !searchText.equals("")) {
+ queryField="";
- generationData = new HashMap();
- MirGlobal.localizer().producerAssistant().initializeGenerationValueSet(generationData);
-
- comments =
- new CachingRewindableIterator(
- new EntityIteratorAdapter( "to_media = " + anArticleId,
- "webdb_create desc",
- nrCommentsPerPage,
- model,
- "comment",
- nrCommentsPerPage,
- anOffset
- )
- );
-
- totalNrComments = model.getMappingForName("comment").getStorage().getSize("to_media = " + anArticleId);
-
- generationData.put( "comments", comments);
- generationData.put( "offset", new Integer(anOffset));
- generationData.put( "articleid", new Integer(anArticleId));
- generationData.put( "lang", new MessageMethodModel(aLocale, messages) );
- generationData.put( "thisurl", "module=Comment&do=listarticlecomments&offset="+anOffset+"&articleid="+anArticleId);
+ if (searchField.equals("title"))
+ queryField = "title";
+ else if (searchField.equals("creator"))
+ queryField = "creator";
+ else if (searchField.equals("description"))
+ queryField = "description";
+ else
+ queryField = "";
- if (anOffset>0) {
- generationData.put( "previousurl", "module=Comment&do=listarticlecomments&offset="+
- Math.max( 0, anOffset - nrCommentsPerPage )+"&articleid="+anArticleId);
- generationData.put("previous", new Integer(Math.max( 0, anOffset - nrCommentsPerPage )));
- }
+ if (!queryField.equals("")) {
+ if (!whereClause.equals(""))
+ whereClause = whereClause + " and ";
- if (anOffset + nrCommentsPerPage < totalNrComments) {
- generationData.put( "nexturl", "module=Comment&do=listarticlecomments&offset="+
- Math.min( anOffset + nrCommentsPerPage, totalNrComments-1 )+"&articleid="+anArticleId);
- generationData.put("next", new Integer(Math.min( anOffset + nrCommentsPerPage, totalNrComments-1 )));
+ // ML: searchText must be properly escaped!
+ whereClause = whereClause + "lower(" + queryField + ") like '%" + searchText.toLowerCase() + "%'";
}
+ }
- generator.generate(aWriter, generationData, new PrintWriter(new NullWriter()));
+ System.out.println("search order = " + searchOrder);
+
+ if (searchOrder.equals("datedesc")) {
+ orderClause = "webdb_create desc";
+ }
+ else if (searchOrder.equals("dateasc")) {
+ orderClause = "webdb_create asc";
}
- catch (Throwable t) {
- t.printStackTrace(System.out);
- throw new ServletModuleException(t.getMessage());
+ else if (searchOrder.equals("articletitle")) {
+ orderClause = "(select content.title from content where content.id = comment.to_media) asc";
}
+
+ returnCommentList(aRequest, aResponse, whereClause, orderClause, 0);
}
- public void listarticlecomments(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException
+ public void articlecomments(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException
{
String articleIdString = req.getParameter("articleid");
- String offsetString = req.getParameter("offset");
- int offset = 0;
- int articleId = 0;
-
- try {
- offset = Integer.parseInt(offsetString);
- }
- catch (Throwable t) {
- }
+ int articleId;
try {
articleId = Integer.parseInt(articleIdString);
- showArticleCommentList( res.getWriter(), offset, articleId, getLocale(req));
+ returnCommentList( req, res, "to_media="+articleId, "webdb_create desc", 0);
}
catch (ServletModuleException e) {
throw e;
}
catch (Throwable e) {
- e.printStackTrace(System.out);
throw new ServletModuleException(e.getMessage());
}
}
- public void performarticlecommentsoperation(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException {
- String commentIdString = req.getParameter("commentid");
- String articleIdString = req.getParameter("articleid");
- String offsetString = req.getParameter("offset");
- String operation = req.getParameter("operation");
- int offset = 0;
- int articleId = 0;
+ public void returnCommentList(HttpServletRequest aRequest, HttpServletResponse aResponse,
+ String aWhereClause, String anOrderByClause, int anOffset) throws ServletModuleException {
+ // ML: experiment in using the producer's generation system instead of the
+ // old one...
+
+ HTTPRequestParser requestParser = new HTTPRequestParser(aRequest);
+ URLBuilder urlBuilder = new URLBuilder();
+ EntityAdapterModel model;
+ int nrCommentsPerPage = 20;
+ int count;
try {
- articleId = Integer.parseInt(articleIdString);
+ Map responseData = ServletHelper.makeGenerationData(getLocale(aRequest));
+ model = MirGlobal.localizer().dataModel().adapterModel();
- showArticleCommentList( res.getWriter(), offset, articleId, getLocale(req));
- }
- catch (ServletModuleException e) {
- throw e;
+ Object commentList =
+ new CachingRewindableIterator(
+ new EntityIteratorAdapter( aWhereClause, anOrderByClause, nrCommentsPerPage,
+ MirGlobal.localizer().dataModel().adapterModel(), "comment", nrCommentsPerPage, anOffset)
+ );
+
+ responseData.put("nexturl", null);
+ responseData.put("prevurl", null);
+
+ count=mainModule.getSize(aWhereClause);
+
+ urlBuilder.setValue("module", "Comment");
+ urlBuilder.setValue("do", "list");
+ urlBuilder.setValue("where", aWhereClause);
+ urlBuilder.setValue("order", anOrderByClause);
+
+ urlBuilder.setValue("searchfield", requestParser.getParameter("searchfield"));
+ urlBuilder.setValue("searchtext", requestParser.getParameter("searchtext"));
+ urlBuilder.setValue("searchispublished", requestParser.getParameter("searchispublished"));
+ urlBuilder.setValue("searchorder", requestParser.getParameter("searchorder"));
+
+ responseData.put("searchfield", requestParser.getParameter("searchfield"));
+ responseData.put("searchtext", requestParser.getParameter("searchtext"));
+ responseData.put("searchispublished", requestParser.getParameter("searchispublished"));
+ responseData.put("searchorder", requestParser.getParameter("searchorder"));
+
+ urlBuilder.setValue("offset", anOffset);
+ responseData.put("thisurl" , urlBuilder.getQuery());
+
+ if (count>=anOffset+nrCommentsPerPage) {
+ urlBuilder.setValue("offset", anOffset + nrCommentsPerPage);
+ responseData.put("nexturl" , urlBuilder.getQuery());
+ }
+
+ if (anOffset>0) {
+ urlBuilder.setValue("offset", Math.max(anOffset - nrCommentsPerPage, 0));
+ responseData.put("prevurl" , urlBuilder.getQuery());
+ }
+
+ responseData.put("comments", commentList);
+ responseData.put("from" , Integer.toString(anOffset+1));
+ responseData.put("count", Integer.toString(count));
+ responseData.put("to", Integer.toString(Math.min(anOffset+nrCommentsPerPage, count)));
+
+ ServletHelper.generateResponse(aResponse.getWriter(), responseData, "commentlist.template");
}
catch (Throwable e) {
- e.printStackTrace(System.out);
+ e.printStackTrace(new PrintWriter(new LoggerToWriterAdapter(logger, logger.ERROR_MESSAGE)));
+
throw new ServletModuleException(e.getMessage());
}
}
}
+
* ServletModuleContent -
* deliver html for the article admin form.
*
- * @version $Id: ServletModuleContent.java,v 1.24 2002/11/30 19:45:56 zapata Exp $
+ * @version $Id: ServletModuleContent.java,v 1.25 2002/12/01 22:13:37 zapata Exp $
* @author rk, mir-coders
*
*/
public class ServletModuleContent extends ServletModule
{
-
static ModuleTopics themenModule;
static ModuleSchwerpunkt schwerpunktModule;
static ModuleImages imageModule;
// old one...
EntityAdapterModel model;
- int nrArticlesPerPage = 30;
+ int nrArticlesPerPage = 20;
int count;
try {
Object contentList =
new CachingRewindableIterator(
- new EntityIteratorAdapter( aWhereClause, anOrderByClause, 20,
+ new EntityIteratorAdapter( aWhereClause, anOrderByClause, nrArticlesPerPage,
MirGlobal.localizer().dataModel().adapterModel(), "content", nrArticlesPerPage, anOffset)
);
public static ServletModule getInstance() { return instance; }
private ModuleContent contentModule;
+ private ModuleComment commentModule;
private ServletModuleLocalizer() {
try {
contentModule = new ModuleContent(DatabaseContent.getInstance());
+ commentModule = new ModuleComment(DatabaseComment.getInstance());
logger = new LoggerWrapper("ServletModule.Localizer");
}
}
}
+ public void commentoperation(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleException {
+ String idString = aRequest.getParameter("id");
+ String operationString = aRequest.getParameter("operation");
+ String returnUrlString = aRequest.getParameter("returnurl");
- public void commentoperation(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException
- {
- try {
- String operationKey = req.getParameter("operation");
- String commentId = req.getParameter("commentid");
- EntityComment comment = (EntityComment) DatabaseComment.getInstance().selectById(commentId);
- MirAdminInterfaceLocalizer.MirSimpleEntityOperation operation =
- (MirAdminInterfaceLocalizer.MirSimpleEntityOperation)
- MirGlobal.localizer().adminInterface().simpleArticleOperationForName(operationKey);
+ MirAdminInterfaceLocalizer.MirSimpleEntityOperation operation;
+ EntityAdapter comment;
+ EntityComment entity;
- EntityAdapter adapter = MirGlobal.localizer().dataModel().adapterModel().makeEntityAdapter("comment", comment);
+ try {
+ entity = (EntityComment) commentModule.getById(idString);
- operation.perform( adapter );
+ if (entity!=null) {
+ comment = MirGlobal.localizer().dataModel().adapterModel().makeEntityAdapter("comment", entity);
+ operation = MirGlobal.localizer().adminInterface().simpleCommentOperationForName(operationString);
+ operation.perform(comment);
+ }
- res.sendRedirect(req.getParameter("returnuri"));
+ redirect(aResponse, returnUrlString);
}
- catch (Throwable t) {
- t.printStackTrace(System.out);
- throw new ServletModuleException(t.getMessage());
+ catch (Throwable e) {
+ e.printStackTrace(System.out);
+ throw new ServletModuleException(e.getMessage());
}
}
<form method="post" action="${config.actionRoot}">
<input type="hidden" name="module" value="Comment">
- <input type="hidden" name="where" value="${utility.encodeHTML(data.where)}">
- <input type="hidden" name="offset" value="${utility.encodeHTML(data.offset)}">
- <input type="hidden" name="order" value="${utility.encodeHTML(data.order)}">
<input type="hidden" name="id" value="${utility.encodeHTML(data.id)}">
<input type="hidden" name="date" value="${utility.encodeHTML(data.date)}">
<input type="hidden" name="to_media" value="${utility.encodeHTML(data.to_media)}">
- <if new> <input type="hidden" name="do" value="insert">
- <else> <input type="hidden" name="do" value="update">
+ <if new>
+ <input type="hidden" name="do" value="insert">
+ <else>
+ <input type="hidden" name="do" value="update">
</if>
<table border="0">
<tr>
<td align="right" class="darkgrey"><span class="witesmall">
<B>${lang("comment.date")}:</B></span></td>
- <td>${utility.encodeHTML(utility.encodeHTML(data.date))}</td>
+ <td>${utility.encodeHTML(utility.encodeHTML(data.webdb_create))}</td>
</tr>
<tr>
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
-<include "templates/admin/head.template">
-
-<table border="0" cellpadding="2" cellspacing="1">
- <tr>
- <td colspan="5">
- <form method="post" action="${config.actionRoot}">
- <input type="hidden" name="module" value="Comment">
- <input type="hidden" name="do" value="list">
- <input type="hidden" name="offset" value="${data.offset}">
- <input type="text" size="10" maxlength="20" name="query_text" value="${data.query_text}">
- <select name="query_field">
- <option value="title"<if data.query_field=="title"> selected</if>>${lang("comment.title")}</option>
- <option value="creator"<if data.query_field=="creator"> selected</if>>${lang("comment.creator")}</option>
- <option value="description"<if data.query_field=="description"> selected</if>>${lang("comment.text")}</option>
- </select>
- <select name="query_is_published">
- <option value="">--</option>
- <option value="0" <if data.query_is_published=="0"> selected</if>>${lang("commentlist.hidden")}</option>
- <option value="1" <if data.query_is_published=="1"> selected</if>>${lang("commentlist.produced")}</option>
- </select>
- <select name="order">
- <option value="webdb_create" <if data.order=="webdb_create"> selected</if>>${lang("comment.date")}</option>
- <option value="articletitle" <if data.order=="articletitle"> selected</if>>${lang("comment.title")}</option>
- </select>
- <input type="submit" name="search" value="${lang("commentlist.search")}">
- </form>
- </td>
- </tr>
-
+<include "head.template">
+<assign grey="0">
+
+<form method="post" action="${config.actionRoot}">
+ <input type="hidden" name="module" value="Comment">
+ <input type="hidden" name="do" value="search">
+
+ <table border="0" cellpadding="2" cellspacing="1">
+ <tr class="pink">
+ <td>
+ search in field
+ </td>
+ <td>
+ for value
+ </td>
+ <td>
+ published
+ </td>
+ <td>
+ order
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="text" size="10" maxlength="20" name="searchtext" value="${searchtext}">
+ </td>
+
+ <td>
+ <select name="searchfield">
+ <option value="title"<if searchfield=="title"> selected</if>>${lang("comment.title")}</option>
+ <option value="creator"<if searchfield=="creator"> selected</if>>${lang("comment.creator")}</option>
+ <option value="description"<if searchfield=="description"> selected</if>>${lang("comment.text")}</option>
+ </select>
+ </td>
+ <td>
+ <select name="searchispublished">
+ <option value="">--</option>
+ <option value="0" <if searchispublished=="0"> selected</if>>${lang("commentlist.hidden")}</option>
+ <option value="1" <if searchispublished=="1"> selected</if>>${lang("commentlist.published")}</option>
+ </select>
+ </td>
+ <td>
+ <select name="searchorder">
+ <option value="datedesc" <if searchorder=="datedesc"> selected</if>>${lang("commentlist.order.datedesc")}</option>
+ <option value="dateasc" <if searchorder=="dateasc"> selected</if>>${lang("commentlist.order.dateasc")}</option>
+ <option value="articletitle" <if searchorder=="articletitle"> selected</if>>${lang("commentlist.order.articletitle")}</option>
+ </select>
+ </td>
+ <td>
+ <input type="submit" name="search" value="${lang("commentlist.search")}">
+ </td>
+ </tr>
+ </table>
+</form>
+<table border="0" cellpadding="2" cellspacing="1">
+ <if comments>
+ <tr><td>
+ <if prevurl>
+ <a href="${config.actionRoot}?${prevurl}">${lang("list.previous")}</a>
+ </if>
+ <if nexturl>
+ <a href="${config.actionRoot}?${nexturl}">${lang("list.next")}</a>
+ </if>
+ </td></tr>
+ </if>
<tr class="pink">
<td><p class="head">${lang("comment.date")}</p></td>
<td><p class="head">${lang("comment.title")}/ ${lang("comment.creator")}<br>
${lang("comment.text")}</p></td>
- <td><p class="head">${lang("comment.article")}</P></td>
- </tr>
-
-<if data.contentlist>
-
- <list data.contentlist as entry>
- <tr <if grey=="1"><assign grey="0">class="list1"<else><assign grey="1">class="list2"</if>>
-
- <td>${entry.webdb_create_short}<br>
- <if entry.is_published=="0"><span class="spezialtext">hidden</span><else>-</if>
- </td>
-
- <td>
- <if entry.title><b>${entry.title}</b><br></if>
- <if entry.creator>Von: ${entry.creator}<br></if>
- <span class="small">${entry.description}</span>
- <if entry.main_url><br>URL: ${entry.main_url}</if>
- <br><a href="${config.actionRoot}?module=Comment&do=edit&order=${data.order}&offset=${data.offset}&id=${entry.id}">${lang("edit")}</a>
- </td>
-
-
- <td>
- ${data.articleHash[entry.to_media]["title"]}<br>
- <a href="${config.actionRoot}?module=Content&do=edit&id=${data.articleHash[entry.to_media]["id"]}">
- edit</a> |
- <a href="${config["Producer.ProductionHost"]}${config["Producer.DocRoot"]}${data.articleHash[entry.to_media]["publish_path"]}${data.articleHash[entry.to_media]["id"]}.shtml">
- view</a>
- </td>
-
- <td><span class="text"> <a href="${config.actionRoot}?module=Comment&do=delete&id=${entry.id}">${lang("delete")}</a>
- </span></td>
-
- </tr>
- </list>
-
- <tr>
- <td colspan="3" class="darkgrey"><span class="wite">${data.count} ${lang("records")}
- / ${lang("show_from_to", data.from, data.to)}</span></td>
- <td> </td>
</tr>
-<tr><td>
-<if data.prev>
-<a href="${config.actionRoot}?module=Comment&do=list&order=${data.order}&query_text=${data.query_text_encoded}&query_field=${data.query_field}&query_is_published=${data.query_is_published}&query_media_folder=${data.query_media_folder}&offset=${data.prev}&prev=zurück">zurueck</a>
-</if>
-<if data.next>
-<a href="${config.actionRoot}?module=Comment&do=list&order=${data.order}&query_text=${data.query_text_encoded}&query_field=${data.query_field}&query_is_published=${data.query_is_published}&query_media_folder=${data.query_media_folder}&offset=${data.next}&next=weiter">weiter</a>
-</if>
-</td></tr>
-<else>
- <tr><td align="center">${lang("no_matches_found")}</td></tr>
-</if>
+ <if comments>
+ <list comments as entry>
+ <tr <if grey=="1"><assign grey="0">class="list1"<else><assign grey="1">class="list2"</if>>
+
+ <td>${entry.webdb_create_short}<br>
+ <if entry.is_published=="0"><span class="spezialtext">hidden</span><else>-</if>
+ </td>
+
+ <td>
+ ${lang("comment.article")}
+ <a href="${config.actionRoot}?module=Content&do=edit&id=${entry.to_content.id}">
+ ${utility.encodeHTML(entry.to_content.title)}
+ </a>
+ <br>
+ <a name="${entry.id}"></a>
+ <if entry.title><b>${entry.title}</b><br></if>
+
+ <if entry.creator>${lang("comment.creator")}: ${entry.creator}<br></if>
+ <span class="small">${entry.description}</span>
+ <if entry.main_url><br>URL: ${entry.main_url}</if>
+ <br><a href="${config.actionRoot}?module=Comment&do=edit&id=${entry.id}">${lang("edit")}</a>
+ <if entry.operations>|</if>
+
+ <list entry.operations as op>
+ [<a href="${config.actionRoot}?module=Localizer&do=commentoperation&operation=${op}&id=${entry.id}&returnurl=${utility.encodeURI(thisurl + "#" + entry.id)}">${op}</a>]
+ </list>
+
+ </td>
+
+ <td>
+ <span class="text">
+ <a href="${config.actionRoot}?module=Comment&do=delete&id=${entry.id}">${lang("delete")}</a>
+ </span>
+ </td>
+
+ </tr>
+ </list>
+
+ <tr class="pink">
+ <td colspan="3">${count} ${lang("records")} / ${lang("show_from_to", from, to)}</span></td>
+ </tr>
+ <tr><td>
+ <if prevurl>
+ <a href="${config.actionRoot}?${prevurl}">${lang("list.previous")}</a>
+ </if>
+ <if nexturl>
+ <a href="${config.actionRoot}?${nexturl}">${lang("list.next")}</a>
+ </if>
+ </td></tr>
+ <else>
+ <tr><td align="center">${lang("no_matches_found")}</td></tr>
+ </if>
</table>
-<include "templates/admin/foot.template">
+<include "foot.template">
</body>
</html>
<include "templates/admin/head.template">
<form method="post" action="${config.actionRoot}">
- <input type="hidden" name="module" value="Content">
- <input type="hidden" name="where" value="${utility.encodeHTML(data.where)}">
- <input type="hidden" name="offset" value="${utility.encodeHTML(data.offset)}">
- <input type="hidden" name="order" value="${utility.encodeHTML(data.order)}">
- <input type="hidden" name="id" value="${utility.encodeHTML(data.id)}">
- <if data.new>
- <input type="hidden" name="do" value="insert">
- <else>
- <input type="hidden" name="do" value="update">
- </if>
+ <input type="hidden" name="module" value="Content">
+ <input type="hidden" name="id" value="${utility.encodeHTML(data.id)}">
+ <if data.new>
+ <input type="hidden" name="do" value="insert">
+ <else>
+ <input type="hidden" name="do" value="update">
+ </if>
-<table border="0" width="80%" align="middle">
-<tr>
- <td align="right" class="grey">
- <span class="witetext">
- <b>${lang("content.owner")}:</b>
- </span>
- </td>
- <td>
- <span class="specialtext">
- ${utility.encodeHTML(data.login_user.login)}
- </span>
- </td>
- <td colspan="3"> </td>
-</tr>
-<tr>
- <td align="right" class="grey">
- <span class="witetext">
- <b>${lang("content.import_date")}:</b>
- </span>
- </td>
- <td>
- <span class="witetext">
- ${utility.encodeHTML(data.date)}
- </span>
- </td>
- <td colspan="3"> </td>
-</tr>
-
-<tr>
- <td align="right" class="grey">
- <span class="witetext">
- <b>${lang("content.lastchange_date")}:</b>
- </span>
- </td>
- <td>
- ${utility.encodeHTML(data.webdb_lastchange)}<br>
- </td>
- <td colspan="3"> </td>
-</tr>
-
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <b>${lang("content.create_date")}:</b>
- </span>
- </td>
- <td colspan="3">
- ${utility.encodeHTML(data.webdb_create)}<br><br>${lang("edit")} (yyyy-mm-dd [HH:mm]):
- <input type="text" size="10" maxlength="16" name="webdb_create" value=""><br>
- </td>
- <td colspan="3"> </td>
-</tr>
-
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.topic")} <a href="${config.docRoot}/help/content.html">
- <img src=" ${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
- / ${lang("content.feature")}:
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="middle"></a>
- </B>
- </span>
- </td>
- <td colspan="4" >
- <table border=0 cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <select name="to_article_type">
- <list extra.articletypePopupData as a>
- <option value="${a.key}" <if (a.key == data.to_article_type)>selected</if>>${a.value}</option>
- </list>
- </select>
- <select name="to_feature">
- <list extra.schwerpunktPopupData as s>
- <option value="${s.key}" <if (s.key == data.to_feature)>selected</if>>${s.value}</option>
- </list>
- </select>
- </td>
- <td rowspan="2">
- <select name="to_topic" size="5" multiple>
-
- <list extra.themenPopupData as t>
- <option value="${t.key}" <list data.to_topics as to><if (t.key == to["id"])>selected</if></list>>${t.value}</option>
- </list>
-
- </select>
- </td>
- </tr>
- <tr>
- <td>
- <select name="to_language">
- <list extra.languagePopupData as l>
- <option value="${l.key}" <if (l.key == data.to_language)>selected</if>>${l.value}</option>
- </list>
- </select>
- <td>
- </tr>
- </table>
- </td>
-</tr>
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.title")}: <br><br>${lang("content.subtitle")}: <br>
- <a href="${config.docRoot}/help/content.html#title">
- <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
- </B>
- </span>
- </td>
- <td colspan="4">
- <input type="text" size="40" name="title" value="${utility.encodeHTML(data.title)}"><br>
- <input type="text" size="20" name="subtitle" value="${utility.encodeHTML(data.subtitle)}">
- <input type="text" size="20" name="edittitle" value="${utility.encodeHTML(data.edittitle)}">
- </td>
-</tr>
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.location")}:
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="middle"></a>
- </B>
- </span>
- </td>
- <td colspan="4" >
- <input type="text" size="40" name="place" value="${utility.encodeHTML(data.place)}">
- </td>
-</tr>
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.creator")}:</B>
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="middle"></a>
- </span>
- </td>
- <td colspan="4">
- <input type="text" size="40" name="creator" value="${utility.encodeHTML(data.creator)}"><br>
- </td>
-</tr>
+ <table border="0" width="80%" align="middle">
+ <tr>
+ <td colspan="1"> </td>
+ <td colspan="2"><a href="${config.actionRoot}?module=Comment&do=articlecomments&articleid=${data.id}">${lang("content.comments")}</a></td>
+ <td colspan="2" align="right" valign="top">
+ ${lang("content.published")} <a href="${config.docRoot}/help/content.html"><img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>:
+ <input type="checkbox" name="is_published" value="1"<if data.is_published!="0" && data.is_published!=""> checked</if>>
+ <if data.new>
+ <input type="submit" name="save" value="${lang("insert")}">
+ <else>
+ <input type="submit" name="save" value="${lang("save")}">
+ </if>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("content.import_date")}:
+ </td>
+ <td>
+ ${data.date}
+ </td>
+ <td colspan="3"> </td>
+ </tr>
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("content.lastchange_date")}:
+ </td>
+ <td>
+ ${utility.encodeHTML(data.webdb_lastchange)}<br>
+ </td>
+ <td colspan="3"> </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.create_date")}:
+ </td>
+ <td colspan="3">
+ ${utility.encodeHTML(data.webdb_create)}<br><br>${lang("edit")} (yyyy-mm-dd [HH:mm]):
+ <input type="text" size="10" maxlength="16" name="webdb_create" value=""><br>
+ </td>
+ <td colspan="3"> </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.topic")}
+ <a href="${config.docRoot}/help/content.html"><img src=" ${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
+ / ${lang("content.feature")}:
+ <a href="${config.docRoot}/help/content.html">
+ <img src="${config.docRoot}/img/help.gif" border="0" align="middle"></a>
+ </td>
+ <td colspan="4">
+ <table border=0 cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <select name="to_article_type">
+ <list extra.articletypePopupData as a>
+ <option value="${a.key}" <if (a.key == data.to_article_type)>selected</if>>${a.value}</option>
+ </list>
+ </select>
+ <select name="to_feature">
+ <list extra.schwerpunktPopupData as s>
+ <option value="${s.key}" <if (s.key == data.to_feature)>selected</if>>${s.value}</option>
+ </list>
+ </select>
+ </td>
+ <td rowspan="2">
+ <select name="to_topic" size="5" multiple>
+ <list extra.themenPopupData as t>
+ <option value="${t.key}" <list data.to_topics as to><if (t.key == to["id"])>selected</if></list>>${t.value}</option>
+ </list>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select name="to_language">
+ <list extra.languagePopupData as l>
+ <option value="${l.key}" <if (l.key == data.to_language)>selected</if>>${l.value}</option>
+ </list>
+ </select>
+ <td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.title")}:
+ </td>
+ <td colspan="4">
+ <input type="text" size="40" name="title" value="${utility.encodeHTML(data.title)}"><br>
+ </tr>
+ </tr>
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.subtitle")}: <br>
+ <a href="${config.docRoot}/help/content.html#title">
+ <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
+ </td>
+ <td colspan="4">
+ <input type="text" size="20" name="subtitle" value="${utility.encodeHTML(data.subtitle)}">
+ <input type="text" size="20" name="edittitle" value="${utility.encodeHTML(data.edittitle)}">
+ </td>
+ </tr>
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.location")}:
+ <a href="${config.docRoot}/help/content.html"><img src="${config.docRoot}/img/help.gif" border="0" align="middle"></a>
+ </td>
+ <td colspan="4" >
+ <input type="text" size="40" name="source" value="${utility.encodeHTML(data.source)}">
+ </td>
+ </tr>
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.creator")}:
+ <a href="${config.docRoot}/help/content.html">
+ <img src="${config.docRoot}/img/help.gif" border="0" align="middle"></a>
+ </td>
+ <td colspan="4">
+ <input type="text" size="40" name="creator" value="${utility.encodeHTML(data.creator)}"><br>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.creator.email")}/${lang("content.creator.url")}:
+ <a href="${config.docRoot}/help/content.html">
+ <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
+ </td>
+ <td colspan="4" >
+ <input type="text" size="20" name="creator_email" value="${utility.encodeHTML(data.creator_email)}">
+ <input type="text" size="20" name="creator_main_url" value="${utility.encodeHTML(data.creator_main_url)}">
+ </td>
+ </tr>
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.creator.address")}/${lang("content.creator.telephone")}:
+ <a href="${config.docRoot}/help/content.html">
+ <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
+ </td>
+ <td colspan="4" >
+ <input type="text" size="20" name="creator_address" value="${utility.encodeHTML(data.creator_address)}">
+ <input type="text" size="20" name="creator_phone" value="${utility.encodeHTML(data.creator_phone)}">
+ </td>
+ </tr>
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.abstract")}:
+ <a href="${config.docRoot}/help/content.html">
+ <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
+ </td>
+ <td colspan="4">
+ <textarea cols="70" rows="15" name="description" wrap=virtual>${data.description}</textarea>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.content")}:
+ <a href="${config.docRoot}/help/content.html"> <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
+ <br>
+ ${lang("content.html")}
+ <input type="checkbox" name="is_html" value="1"<if data.is_html=="1"> checked</if>>
+ <a href="${config.docRoot}/help/content.html">
+ <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle">
+ </a>
+ </td>
+ <td colspan="4">
+ <textarea cols="70" rows="20" name="content_data" wrap=virtual>${data.content_data}</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" valign="top" class="editfieldname">
+ ${lang("content.comment")}:<br>
+ <i>${lang("content.internal")}</i>
+ </td>
+ <td colspan="4">
+ <textarea cols="70" rows="6" name="comment" wrap=virtual>${utility.encodeHTML(data.comment)}</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td colspan="2" align="right" valign="top">
+ <if data.new>
+ <input type="submit" name="save" value="${lang("insert")}">
+ <else>
+ <input type="submit" name="save" value="${lang("save")}">
+ </if>
+ </td>
+ </tr>
+ <tr>
+ <td class="pink" colspan="5">
+ ${lang("content.attachments")}
+ </td>
+ </tr>
+ <!-- image stuff -->
+ <list data.to_media_images as m>
<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.creator.email")}/${lang("content.creator.url")}:</B>
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
- </span>
- </td>
- <td colspan="4" >
- <input type="text" size="20" name="creator_email" value="${utility.encodeHTML(data.creator_email)}">
- <input type="text" size="20" name="creator_main_url" value="${utility.encodeHTML(data.creator_main_url)}">
- </td>
-</tr>
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.creator.address")}/${lang("content.creator.telephone")}:</B>
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
- </span>
- </td>
- <td colspan="4" >
- <input type="text" size="20" name="creator_address" value="${utility.encodeHTML(data.creator_address)}">
- <input type="text" size="20" name="creator_phone" value="${utility.encodeHTML(data.creator_phone)}">
- </td>
-</tr>
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.abstract")}:</B>
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
- </span>
- </td>
- <td colspan="4">
- <textarea cols="50" rows="15" name="description" wrap=virtual>${data.description}</textarea>
- </td>
-</tr>
-
-<tr>
- <td align="right" valign="top" class="grey">
- <span class="witetext">
- <B>${lang("content.content")}:
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
- ${lang("content.html")}
- <input type="checkbox" name="is_html" value="1"<if
- data.is_html=="1"> checked</if>>
- <a href="${config.docRoot}/help/content.html">
- <img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>
- </B>
- </span>
- </td>
- <td colspan="4">
- <textarea cols="50" rows="20" name="content_data" wrap=virtual>${data.content_data}</textarea>
- </td>
-</tr>
-<tr>
- <td align="right" valign="top" class="grey">
- <span="class">
- <B>${lang("content.comment")}:</B><br>
- <i>${lang("content.internal")}</i>
- </span>
- </td>
- <td colspan="4">
- <textarea cols="50" rows="6" name="comment" wrap=virtual>${utility.encodeHTML(data.comment)}</textarea>
- </td>
-</tr>
-
-<tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td colspan="2" align="right" valign="top">
- frei <a href="${config.docRoot}/help/content.html"><img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>:
- <input type="checkbox" name="is_published" value="1"<if data.is_published!="0" && data.is_published!=""> checked</if>>
- <if data.new>
- <input type="submit" name="save" value="${lang("insert")}">
- <else>
- <input type="submit" name="save" value="${lang("save")}">
- </if>
- </td>
-</tr>
-
-<tr><td class="pink" colspan="5">${lang("content.attachments")}</td></tr>
- <!-- image stuff -->
- <list data.to_media_images as m>
-<tr>
- <td align=right valign=top class="grey">
- <span="witetext">
- <B>${lang("content.images")}:</B>
- </span>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=Images&do=edit&id=${m["id"]}"><img src="${config.actionRoot}?module=Images&do=showicon&id=${m["id"]}" alt="edit" border="0"></a>
- <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
- </td>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.images")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=Images&do=edit&id=${m["id"]}"><img src="${config.actionRoot}?module=Images&do=showicon&id=${m["id"]}" alt="edit" border="0"></a>
+ <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
+ </td>
</tr>
</list>
<tr>
- <td align=right valign=top class="grey">
- <span class="witetext">
- <B>${lang("content.media")}:</B>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=Images&do=list&cid=${data.id}">${lang("content.addimage")}</a>
- </td>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.media")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=Images&do=list&cid=${data.id}">${lang("content.addimage")}</a>
+ </td>
</tr>
<list data.to_media_audio as m>
<tr>
- <td align=right valign=top class="grey">
- <span class="witetext">
- <B>${lang("content.audio")}:</B>
- </span>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=Audio&do=edit&id=${m["id"]}"><img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0"></a>
- <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
- </td>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.audio")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=Audio&do=edit&id=${m["id"]}"><img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0"></a>
+ <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
+ </td>
</tr>
</list>
<tr>
- <td align=right valign=top class="grey">
- <span class="witetext">
- <B>${lang("content.media")}:</B>
- </span>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=Audio&do=list&cid=${data.id}">${lang("content.addaudio")}</a>
- </td>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.media")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=Audio&do=list&cid=${data.id}">${lang("content.addaudio")}</a>
+ </td>
</tr>
<list data.to_media_video as m>
<tr>
- <td align=right valign=top class="grey">
- <span class="witetext">
- <B>${lang("content.video")}:</B>
- </span>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=Video&do=edit&id=${m["id"]}"><img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0"></a>
- <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
- </td>
-</tr>
-</list>
-<tr>
- <td align=right valign=top class="grey">
- <span class="witetext">
- <B>${lang("content.media")}:</B>
- </span>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=Video&do=list&cid=${data.id}">${lang("content.addvideo")}</a>
- </td>
-</tr>
-<list data.to_media_other as m>
-<tr>
- <td align=right valign=top class="grey">
- <span class="witetext">
- <B>${lang("content.other")}:</B>
- </span>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=Video&do=edit&id=${m["id"]}"><img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0"></a>
- <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
- </td>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.video")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=Video&do=edit&id=${m["id"]}"><img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0"></a>
+ <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
+ </td>
</tr>
</list>
<tr>
- <td align=right valign=top class="grey">
- <span class="witetext">
- <B>${lang("content.media")}:</B>
- </span>
- </td>
- <td colspan="4" align="left" valign="top">
- <a href="${config.actionRoot}?module=OtherMedia&do=list&cid=${data.id}">${lang("content.addother")}</a>
- </td>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.media")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=Video&do=list&cid=${data.id}">${lang("content.addvideo")}</a>
+ </td>
</tr>
-</table>
-</form>
-<include "templates/admin/foot.template">
-</body>
+ <list data.to_media_other as m>
+ <tr>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.other")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=Video&do=edit&id=${m["id"]}"><img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0"></a>
+ <a href="${config.actionRoot}?module=Content&do=dettach&cid=${data.id}&mid=${m["id"]}">${lang("delete")}</a>
+ </td>
+ </tr>
+ </list>
+ <tr>
+ <td align=right valign=top class="editfieldname">
+ ${lang("content.media")}:
+ </td>
+ <td colspan="4" align="left" valign="top">
+ <a href="${config.actionRoot}?module=OtherMedia&do=list&cid=${data.id}">${lang("content.addother")}</a>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <include "templates/admin/foot.template">
+ </body>
</html>
.witesmall {font-size: small; color: #ffffff; text-decoration:none;}
.witex-small {font-size: x-small; color: #ffffff; text-decoration:none;}
- .lynx {display:none;}
\ No newline at end of file
+ .lynx {display:none;}
+
+ .editfieldname {
+ font-size: large;
+ color: #ffffff;
+ font-weight: bold;
+ text-decoration:none;
+ background-color: #dddddd;
+ }
\ No newline at end of file