+2005-08-7 Grok <grok@no-log.org>
+ * templates/admin/FUNCTIONS.template:
+ adding a form on the edit article pages that allows you
+ to add an image attachment by directly typing in its id
+
2005-07-26 Grok <grok@no-log.org>
* source/mir/media/image/ImageMagickImageProcessor.java:
public void attach(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc {
String mediaIdParam = aRequest.getParameter("mid");
String articleId = aRequest.getParameter("articleid");
-
if (articleId == null || mediaIdParam==null)
throw new ServletModuleExc("smod content :: attach :: articleid/mid missing");
-
+ // check if mediaIdParam and articleid are correct integers
+ try
+ {
+ Integer.parseInt(mediaIdParam);
+ Integer.parseInt(articleId);
+ }
+ catch(NumberFormatException e)
+ {
+ throw new ServletModuleExc("smod content :: attach :: invalid articleid/mid");
+ }
+
if (!MirGlobal.accessControl().article().mayEditArticle(ServletHelper.getUser(aRequest), articleId))
throw new ServletModuleExc("Article has been locked");
<if aCanEdit=="1">
<td align="left" valign="top" class="listrow2">
<a href="${config.actionRoot}?module=Images&do=list&${objectKey}=${anObject.id}&returnurl=${utility.encodeURI(aReturnUrl)}">[+] ${lang("content.addimage")}</a> |
- <a href="${config.actionRoot}?module=Images&do=add&${objectKey}=${anObject.id}&returnurl=${utility.encodeURI(aReturnUrl)}">${lang("content.uploadimage")}</a>
+ <a href="${config.actionRoot}?module=Images&do=add&${objectKey}=${anObject.id}&returnurl=${utility.encodeURI(aReturnUrl)}">${lang("content.uploadimage")}</a> |
+ <form method="post" action="${config.actionRoot}">
+ id:
+ <input type="hidden" name="module" value="${objectModule}">
+ <input type="hidden" name="do" value="attach">
+ <input type="text" size="5" maxlength="10" name="mid" value="">
+ <input type="hidden" name="${objectKey}" value="${anObject.id}">
+ <input type="submit" class="minorbutton" value="${lang("content.addimage")}">
+ </form>
</td>
</if>
</tr>
</tr>
</if>
</table>
-
+
+<if mayEdit=="1">
+ </form>
+</if>
+
<if new=="0">
<table width="90%" cellspacing="0" cellpadding="0">
</table>
</if>
-<if mayEdit=="1">
- </form>
-</if>
<include "foot.template">
</body>