Commit 244cf9e2 authored by Hanno Schlichting's avatar Hanno Schlichting

Avoid using the ``Products.PythonScripts.standard`` module inside the database manager ZMI.

parent 3fb996d4
......@@ -22,6 +22,9 @@ Bugs Fixed
Restructuring
+++++++++++++
- Avoid using the ``Products.PythonScripts.standard`` module inside the
database manager ZMI.
- Factored out the `Products.MIMETools` and `Products.ExternalMethod` packages
into their own distributions.
......
......@@ -20,6 +20,7 @@ from logging import getLogger
import os
import sys
import time
import urllib
from AccessControl.class_init import InitializeClass
from AccessControl.requestmethod import requestmethod
......@@ -109,10 +110,12 @@ class DatabaseChooser(SimpleItem):
def __init__(self, id):
self.id = id
def getDatabaseNames(self):
def getDatabaseNames(self, quote=False):
configuration = getConfiguration()
names = configuration.dbtab.listDatabaseNames()
names.sort()
if quote:
return [(name, urllib.quote(name)) for name in names]
return names
def __getitem__(self, name):
......
<h1 tal:replace="structure here/manage_page_header" />
<h2 tal:replace="structure here/manage_tabs" />
<h1 tal:replace="structure context/manage_page_header" />
<h2 tal:replace="structure context/manage_tabs" />
<h3>Databases</h3>
<table tal:define="url_quote nocall:
modules/Products/PythonScripts/standard/url_quote">
<tr tal:repeat="name here/getDatabaseNames">
<td tal:define="qname python: url_quote(name)">
<table tal:define="databases python:context.getDatabaseNames(quote=True);">
<tr tal:repeat="info databases">
<td tal:define="name python: info[0];
qname python: info[1]">
<img src="/p_/DatabaseManagement_icon"
tal:attributes="src string:${request/BASE1}/p_/DatabaseManagement_icon" />
<a tal:content="name" tal:attributes="href
string:${here/absolute_url}/${qname}/manage_main">Main</a>
string:${context/absolute_url}/${qname}/manage_main">Main</a>
</td>
</tr>
</table>
<h1 tal:replace="structure here/manage_page_footer" />
<h1 tal:replace="structure context/manage_page_footer" />
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