1 18 19 package org.apache.roller.ui.rendering.model; 20 21 import java.util.Map ; 22 import javax.servlet.jsp.PageContext ; 23 import org.apache.commons.logging.Log; 24 import org.apache.commons.logging.LogFactory; 25 import org.apache.roller.RollerException; 26 import org.apache.roller.ui.core.tags.menu.EditorNavigationBarTag; 27 28 29 34 public class MenuModel implements Model { 35 36 private static Log logger = LogFactory.getLog(MenuModel.class); 37 38 private PageContext pageContext = null; 39 40 41 42 public String getModelName() { 43 return "menuModel"; 44 } 45 46 47 48 public void init(Map initData) throws RollerException { 49 50 this.pageContext = (PageContext ) initData.get("pageContext"); 52 } 53 54 55 60 public String showAuthorMenu(boolean vertical) { 61 EditorNavigationBarTag editorTag = new EditorNavigationBarTag(); 62 editorTag.setPageContext(pageContext); 63 if ( vertical ) { 64 editorTag.setView("templates/navbar/navbar-vertical.vm"); 65 } else { 66 editorTag.setView("templates/navbar/navbar-horizontal.vm"); 67 } 68 editorTag.setModel("editor-menu.xml"); 69 return editorTag.emit(); 70 } 71 72 } 73 | Popular Tags |