Changes between Version 11 and Version 12 of AnotherPluginDevelopmentGuide
- Timestamp:
- 17.09.2012 16:18:39 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AnotherPluginDevelopmentGuide
v11 v12 352 352 } 353 353 354 // define type specific commands and register them 354 // define type specific commands and register them 355 355 dm4c.add_listener('topic_commands', function (topic) { 356 356 return topic.type_uri !== 'dm4.example.type' ? [] : [{ 357 357 context: ['context-menu', 'detail-panel-show'], 358 label: 'Increase me!', handler: increaseExample 358 label: 'Increase me!', 359 handler: increaseExample 359 360 }] 360 361 }) 361 362 362 363 // register an additional create command 363 dm4c.add_listener("post_refresh_create_menu", function(type_menu) { 364 type_menu.add_separator() 365 type_menu.add_item({ label: "New Example", handler: createAnotherExample }) 364 dm4c.add_listener('post_refresh_create_menu', function(type_menu) { 365 if (dm4c.has_create_permission('dm4.example.type')) { 366 type_menu.add_separator() 367 type_menu.add_item({ 368 label: 'New Example', 369 handler: createAnotherExample 370 }) 371 } 366 372 }) 367 373 })