📄 manage_templates.jsp
字号:
<%@include file="include_header.jsp"%><%@page import="org.jahia.bin.*"%><%@page import = "java.util.*,org.jahia.services.pages.*"%><%@page import = "java.util.*,org.jahia.data.JahiaData"%><% String theURL = ""; Enumeration templList = (Enumeration)request.getAttribute("templList"); String requestURI = (String)request.getAttribute("requestURI"); String contextRoot = (String)request.getContextPath(); JahiaSite site = (JahiaSite)request.getAttribute("site"); JahiaData jData = (JahiaData)request.getAttribute("org.jahia.data.JahiaData");%> <script language="javascript"> <!-- // do use actionlauncher.js var myActionLauncher = new ActionLauncher(); function addAction(theResourceID,theActionName,theActionUrl){ myActionLauncher.AddAction(theResourceID,theActionName,theActionUrl); } function doEdit(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'edit','false'); } function doDelete(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'delete','false'); } function doSwap(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'swap','false'); } function doPages(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'pages','false'); } function doSC(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'SC','true'); } function doSH(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'SH','true'); } function doMR(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'MR','true'); } function doJB(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'JB','true'); } function doPV(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'PV','true'); } function doEV(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'EV','true'); } function doDD(){ myActionLauncher.LaunchActionForSelectBox(document.mainForm.templid,'DD','true'); } function handleKey(e) { if (e.altKey && e.ctrlKey) { doDelete(); } else { doEdit(); } } function submitFormular(sub,go) { var theMatrix = Math.round(Math.random() * 10000); document.mainForm.action='<%=requestURI%>?do=templates&sub='+sub+'&subaction='+go+'&matrix='+theMatrix; document.mainForm.method='POST'; document.mainForm.submit(); } //--> </script><tr> <td align="right" class="text" colspan="2"><b><% if ( site!= null ){%>site <%=site.getServerName()%> <%}%>:: Manage templates ::</b> </td></tr></table><br><br><table cellpadding="2" cellspacing="0" border="0" width="530"><tr> <td colspan="2" width="530"> </td></tr><tr> <td width="100"> </td> <td width="100%"> <table border="0" cellpadding="0" width="90%"> <tr> <td nowrap align="left"> <font class="text"><b>Manage Templates:</b></font> </td> </tr> <tr> <td width="100%"> <form name="mainForm" action="<%=requestURI%>?do=templates" method="post"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td colspan="2" align="left" width="100%" height="2" background="<%=request.getContextPath()%>/jsp/jahia/engines/images/hr.gif"><img src="<%=request.getContextPath()%>/jsp/jahia/engines/images/pix.gif" width="1" height="1"></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td align="left" class="text" valign="top"> <select ondblclick="javascript:handleKey(event);" class="input" name="templid" size="20" multiple> <% JahiaPageDefinition templ = null; // the following variable is needed because we can't run through an enumeration twice Vector templVec = new Vector(); while (templList.hasMoreElements()){ templ = (JahiaPageDefinition)templList.nextElement(); templVec.add(templ); String url = jData.gui().html().drawUpdateTemplateLauncher(templ); if ( url.equals("") ){ url = "alert('No right to edit !')"; } %> <option value="<%=templ.getID()%>"><%=templ.getName()%></option> <% } %> </select> <script language="javascript"> <!-- <% Enumeration templVecEnum = templVec.elements(); while (templVecEnum.hasMoreElements()){ templ = (JahiaPageDefinition)templVecEnum.nextElement(); String url = jData.gui().html().drawUpdateTemplateLauncher(templ); if ( url.equals("") ){ url = "alert('No right to edit !')"; } %> // add actions to javascript action launcher var theID = <%=templ.getID()%>; var theUrl = "<%=url%>"; // edit action addAction(theID,'edit',theUrl); // delete action addAction(theID,'delete',"submitFormular('edit','confirmdelete')"); <% } %> //--> </script><br> </td> <td class="text" align="left" valign="top" width="50%"> <%if(!isLynx){%><li> <%}%><a href="javascript:doEdit()" alt="Edit the selected template">edit</a><br><br> <%if(!isLynx){%><li> <%}%><a href="javascript:doDelete()" alt="Delete selected template">delete</a><br><br> <!-- <%if(!isLynx){%><li> <%}%><a href="javascript:doSwap()" alt="Swap the selected template with another one">swap</a><br><br> <%if(!isLynx){%><li> <%}%><a href="javascript:doPages()" alt="Show pages using the selected template">pages using the template</a><br><br> <%if(!isLynx){%><li> <%}%><a href="javascript:doSC()" alt="">SC</a>, <a href="javascript:doSH()" alt="">SH</a>, <a href="javascript:doMR()" alt="">MR</a>, <a href="javascript:doJB()" alt="">JB</a>, <a href="javascript:doPV()" alt="">PV</a>, <a href="javascript:doEV()" alt="">EV</a>, <a href="javascript:doDD()" alt="">DD</a><br><br> --> </td> </tr> <tr> <td colspan="2"> <br></td> </tr> </table> </form> </td> </tr> <tr> <td> <br><br> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap width="145" valign="top"><font class="text"><b>Other operations: </b></font></td> <td valign="top"> <font class="text"> <%if(!isLynx){%><li> <%}%><a href="<%=JahiaAdministration.composeActionURL(request,response,"templates","&sub=displaynewlist")%>">Deploy new templates</a><br> <%if(!isLynx){%><li> <%}%><a href="<%=JahiaAdministration.composeActionURL(request,response,"templates","&sub=add")%>">Manually add a new template</a><br> <%if(!isLynx){%><li> <%}%><a href="<%=JahiaAdministration.composeActionURL(request,response,"templates","&sub=options")%>">Templates management options</a><br> <%if(!isLynx){%><li> <%}%><a href="<%=JahiaAdministration.composeActionURL(request,response,"displaymenu","")%>">Back to menu</a><br> </font> </td> </tr> </table> </td> </tr> </table> </td><tr> <td colspan="2" align="right"> <br> <br> <font class="text2"><%=jahiaDisplayMessage%> </font> </td></tr><tr> <td colspan="2"> </td></tr></table><%@include file="include_footer.jsp"%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -