Added default "hidden" portlet renderer
authorThierry Florac <thierry.florac@onf.fr>
Thu, 14 Jun 2018 09:10:45 +0200
changeset 104 25cf41ab23a7
parent 103 8950e51795eb
child 105 a0f93a0744b6
Added default "hidden" portlet renderer
src/pyams_portal/skin/__init__.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_portal/skin/__init__.py	Thu Jun 14 09:10:45 2018 +0200
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2008-2018 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_portal.interfaces import IPortalContext, IPortletSettings, IPortletRenderer
+from pyams_skin.layer import IPyAMSLayer
+
+# import packages
+from pyams_portal.portlet import PortletRenderer
+from pyams_utils.adapter import adapter_config
+from zope.interface import Interface
+
+from pyams_default_theme import _
+
+
+@adapter_config(name='hidden',
+                context=(IPortalContext, IPyAMSLayer, Interface, IPortletSettings),
+                provides=IPortletRenderer)
+class HiddenPortletRenderer(PortletRenderer):
+    """Hidden portlet renderer"""
+
+    label = _("Hidden portlet")
+    weight = 9999
+
+    def render(self):
+        return ''