Commit 784b0178 authored by Evan Simpson's avatar Evan Simpson

Add om_icons protocol, and use it in PageTemplates to show error status.

parent e2c54e47
......@@ -107,7 +107,15 @@ function toggleSelect() {
<td align="left" valign="top" width="16">
<input type="checkbox" name="ids:list" value="&dtml-sequence-key;" />
</td>
<td align="left" valign="top">
<td align="left" valign="top" nowrap="1">
<dtml-if om_icons>
<a href="&dtml.url_quote-sequence-key;/manage_workspace">
<dtml-in om_icons mapping>
<img src="&dtml-BASEPATH1;/&dtml.url_quote-path;" alt="&dtml.missing-alt;"
title="&dtml.missing-title;" border="0" /></dtml-in></a>
<dtml-else>
<dtml-if icon>
<a href="&dtml.url_quote-sequence-key;/manage_workspace">
<img src="&dtml-BASEPATH1;/&dtml-icon;" alt="&dtml-meta_type;"
......@@ -115,6 +123,9 @@ function toggleSelect() {
<dtml-else>
&nbsp;
</dtml-if>
</dtml-if>
</td>
<td align="left" valign="top">
<div class="list-item">
......
......@@ -87,10 +87,10 @@
Zope object encapsulating a Page Template.
"""
__version__='$Revision: 1.21 $'[11:-2]
__version__='$Revision: 1.22 $'[11:-2]
import os, AccessControl, Acquisition, sys
from Globals import DTMLFile, MessageDialog, package_home
from Globals import DTMLFile, ImageFile, MessageDialog, package_home
from zLOG import LOG, ERROR, INFO
from OFS.SimpleItem import SimpleItem
from DateTime.DateTime import DateTime
......@@ -322,6 +322,16 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
return self._text
return self.read()
def om_icons(self):
"""Return a list of icon URLs to be displayed by an ObjectManager"""
icons = ({'path': 'misc_/PageTemplates/zpt.gif',
'alt': self.meta_type, 'title': self.meta_type},)
if self._v_errors:
icons = icons + ({'path': 'misc_/PageTemplates/exclamation.gif',
'alt': 'Error',
'title': 'This template has an error'},)
return icons
def __setstate__(self, state):
ZopePageTemplate.inheritedAttribute('__setstate__')(self, state)
self._cook()
......@@ -375,6 +385,9 @@ def manage_addPageTemplate(self, id, title=None, text=None,
REQUEST.RESPONSE.redirect(u+'/manage_main')
return ''
from Products.PageTemplates import misc_
misc_['exclamation.gif'] = ImageFile('www/exclamation.gif', globals())
def initialize(context):
context.registerClass(
ZopePageTemplate,
......
......@@ -87,9 +87,13 @@ __doc__='''Package wrapper for Page Templates
This wrapper allows the Page Template modules to be segregated in a
separate package.
$Id: __init__.py,v 1.1 2001/03/23 17:19:07 evan Exp $'''
$Id: __init__.py,v 1.2 2001/10/15 19:52:03 evan Exp $'''
__version__='$$'[11:-2]
# Placeholder for Zope Product data
misc_ = {}
def initialize(context):
# Import lazily, and defer initialization to the module
import ZopePageTemplate
......
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