| 1 |
############################################################################## |
|---|
| 2 |
# |
|---|
| 3 |
# Copyright (c) 2005-2006 Nuxeo and Contributors. |
|---|
| 4 |
# All Rights Reserved. |
|---|
| 5 |
# |
|---|
| 6 |
# This software is subject to the provisions of the Zope Public License, |
|---|
| 7 |
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|---|
| 8 |
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|---|
| 9 |
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|---|
| 10 |
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|---|
| 11 |
# FOR A PARTICULAR PURPOSE. |
|---|
| 12 |
# |
|---|
| 13 |
############################################################################## |
|---|
| 14 |
""" |
|---|
| 15 |
|
|---|
| 16 |
$Id$ |
|---|
| 17 |
""" |
|---|
| 18 |
__docformat__ = "reStructuredText" |
|---|
| 19 |
|
|---|
| 20 |
from zope.interface import implements |
|---|
| 21 |
|
|---|
| 22 |
from cpsskins.controllers import Controller |
|---|
| 23 |
from cpsskins.controllers.interfaces import IController |
|---|
| 24 |
from cpsskins.elements.interfaces import IPresentable |
|---|
| 25 |
from cpsskins.utils import getThemeManager |
|---|
| 26 |
|
|---|
| 27 |
class PageBlockController(Controller): |
|---|
| 28 |
"""Event handler for page blocks |
|---|
| 29 |
""" |
|---|
| 30 |
implements(IController) |
|---|
| 31 |
|
|---|
| 32 |
def added(self): |
|---|
| 33 |
"""What to do when the element has been added. |
|---|
| 34 |
""" |
|---|
| 35 |
IPresentable(self.element).addPresentation() |
|---|
| 36 |
|
|---|
| 37 |
def removed(self): |
|---|
| 38 |
"""What to do when the element has been removed. |
|---|
| 39 |
""" |
|---|
| 40 |
tmutil = getThemeManager() |
|---|
| 41 |
tmutil.removeDisplays(self.element) |
|---|
| 42 |
|
|---|