diff --git a/htroot/Wiki.html b/htroot/Wiki.html index a55b1b14c..a3e34ef06 100644 --- a/htroot/Wiki.html +++ b/htroot/Wiki.html @@ -6,8 +6,104 @@ #%env/templates/header.template%# -

#[pagecontent]#

-

#[pageedit]# Changes will be published as announcement on YaCyNews

+

+#(mode)# + + + + + + + + +
+  yacyWiki page: #[pagename]#     + last edited by #[author]#    change date #[date]# +
+ + + + +
+ #[page]# +
+
+

+

+ + + + +
+:: + +
+

Author:

+

Text:

+ + + + + +
+:: + +

Preview

+

No changes have been submitted so far!

+ + + + + + + +
+   + yacyWiki page: #[pagename]#    last edited by #[author]#,   change date #[date]# + +
+ + + + +
#[page]#
+
+
+ +


+

Edit

+

Author:

+

Text:

+ + + + + +
+:: + + + + + + + +#{pages}# + + + + + +#{/pages}# +
SubjectChange DateLast Author
#[subject]##[date]##[author]#
+#(error)#::IO Error reading wiki database: #[message]##(/error)# +
+ + +
+#(/mode)# +

+Changes will be published as announcement on YaCyNews

#%env/templates/footer.template%# diff --git a/htroot/Wiki.java b/htroot/Wiki.java index 890dd7f23..9bc89e308 100644 --- a/htroot/Wiki.java +++ b/htroot/Wiki.java @@ -118,18 +118,10 @@ public class Wiki { if (post.containsKey("edit")) { // edit the page try { - prop.put("pagecontent", ""); - prop.put("pageedit", - "
" + - //"" + - "

Author:

" + - "

Text:

" + - "" + - "" + - "" + - "" + - "" + - "
"); + prop.put("mode", 1); //edit + prop.put("mode_author", author); + prop.put("mode_page-code", new String(page.page(), "UTF-8")); + prop.put("mode_pagename", pagename); } catch (UnsupportedEncodingException e) {} } @@ -138,87 +130,51 @@ public class Wiki { // preview the page wikiCode wikiTransformer=new wikiCode(switchboard); - prop.put("pagecontent", - "

Preview

No changes have been submitted so far!

" + - "" + - "" + - "
 " + - "yacyWiki page: " + pagename + ",   last edited by " + author + - ",   change date " + dateString(new Date()) + - "
" + - "
" + - wikiTransformer.transform((post.get("content", ""))) + - "
" + - "
"); - - prop.put("pageedit", - "
" + - //"" + - "" + - "


" + - "

Edit

"+ - "

Author:

" + - "

Text:

" + - "" + - "" + - "" + - "" + - "" + - "
"); + prop.put("mode", 2);//preview + prop.put("mode_pagename", pagename); + prop.put("mode_author", author); + prop.put("mode_date", dateString(new Date())); + prop.put("mode_page", wikiTransformer.transform(post.get("content", ""))); + prop.put("mode_page-code", post.get("content", "")); } //end contrib of [MN] else if (post.containsKey("index")) { // view an index - String index = "" + - ""; - - String subject; - try { - Iterator i = switchboard.wikiDB.keys(true); + prop.put("mode", 3); //Index + String subject; + try { + Iterator i = switchboard.wikiDB.keys(true); wikiBoard.entry entry; + int count=0; while (i.hasNext()) { - subject = (String) i.next(); + subject = (String) i.next(); entry = switchboard.wikiDB.read(subject); - index += ""; - index += ""; - index += ""; - index += ""; - index += ""; - } - } catch (IOException e) { - index += "IO Error reading wiki database: " + e.getMessage(); + prop.put("mode_pages_"+count+"_name",wikiBoard.webalize(subject)); + prop.put("mode_pages_"+count+"_subject", subject); + prop.put("mode_pages_"+count+"_date", dateString(entry.date())); + prop.put("mode_pages_"+count+"_author", entry.author()); + count++; } - index += "
SubjectChange DateAuthor
" + subject + "" + dateString(entry.date()) + "" + entry.author() + "
"; - prop.put("pagecontent", index); - prop.put("pageedit", - "
" + - "" + - "" + - "
"); + prop.put("mode_pages", count); + } catch (IOException e) { + prop.put("mode_error", 1); //IO Error reading Wiki + prop.put("mode_error_message", e.getMessage()); + } + prop.put("mode_pagename", pagename); } else { wikiCode wikiTransformer=new wikiCode(switchboard); // show page - prop.put("pagecontent", - "" + - "" + - "
 " + - "yacyWiki page: " + pagename + ",   last edited by " + page.author() + ",   change date " + dateString(page.date()) + - "
" + - "
" + - wikiTransformer.transform(page.page()) + - "
" + - "
"); - - prop.put("pageedit", - "
" + - "" + - "" + - "" + - "" + - "
"); + prop.put("mode", 0); //viewing + prop.put("mode_pagename", pagename); + prop.put("mode_author", page.author()); + prop.put("mode_date", dateString(page.date())); + prop.put("mode_page", wikiTransformer.transform(page.page())); + + prop.put("controls", 0); + prop.put("controls_pagename", pagename); } // return rewrite properties