| Total Complexity | 2 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | |||
| 3 | from plone.app.layout.viewlets.common import LogoViewlet as Base |
||
| 4 | from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile |
||
| 5 | |||
| 6 | |||
| 7 | class LogoViewlet(Base): |
||
| 8 | index = ViewPageTemplateFile( |
||
| 9 | "templates/plone.app.layout.viewlets.logo.pt") |
||
| 10 | |||
| 11 | def update(self): |
||
| 12 | super(Base, self).update() |
||
| 13 | |||
| 14 | portal = self.portal_state.portal() |
||
| 15 | bprops = portal.restrictedTraverse("base_properties", None) |
||
| 16 | if bprops is not None: |
||
| 17 | logoName = bprops.logoName |
||
| 18 | else: |
||
| 19 | logoName = "logo.jpg" |
||
| 20 | |||
| 21 | logoTitle = self.portal_state.portal_title() |
||
| 22 | self.logo_tag = portal.restrictedTraverse(logoName).tag( |
||
| 23 | title=logoTitle, alt=logoTitle, scale=0.5) |
||
| 24 | self.navigation_root_title = self.portal_state.navigation_root_title() |
||
| 25 |