Changeset 1200
- Timestamp:
- 08/07/08 07:59:17
- Files:
-
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py (modified) (7 diffs)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.css (modified) (1 diff)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.kss (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py
r1199 r1200 2 2 import sys 3 3 import urllib 4 import re 4 5 5 6 from Acquisition import aq_inner … … 387 388 def kss_toggleGeneratedTabs(self, field, checked='0'): 388 389 """ Toggle autogenaration setting on configlet """ 389 390 changeProperties = getToolByName(self.context, "portal_properties").site_properties.manage_changeProperties391 390 if checked == '1': 392 changeProperties(**{field : False}) 393 else: 394 changeProperties(**{field : True}) 395 391 self.setSiteProperties(**{field: False}) 392 else: 393 self.setSiteProperties(**{field: True}) 394 395 # update client 396 396 ksscore = self.getCommandSet("core") 397 replace_id = "roottabs"398 397 content = self.getGeneratedTabs() 399 400 ksscore.replaceInnerHTML(ksscore.getHtmlIdSelector(replace_id), content, withKssSetup="True") 398 ksscore.replaceInnerHTML(ksscore.getHtmlIdSelector('roottabs'), content) 401 399 402 400 # update global-sections viewlet 403 self.updatePortalTabs ()401 self.updatePortalTabsPageSection() 404 402 405 403 @kssaction … … 421 419 portal[obj_id].update(excludeFromNav=not checked) 422 420 421 # update client 423 422 ksscore = self.getCommandSet("core") 424 423 if checked: … … 428 427 429 428 # update global-sections viewlet 430 self.updatePortalTabs ()429 self.updatePortalTabsPageSection() 431 430 432 431 @kssaction … … 718 717 # Utility methods for the kss actions management 719 718 # 720 721 def kss_checkReorderControls(self, cat_name):722 """ Add "noitems" class to Reorder controls to hide them if category is empty """723 ksscore = self.getCommandSet('core')724 selector = ksscore.getHtmlIdSelector("reorder")725 category = self.getActionCategory(cat_name)726 if filter(lambda x: IAction.providedBy(x), category.objectValues()):727 ksscore.removeClass(selector, value="noitems")728 else:729 ksscore.addClass(selector, value="noitems")730 719 731 720 def kss_validateAction(self, id, cat_name): … … 781 770 """ KSS Server command to reset form on client """ 782 771 command = self.commands.addCommand('plonetabs-resetForm', selector) 783 784 def validateAction(self, id, category, prefix="tabslist_"):785 """ If action with given id and category doesn't exist - raise kss exception """786 portal_actions = getToolByName(self.context, "portal_actions")787 788 # remove prefix, added for making ids on configlet unique self.prefix789 act_id = id[len(self.prefix):]790 791 if category not in portal_actions.objectIds():792 raise KSSExplicitError, "Unexistent root portal actions category %s" % category793 794 cat_container = portal_actions[category]795 if act_id not in map(lambda x: x.id, filter(lambda x: IAction.providedBy(x), cat_container.objectValues())):796 raise KSSExplicitError, "%s action does not exist in %s category" % (act_id, category)797 798 return (cat_container, act_id)799 772 800 773 # … … 854 827 """ Seek for according method in class and calls it if found 855 828 Example of making up method's name: 856 portal_tabs => updatePortalTabs """829 portal_tabs => updatePortalTabsPageSection """ 857 830 method_name = 'update%sPageSection' % ''.join(map(lambda x: x.capitalize(), category.split('_'))) 858 831 if hasattr(self, method_name): qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.css
r1199 r1200 250 250 } 251 251 252 .kssTabsActive #app .bridge {252 .kssTabsActive #app #tabslist .bridge { 253 253 left: -3.5em; 254 254 width: 3.5em; qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.kss
r1198 r1200 44 44 } 45 45 46 /* Save initial value of title field on adding form */47 #actname:load {48 action-client: setStateVar;49 setStateVar-varname: plonetabs-addingTitle;50 setStateVar-value: currentFormVar();51 }52 53 46 /* Change portal actions category page */ 54 47 #select_category:change { … … 75 68 plonetabs-toggleGeneratedTabs-field: disable_folder_sections; 76 69 plonetabs-toggleGeneratedTabs-checked: currentFormVar(); 70 plonetabs-toggleGeneratedTabs-error: plonetabs-handleServerError; 77 71 } 78 72 … … 81 75 plonetabs-toggleGeneratedTabs-field: disable_nonfolderish_sections; 82 76 plonetabs-toggleGeneratedTabs-checked: currentFormVar(); 77 plonetabs-toggleGeneratedTabs-error: plonetabs-handleServerError; 83 78 } 84 79 … … 96 91 plonetabs-toggleRootsVisibility-id: nodeAttr(id, true); 97 92 plonetabs-toggleRootsVisibility-checked: currentFormVar(); 93 plonetabs-toggleRootsVisibility-error: plonetabs-handleServerError; 98 94 } 99 95 … … 108 104 109 105 /* Add form rules */ 106 107 /* Save initial value of title field on adding form */ 108 #actname:load { 109 action-client: setStateVar; 110 setStateVar-varname: plonetabs-addingTitle; 111 setStateVar-value: currentFormVar(); 112 } 113 110 114 #actname:focus { 111 115 action-client: addClass;
