1 22 23 package org.meshcms.taglib; 24 25 import java.io.*; 26 import org.meshcms.core.*; 27 import com.opensymphony.module.sitemesh.*; 28 29 52 public class Editor extends AbstractTag { 53 public int doEndTag() { 54 if (isEdit) { 55 try { 56 getOut().write("</form>"); 57 } catch (IOException ex) { 58 pageContext.getServletContext().log("Can't write", ex); 59 } 60 } 61 62 return EVAL_PAGE; 63 } 64 65 public void writeTag() throws IOException { 66 } 68 69 public void writeEditTag() throws IOException { 70 Writer w = getOut(); 71 w.write("<form id='editor' name='editor' action=\"" + afp + 72 "/savepage.jsp\" method='post'>\n"); 73 74 HTMLPage htmlPage = (HTMLPage) getPage(); 75 String [] keys = htmlPage.getPropertyKeys(); 76 77 for (int i = 0; i < keys.length; i++) { 78 if (!keys[i].equals(PageAssembler.EMAIL_PARAM) && 79 !keys[i].equals(PageAssembler.MODULES_PARAM) && 80 !keys[i].equals("title")) { 81 w.write("<input type='hidden' name='" + keys[i] + "' value=\"" + 82 htmlPage.getProperty(keys[i]) + "\" />\n"); 83 } 84 } 85 86 w.write("<input type='hidden' name='pagepath' value=\"" + 87 pagePath + "\" />"); 88 } 89 90 public int getStartTagReturnValue() { 91 return EVAL_BODY_INCLUDE; 92 } 93 } 94 | Popular Tags |