Changeset 1186

Show
Ignore:
Timestamp:
07/28/08 10:11:00
Author:
piv
Message:

done some minor code corrections to portaltabs view

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py

    r1185 r1186  
    201201            return True 
    202202     
    203     def redirect(self, url="", search="", hash=""): 
     203    def redirect(self, url="", search="", url_hash=""): 
    204204        """ Redirect to @@plonetabs-controlpanel configlet """ 
    205          
    206         if url == "": 
    207             portal_url =  getMultiAdapter((self.context, self.request), name=u"plone_portal_state").portal_url() 
    208             url = "%s/%s" % (portal_url, "@@plonetabs-controlpanel") 
    209          
    210         if search != "": 
    211             search = "?%s" % search 
    212          
    213         if hash != "": 
    214             hash = "#%s" % hash 
    215          
    216         self.request.response.redirect("%s%s%s" % (url, search, hash)) 
     205        portal_url =  getMultiAdapter((self.context, self.request), name=u"plone_portal_state").portal_url() 
     206        url = (url == "") and "%s/%s" % (portal_url, "@@plonetabs-controlpanel") or url 
     207        search = (search != "") and "?%s" % search or search 
     208        url_hash = (url_hash != "") and "#%s" % url_hash or url_hash 
     209        self.request.response.redirect("%s%s%s" % (url, search, url_hash)) 
    217210     
    218211    ################################### 
     
    289282        result = [] 
    290283         
    291         # check whether we only want actions 
     284        # check whether tabs autogeneration is turned on 
    292285        if not self.isGeneratedTabs(): 
    293286            return result 
    294287         
    295288        query = {} 
    296          
    297289        rootPath = getNavigationRoot(context) 
    298290        query['path'] = {'query' : rootPath, 'depth' : 1} 
     
    620612        return self.getActionCategory(name) 
    621613     
     614    def setSiteProperties(self, **kw): 
     615        """ Change site_properties """ 
     616        site_properties = getToolByName(self.context, "portal_properties").site_properties 
     617        site_properties.manage_changeProperties(**kw) 
     618        return True 
     619     
     620    # 
     621    # Basic API to work with portal actions tool in a more pleasent way 
     622    # 
     623     
    622624    def addAction(self, cat_name, data): 
    623625        """ Create and add new action to category with given name """ 
     
    664666        return False 
    665667     
    666     def setSiteProperties(self, **kw): 
    667         """ Change site_properties """ 
    668         site_properties = getToolByName(self.context, "portal_properties").site_properties 
    669         site_properties.manage_changeProperties(**kw) 
    670         return True 
    671      
    672668    # 
    673669    # KSS Methods that are used to update different parts of the page 
    674     # according to category 
     670    # accordingly to category 
    675671    # 
    676672