Changeset 1086
- Timestamp:
- 03/11/08 10:21:50
- Files:
-
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/kssactions.zcml (modified) (1 diff)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py (modified) (4 diffs)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.kss (modified) (3 diffs)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/config.py (modified) (1 diff)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/plugins/plugin.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/kssactions.zcml
r1084 r1086 27 27 /> 28 28 29 <browser:page 30 for="plone.app.kss.interfaces.IPortalObject" 31 attribute="deleteAction" 32 class=".plonetabs.PloneTabsControlPanel" 33 name="plonetabs-deleteAction" 34 permission="cmf.ManagePortal" 35 /> 36 29 37 </configure> qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py
r1085 r1086 195 195 withKssSetup="False") 196 196 197 198 # XXX TODO 199 #def updateSection(self, ksscore, section): 200 #""" Method for updating global-sections on client """ 201 202 #replace_id = section 203 #macro = SECTION_MAPPING.get(section, None) 204 205 #if macro is not None: 206 #ksscore.replaceHTML( 207 #ksscore.getHtmlIdSelector(replace_id), 208 #self.macroContent(macro), 209 ##self.sections_template(), 210 #withKssSetup="False") 211 197 212 @kssaction 198 213 def toggleGeneratedTabs(self, field, checked='0'): … … 226 241 227 242 cat_container = portal_actions[category] 228 if act_id not in cat_container.objectIds():243 if act_id not in map(lambda x: x.id, filter(lambda x: IAction.providedBy(x), cat_container.objectValues())): 229 244 raise KSSExplicitError, "%s action does not exist in %s category" % (act_id, category) 230 245 … … 243 258 244 259 # update global-sections viewlet 245 self.updateGlobalSections(ksscore) 260 if category == "portal_tabs": 261 self.updateGlobalSections(ksscore) 246 262 247 263 @kssaction … … 272 288 self.updateGlobalSections(ksscore) 273 289 274 275 276 277 290 @kssaction 291 def deleteAction(self, id, category): 292 """ Delete portal action with given id & category """ 293 portal_actions = getToolByName(self.context, "portal_actions") 294 295 if category not in portal_actions.objectIds(): 296 raise KSSExplicitError, "Unexistent root portal actions category %s" % category 297 298 # remove prefix, added for making ids on configlet unique ("tabslist_") 299 act_id = id[len("tabslist_"):] 300 301 cat_container = portal_actions[category] 302 if act_id not in map(lambda x: x.id, filter(lambda x: IAction.providedBy(x), cat_container.objectValues())): 303 raise KSSExplicitError, "%s action does not exist in %s category" % (act_id, category) 304 305 cat_container.manage_delObjects(ids=[act_id,]) 306 307 # update action list on client 308 ksscore = self.getCommandSet("core") 309 310 ksscore.deleteNode(ksscore.getHtmlIdSelector(id)) 311 312 # add "noitems" class to Reorder controls to hide it 313 if not filter(lambda x: IAction.providedBy(x), cat_container.objectValues()): 314 ksscore.addClass(ksscore.getHtmlIdSelector("reorder"), value="noitems") 315 316 # XXX TODO: fade effect during removing, for this kukit js action/command plugin needed 317 318 # update global-sections viewlet 319 if category == "portal_tabs": 320 self.updateGlobalSections(ksscore) 321 322 323 324 325 326 327 328 qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.kss
r1084 r1086 22 22 } 23 23 24 /* Hovering for IE especially 24 /*Hovering for IE especially */ 25 25 #app li:mouseover { 26 26 action-client: addClass; … … 32 32 removeClass-value: onHover; 33 33 } 34 */ 34 35 35 36 36 /* Automatically generated tabs */ … … 60 60 plonetabs-toggleRootsVisibility-checked: currentFormVar(); 61 61 } 62 63 /* Delete action link */ 64 #tabslist .delete:click { 65 evt-click-preventdefault: True; 66 evt-click-allowbubbling: True; 67 action-server: plonetabs-deleteAction; 68 plonetabs-deleteAction-id: nodeAttr(id, true); 69 plonetabs-deleteAction-category: stateVar(plonetabs-category); 70 } 71 72 qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/config.py
r1082 r1086 1 1 PROPERTY_SHEET = "tabs_properties" 2 2 FIELD_NAME = "titles" 3 4 # XXX TODO 5 SECTION_MAPPING = {"portal-globalnav" : "global_sections/macros/portal_tabs", 6 "user" : "", 7 "portal-siteactions" : ""} 3 8 4 9 """ Example javascript qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/plugins/plugin.js
r1084 r1086 24 24 25 25 }); 26 kukit.commandsGlobalRegistry.registerFromAction('plonetabs-redirectTo',27 kukit.cr.makeSelectorCommand);28 26 27 kukit.commandsGlobalRegistry.registerFromAction('plonetabs-redirectTo', kukit.cr.makeSelectorCommand); 28
