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