Commit b2a81901 authored by Hanno Schlichting's avatar Hanno Schlichting

Simplify ZMI structure a bit more.

parent 0a9afd9d
......@@ -30,7 +30,7 @@ CHANGES = _read_file('CHANGES.rst')
setup(
name='Zope2',
version='4.0a1.dev0',
url='http://zope2.zope.org',
url='https://zope.readthedocs.io/en/latest/',
license='ZPL 2.1',
description='Zope2 application server / web framework',
author='Zope Foundation and Contributors',
......
......@@ -148,9 +148,6 @@ class Navigation(Base):
security.declareProtected(view_management_screens, 'manage_menu')
manage_menu =DTMLFile('dtml/menu', globals())
security.declareProtected(view_management_screens, 'manage_top_frame')
manage_top_frame =DTMLFile('dtml/manage_top_frame', globals())
security.declareProtected(view_management_screens, 'manage_page_header')
manage_page_header=DTMLFile('dtml/manage_page_header', globals())
......@@ -185,9 +182,6 @@ You have been logged out.
</html>""")
return
security.declarePublic('manage_zmi_prefs')
manage_zmi_prefs=DTMLFile('dtml/manage_zmi_prefs', globals())
# Navigation doesn't have an inherited __class_init__ so doesn't get
# initialized automatically.
......
......@@ -10,30 +10,22 @@ function update_menu() {
//-->
</script>
</head>
<dtml-let tf="REQUEST.get('zmi_top_frame', '1')">
<dtml-if tf>
<frameset rows="34, *">
<frame src="<dtml-var "REQUEST.URL1" html_quote>/manage_top_frame" name="manage_top_frame"
marginwidth="2" marginheight="2" scrolling="no" noresize="noresize"/>
</dtml-if>
<frameset cols="250, *">
<frame src="<dtml-var "REQUEST.URL1" html_quote>/manage_menu" name="manage_menu"
marginwidth="2" marginheight="2" scrolling="auto"/>
<frame src="<dtml-var "REQUEST.URL1" html_quote>/manage_workspace" name="manage_main"
marginwidth="2" marginheight="2" scrolling="auto"/>
<noframes>
<frameset cols="250, *">
<frame src="<dtml-var "REQUEST.URL1" html_quote>/manage_menu"
name="manage_menu"
marginwidth="2" marginheight="2"
/>
<frame src="<dtml-var "REQUEST.URL1" html_quote>/manage_workspace"
name="manage_main"
marginwidth="2" marginheight="2"
/>
<noframes>
<body>
<p>Management interfaces require the use of a <b>frames-capable</b> web
browser.</p>
</body>
</noframes>
</frameset>
<dtml-if tf>
</frameset>
</dtml-if>
</noframes>
</frameset>
</dtml-let>
</html>
......@@ -7,11 +7,7 @@
<meta http-equiv="content-type" content="text/html;charset=&dtml-management_page_charset;" />
<dtml-call "RESPONSE and RESPONSE.setHeader('content-type','text/html;charset='+management_page_charset)">
<title><dtml-if title_or_id><dtml-var title_or_id><dtml-else>Zope</dtml-if></title>
<dtml-let use_css="REQUEST.get('zmi_use_css', '1')">
<dtml-if use_css>
<link rel="stylesheet" type="text/css" href="&dtml-BASEPATH1;/manage_page_style.css" />
</dtml-if>
</dtml-let>
</head>
<body bgcolor="#ffffff" link="#000099" alink="#000099" vlink="#000099">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="&dtml-BASEPATH1;/manage_page_style.css" />
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="180" align="left" valign="top"><a
href="http://zope2.zope.org/" target="_blank"><img src="&dtml-BASEPATH1;/p_/zopelogo_png"
height="33" width="83" border="0" alt="" /></a>
</td>
<td align="right" valign="top">
<div class="form-element">
<form action="&dtml-BASEPATH1;/" method="post" target="manage_main">
<span class="std-text">Logged in as <strong>&dtml-AUTHENTICATED_USER;</strong></span> &nbsp;&nbsp;
<select class="form-element" name=":action"
onchange="window.parent.manage_main.location.href='&dtml-BASEPATH1;/'+this.options[this.selectedIndex].value">
<dtml-if "AUTHENTICATED_USER.getUserName() != 'Anonymous User'">
<option value="manage_zmi_prefs">Set Preferences</option>
<option value="manage_zmi_logout">Logout</option>
</dtml-if>
</select>
<input class="form-element" type="submit" name="submit" value=" Go " />
&nbsp;
</form>
</div>
</td>
</tr>
</table>
</body>
</html>
<dtml-var manage_page_header>
<dtml-var "manage_form_title(this(), _,
form_title='Browser Preferences',
)">
<dtml-if set_zmi_cookies>
<dtml-let expires="(_.DateTime('GMT') + 365).rfc822()">
<dtml-call expr="RESPONSE.setCookie('dtpref_cols', REQUEST['dtpref_cols'],
path='/', expires=expires)">
<dtml-call expr="RESPONSE.setCookie('dtpref_rows', REQUEST['dtpref_rows'],
path='/', expires=expires)">
<dtml-call expr="RESPONSE.setCookie('zmi_use_css', REQUEST['zmi_use_css'],
path='/', expires=expires)">
<dtml-call expr="RESPONSE.setCookie('zmi_top_frame',
REQUEST['zmi_top_frame'],
path='/', expires=expires)">
</dtml-let>
</dtml-if>
<p class="form-help">
This form lets you tweak the Zope management interface to fit
your browser. Note that you need to press the browser reload
button in order for some changes to take effect.
</p>
<form action="&dtml-URL;" method="post">
<input type="hidden" name="set_zmi_cookies" value="1" />
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
Show Top Frame
</div>
</td>
<td align="left" valign="top">
<div class="form-text">
<dtml-let tf="REQUEST.get('zmi_top_frame', '1')">
<input type="radio" name="zmi_top_frame" value="1"
<dtml-if tf>checked="checked"</dtml-if>
/> Yes
<input type="radio" name="zmi_top_frame" value=""
<dtml-unless tf>checked="checked"</dtml-unless>
/> No
</dtml-let>
</div>
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Use Style Sheets
</div>
</td>
<td align="left" valign="top">
<div class="form-text">
<dtml-let use_css="REQUEST.get('zmi_use_css', '1')">
<input type="radio" name="zmi_use_css" value="1"
<dtml-if expr="use_css and use_css != 'inline'">checked="checked"</dtml-if>
/> Yes
<input type="radio" name="zmi_use_css" value=""
<dtml-if expr="not use_css">checked="checked"</dtml-if>
/> No
</dtml-let>
</div>
</td>
</tr>
<dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
rows="REQUEST.get('dtpref_rows', '20')">
<tr>
<td align="left" valign="top">
<div class="form-label">
Text Area Width
</div>
</td>
<td align="left" valign="top">
<input type="text" name="dtpref_cols" value="&dtml-cols;" size="6" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Text Area Height
</div>
</td>
<td align="left" valign="top">
<input type="text" name="dtpref_rows:int" value="&dtml-rows;" size="6" />
</td>
</tr>
</table>
<span class="form-element">
<input type="submit" name="submit" value="Change" />
</span>
<div class="form-help">
<dtml-if expr="cols[-1]=='%'">
<textarea name="data:text" cols="" rows="&dtml-rows;" style="width: &dtml-cols;;">
<dtml-else>
<textarea name="data:text" cols="&dtml-cols;" rows="&dtml-rows;">
</dtml-if>
This is a sample edit textarea.
</textarea>
</div>
</dtml-let>
</form>
<dtml-var manage_page_footer>
......@@ -17,41 +17,25 @@
<a href="&dtml.url_quote-tree-item-url;/manage_workspace"
target="manage_main">&dtml-id;</a>
</dtml-tree>
<br />
<table cellspacing="0" bgcolor="#efefef" width="100%">
<tr>
<td width="16"></td>
<td>
<a href="manage_menu?save_layout=1">Save layout</a>
</td>
</tr>
</table>
<dtml-if save_layout>
<dtml-call "RESPONSE.setCookie('tree-s', REQUEST.get('tree-s'), expires=ZopeTime('2100-01-01').rfc822())">
</dtml-if>
<br />
<dtml-unless expr="REQUEST.get('zmi_top_frame', '1')">
<table width="100%" bgcolor="#6699cc">
<tr>
<td valign="top" align="center">
<div class="form-element">
<form action="&dtml-BASEPATH1;/" method="POST" target="manage_main">
<span class="std-text">Logged in as <strong>&dtml-AUTHENTICATED_USER;</strong></span> &nbsp;&nbsp;
<form action="&dtml-BASEPATH1;/manage_zmi_logout" method="POST" target="manage_main">
<span class="std-text">Logged in as <strong>&dtml-AUTHENTICATED_USER;</strong></span>
&nbsp;&nbsp;
<br />
<select class="form-element" name=":action" onchange="window.parent.manage_main.location.href='&dtml-BASEPATH1;/'+this.options[this.selectedIndex].value">
<dtml-if "AUTHENTICATED_USER.getUserName() != 'Anonymous User'">
<option value="manage_zmi_prefs">Set Preferences</option>
<option value="manage_zmi_logout">Logout</option>
<input class="form-element" type="submit" name="submit" value="Logout" />
</dtml-if>
</select>
<input class="form-element" type="submit" name="submit" value=" Go " />
&nbsp;
</form>
</div>
</td>
</tr>
</table>
</dtml-unless>
<dtml-var manage_page_footer>
......@@ -26,11 +26,9 @@ class INavigation(Interface):
manage = Attribute(""" """)
manage_menu = Attribute(""" """)
manage_top_frame = Attribute(""" """)
manage_page_header = Attribute(""" """)
manage_page_footer = Attribute(""" """)
manage_form_title = Attribute("""Add Form""")
manage_zmi_prefs = Attribute(""" """)
def manage_zmi_logout(REQUEST, RESPONSE):
"""Logout current user"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment