# How should the topics be presented on the article edit page?
+#
# <key>:<listtype>:<listparameter>:<condition>:<order>
+# multiple entries can be specified, can be seperated by a ,
#
# key:
-# a unique key per topic category
+# the bundle key to use for the field label
# listtype:
# 0 = in a multiselect list box, 1 = checkboxes, 2 = a dropdown listbox
# listparameter:
# what sql order should the topics be ordered by
Mir.Localizer.Admin.TopicLists = \
- topic:1:3:archiv_url='bla':title ,\
- rest:1:3:archiv_url<>'bla':title \
-
-# How should the topics be presented on the article edit page?
-# 0 = in a multiselect list box, 1 = checkboxes
-Mir.Localizer.Admin.TopicListFlavor=1
-
-# For the checkboxes flavour, how many columns should there be?
-Mir.Localizer.Admin.TopicListColumns=3
-
-# In which order should the topic appear?
-Mir.Localizer.Admin.TopicListOrder=title
+ content.topic:1:3::title
# enable deletion of comments/articles?
Mir.Localizer.Admin.AllowDeleteComment=1
import java.util.GregorianCalendar;\r
import java.util.HashMap;\r
import java.util.Iterator;\r
-import java.util.List;\r
+import java.util.*;\r
import java.util.Locale;\r
import java.util.Map;\r
import javax.servlet.http.HttpServletRequest;\r
import mir.util.HTTPRequestParser;\r
import mir.util.JDBCStringRoutines;\r
import mir.util.SQLQueryBuilder;\r
-import mir.util.URLBuilder;\r
+import mir.util.*;\r
import mircoders.entity.EntityContent;\r
import mircoders.global.MirGlobal;\r
import mircoders.module.ModuleContent;\r
* ServletModuleContent -\r
* deliver html for the article admin form.\r
*\r
- * @version $Id: ServletModuleContent.java,v 1.52.2.9 2003/09/20 10:54:18 zapata Exp $\r
+ * @version $Id: ServletModuleContent.java,v 1.52.2.10 2003/09/21 16:40:41 zapata Exp $\r
* @author rk, mir-coders\r
*\r
*/\r
}\r
responseData.put("article", article);\r
\r
-/*\r
-\r
- Map topicsMap = new HashMap();\r
+ List topicsList = new Vector();\r
\r
- String[] topicCategories = configuration.getStringArray("Mir.Localizer.Admin.TopicListOrder");\r
+ String[] topicCategories = configuration.getStringArray("Mir.Localizer.Admin.TopicLists");\r
\r
- for (int i = 0; i<topicCategories; i++) {\r
+ if (topicCategories.length==0 ) {\r
Map categoryMap = new HashMap();\r
-\r
- String key="";\r
- String listtype="";\r
- String listparameter="";\r
-\r
- topic:1:3:archiv_url='bla':title\r
-\r
- topicsMap.put(key, categoryMap);\r
+ categoryMap.put("key", "topic");\r
+ categoryMap.put("listtype", "0");\r
+ categoryMap.put("listparameter", "3");\r
+ categoryMap.put("items",\r
+ new EntityIteratorAdapter("", "title",\r
+ 20, MirGlobal.localizer().dataModel().adapterModel(), "topic"));\r
+ topicsList.add(categoryMap);\r
+ }\r
+ else\r
+ {\r
+\r
+ for (int i = 0; i < topicCategories.length; i++) {\r
+ try {\r
+ Map categoryMap = new HashMap();\r
+ List parts = StringRoutines.splitString(topicCategories[i], ":");\r
+ String key = null;\r
+ String listtype = "0";\r
+ String listparameter = "5";\r
+ String where = "";\r
+ String order = "";\r
+\r
+ if (parts.size() > 0)\r
+ key = (String) parts.get(0);\r
+ if (parts.size() > 1)\r
+ listtype = (String) parts.get(1);\r
+ if (parts.size() > 2)\r
+ listparameter = (String) parts.get(2);\r
+ if (parts.size() > 3)\r
+ where = (String) parts.get(3);\r
+ if (parts.size() > 4)\r
+ order = (String) parts.get(4);\r
+\r
+ if (key != null) {\r
+ categoryMap.put("key", key);\r
+ categoryMap.put("listtype", listtype);\r
+ categoryMap.put("listparameter", listparameter);\r
+ categoryMap.put("items",\r
+ new EntityIteratorAdapter(where, order,\r
+ 20, MirGlobal.localizer().dataModel().adapterModel(), "topic"));\r
+ topicsList.add(categoryMap);\r
+ }\r
+ }\r
+ catch (Throwable t) {\r
+ logger.error("error while preparing topics: " + t.toString());\r
+ }\r
+ }\r
}\r
\r
+ responseData.put("topics", topicsList);\r
\r
- responseData.put("topics", topicsMap);\r
-\r
-\r
-*/\r
-\r
-\r
+/*\r
responseData.put("topics",\r
new EntityIteratorAdapter("", configuration.getString("Mir.Localizer.Admin.TopicListOrder"),\r
20, MirGlobal.localizer().dataModel().adapterModel(), "topic"));\r
-\r
+*/\r
responseData.put("returnurl", requestParser.getParameter("returnurl"));\r
responseData.put("thisurl", urlBuilder.getQuery());\r
\r
<function EditSubmitButtonNormal(aLabel, aFieldName)>\r
<tr>
<td class="${TABLE_FOOT_CLASS}" colspan="2" align="right">
- <input type="submit" name="${aFieldName}" value="${aLabel}">
+ <input class="majorbutton" type="submit" name="${aFieldName}" value="${aLabel}">
</td>
</tr>
</function>
<function showButton(anUrl, aLabel)>
<call showAbsoluteLinkButton(config.actionRoot+"?"+anUrl, aLabel)>
</function>
+<function showGETButton(anUrl, aLabel)>
+ <call showAbsoluteLinkButton(config.actionRoot+"?"+anUrl, aLabel)>
+</function>
+<function showPOSTButton(anUrl, aLabel)>
+ <call showGETButton(anUrl, aLabel)>
+<comment>
+ <form method="POST" action="${utility.encodeHTML(config.actionRoot+"?"+anUrl)}"><input type="submit" class="majorbutton" value="${aLabel}"></form>
+</comment>
+</function>
<assign TABLE_HEAD_CLASS "table-head">
</td>
<td class="listrow2">
- <input type="submit" name="search" value="${lang("filter")}">
+ <input type="submit" class="majorbutton" name="search" value="${lang("filter")}">
</td>
<td>
</table>\r
</function>\r
+<function ExtendedListEntry(aFields, aLinks, aLinkTitles)>
+ <if alt=="1">
+ <assign alt="0">
+ <tr class="${LIST_ROW_CLASS_ALTERNATIVE}">
+ <else>
+ <assign alt="1">
+ <tr class="${LIST_ROW_CLASS}">
+ </if>
+
+ <list aFields as i>
+ <td>
+ ${i}
+ </td>
+ </list>
+ <td>\r
+ <assign index="0">\r
+ <assign first="1">\r
+ <list aLinks as i>\r
+ <if first=="1">\r
+ <assign first="0">\r
+ <else> \r
+ |\r
+ </if>\r
+ <a class="listcommand" href="${config.actionRoot}?${utility.encodeHTML(i)}">${aLinkTitles[index]}</a> \r
+ <assign index=utility.increment(index)>
+ </list>\r
+ </td>
+ </tr>
+</function>\r
+
+
<function ListEntry(aFields, aLinkPrefix, aLinks, aLinkTitles)>\r
<if alt=="1">
<assign alt="0">
<tr>
<td class="table-foot" colspan="2" align="right">
<if id>
- <input type="submit" name="save" value="${lang("save")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
<else>
- <input type="submit" name="save" value="${lang("insert")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("insert")}">
</if>
</td>
</tr>
</if>
<list comment.operations as op>
- <call showButton(
+ <call showPOSTButton(
"module=Localizer&do=commentoperation&operation="+op+"&id="+comment.id+"&returnurl="+utility.encodeURI(thisurl),
lang("comment.operation."+op))>
</list>
<td align="right" valign="top">
${lang("comment.published")} <input type="checkbox" name="is_published" value="1" <if comment.is_published=="1"> checked</if>>
<if new=="1">
- <input type="submit" name="save" value="${lang("insert")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("insert")}">
<else>
- <input type="submit" name="save" value="${lang("save")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
</if>
</td>
</tr>
<td colspan="2" align="right" class="table-foot" >
<span class="text">
<if new=="1">
- <input type="submit" name="save" value="${lang("insert")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("insert")}">
<else>
- <input type="submit" name="save" value="${lang("save")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
</if>
</span>
</td>
<input type="hidden" name="id" value="${id}">
<input type="hidden" name="okurl" value="${okurl}">
<input type="hidden" name="cancelurl" value="${cancelurl}">
- <input type="submit" name="cancel" value="${lang("cancel")}">
- <input type="submit" name="confirm" value="${lang("delete")}"><br>
+ <input type="submit" class="majorbutton" name="cancel" value="${lang("cancel")}">
+ <input type="submit" class="majorbutton" name="confirm" value="${lang("delete")}"><br>
<br>
<b><span class="text-alert">${lang("confirm.text")}</span></b>
</p>
<tr>
<td align="left" valign="top">
<if new=="0">
- <call showButton(
+ <call showGETButton(
"module=Comment&do=articlecomments&articleid="+article.id+"&returnurl="+utility.encodeURI(thisurl),
lang("content.comments"))>
<call showAbsoluteLinkButton(
article.publicurl,
lang("preview"))>
<list article.operations as op>
- <call showButton(
+ <call showPOSTButton(
"module=Localizer&do=articleoperation&operation="+op+"&articleid="+article.id+"&returnurl="+utility.encodeURI(thisurl),
lang("content.operation."+op))>
</list>
${lang("content.published")} :
<input type="checkbox" name="is_published" value="1"<if article.is_published!="0" && article.is_published!=""> checked</if>>
<if new=="1">
- <input type="submit" name="save" value="${lang("insert")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("insert")}">
<else>
- <input type="submit" name="save" value="${lang("save")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
</if>
</td>
</tr>
<call PulldownTableRow (lang("content.articletype"), "to_article_type", articletypes, "id", "name", article.to_article_type, "articletypes.")>
<call PulldownTableRow (lang("content.language"), "to_language", languages, "id", "name", article.to_language, "")>
+
+ <list topics as r>
<tr>
<td align="right" valign="top" class="table-left">
- ${lang("content.topic")}:
+ ${lang(r.key)}:
</td>
- <td class="listrow2" >
- <if config["Mir.Localizer.Admin.TopicListFlavor"]!="0">
+ <td class="listrow2">
+ <if r.listtype=="1">
<table border=0 cellpadding="2" cellspacing="0">
<tr>
- <assign col=config["Mir.Localizer.Admin.TopicListColumns"]>
- <list topics as t>
+ <assign col=r.listparameter>
+ <list r.items as t>
<if col=="0">
</tr>
<tr>
- <assign col=config["Mir.Localizer.Admin.TopicListColumns"]>
+ <assign col=r.listparameter>
</if>
<td title="${utility.encodeHTML(t.description)}">
<input type="checkbox" name="to_topic" value="${t.id}" <list article.to_topics as to><if (t.id == to["id"])>checked</if></list>>
</tr>
</table>
<else>
- <select name="to_topic" size="7" multiple>
- <list topics as t>
- <option value="${t.id}" <list article.to_topics as to><if (t.id == to["id"])>selected</if></list>>${t.title}</option>
- </list>
- </select>
+ <if r.listtype=="0">
+ <select name="to_topic" size="r.listparameter" multiple>
+ <list r.items as t>
+ <option value="${t.id}" <list article.to_topics as to><if (t.id == to["id"])>selected</if></list>>${t.title}</option>
+ </list>
+ </select>
+ <else>
+ <select name="to_topic" size="1">
+ <list r.items as t>
+ <option value="${t.id}" <list article.to_topics as to><if (t.id == to["id"])>selected</if></list>>${t.title}</option>
+ </list>
+ </select>
+ </if>
</if>
</td>
</tr>
+ </list>
+
<call TextInputTableRow (lang("content.title"), 40, 255, "title", article.title)>
<call TextInputTableRowLight (lang("content.subtitle"), 40, 255, "subtitle", article.subtitle)>
<tr>
<td colspan="2" align="right" valign="top">
<if new=="1">
- <input type="submit" name="save" value="${lang("insert")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("insert")}">
<else>
- <input type="submit" name="save" value="${lang("save")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
</if>
</td>
</tr>
<input type="hidden" name="do" value="articleoperationbatch">
<input type="hidden" name="returnurl" value="${utility.encodeHTML(thisurl)}">
<p class="box">
- <input type="submit" name="save" value="${lang("save")}"> (${lang("commentlist.activate")})
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}"> (${lang("commentlist.activate")})
</p>
</if>
</if>
<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")}">
- <input type="reset" value="${lang("reset")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
+ <input type="reset" class="majorbutton" value="${lang("reset")}">
<br><br>
<textarea cols="120" rows="40" name="text" wrap=virtual>${utility.encodeHTML(text)}</textarea>
<br><br>
- <input type="submit" name="save" value="${lang("save")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
<input type="reset" value="${lang("reset")}">
</form>
<br>
</tr>
<tr>
<td colspan="2" align="right">
- <input type="submit" value="${lang("login.submit")}">
+ <input type="submit" class="majorbutton" value="${lang("login.submit")}">
</td>
</tr>
</tbody>
<call showAddOrBack("1", module, "Admin", "superusermenu")>
<if entities>
+ <call ListStart()>\r
+ <call ListHead([
+ lang("mediafolder.name"),
+ lang("mediafolder.location"),
+ lang("mediafolder.comment"), ])>
+
+ <call EntityTable(entities, ["name", "place","comment"],
+ [ ], from, to, count, "1", "1", module)>
+
+
+ <list entities as e>
+ <call ExtendedListEntry([
+ utility.prettyEncodeHTML(e.name),
+ utility.prettyEncodeHTML(e.place),
+ utility.prettyEncodeHTML(e.comment)],
+ ["module=Abuse&id="+f.id"&do=edit", "module=Abuse&id="+f.id"&do=delete"],
+ [lang("edit"), lang("delete")])
+ >
+ </list>\r
+ <call ListEnd()>\r
+
+
<call showPrevNextLinks(prevurl, nexturl, "left")>
<call EntityTable(entities, ["name", "place","comment"],
[ lang("mediafolder.name"),
<input type="hidden" name="do" value="edit">
${lang("start.content.open_by_id")}:
<input type="text" name="id" value="" size="7">
- <input type="submit" value=" > ">
+ <input class="majorbutton" type="submit" value=" > ">
</form>
<form>
<input type="hidden" name="module" value="Comment">
<input type="hidden" name="do" value="edit">
${lang("start.comment.open_by_id")}:
<input type="text" name="id" value="" size="7">
- <input type="submit" value=" > ">
+ <input class="majorbutton" type="submit" value=" > ">
</form>
<b>${lang("media.nr_of_media")} :</b><br>
</td>
<td class="listrow2">
- <input type="text" size="3" name="nrmedia" value="${nrmedia}"> <input type="submit" value="${lang("media.nr_of_media.submit")}">
+ <input type="text" size="3" name="nrmedia" value="${nrmedia}"> <input type="submit" class="majorbutton" value="${lang("media.nr_of_media.submit")}">
</td>
</tr>
</table>
<tr>
<td colspan="2" align="right" class="table-foot">
<if new=="1">
- <input type="submit" name="save" value="${lang("insert")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("insert")}">
<else>
${lang("media.is_published")} <input type="checkbox" name="is_published" value="1"<if uploadedmedia.is_published!="0" && uploadedmedia.is_published!=""> checked</if>>
- <input type="submit" name="save" value="${lang("save")}">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
</if>
</td>
</tr>
.lynx { display:none; }
.majorbutton {
+ background-color:#DDDDDD;
+ color: #990000;
+ font-weight: bold;
+ border: 1px solid #990000;
+ bevel: 2px solid #990000;
}
.minorbutton {