Пример #1
0
 def get_options(cls):
     return [{'name': x.class_id, 'value': x.class_title} for x
         in resources_registry.values() if issubclass(x, Payment)]
Пример #2
0
# Add ITWS_ControlPanel for Images resources
Image.class_views = ["view", "download", "edit", "externaledit", "control_panel"]
Image.control_panel = ITWS_ControlPanel()
Image.class_control_panel = ["externaledit", "links", "backlinks", "commit_log"]
Image.externaledit = CPExternalEdit()
Image.links = CPDBResource_Links()
Image.backlinks = CPDBResource_Backlinks()
Image.commit_log = CPDBResource_CommitLog(access="is_allowed_to_edit")

# Add ITWS_ControlPanel for File resources
File.class_views = ["view", "edit", "externaledit", "control_panel"]
File.control_panel = ITWS_ControlPanel()
File.class_control_panel = ["links", "backlinks", "commit_log"]
File.links = CPDBResource_Links()
File.backlinks = CPDBResource_Backlinks()
File.commit_log = CPDBResource_CommitLog(access="is_allowed_to_edit")

# Hide in browse_content
CSS.is_content = False


# Add navigator to all resources
for cls in resources_registry.values():
    if issubclass(cls, Folder):
        cls.manage_content = Browse_Navigator()
        cls.manage_content_rename = Browse_Navigator_Rename()
    cls.add_image = ITWS_DBResource_AddImage()
    cls.add_link = ITWS_DBResource_AddLink()
    cls.add_media = ITWS_DBResource_AddMedia()