def get_title(my): option = my.get_option('multi_publish') if option and my.parent_wdg: search_type = my.parent_wdg.search_type if my.get_option('search_type'): search_type = my.get_option('search_type') publish_link = PublishLinkWdg(search_type, -1,\ icon=IconWdg.PUBLISH_MULTI, config_base='multi_publish_pickup', text='Multi Publish') publish_link.set_iframe_width(70) return publish_link else: return super(PublishTableElement, my).get_title()
def get_display(my): sobject = my.get_current_sobject() if sobject: episode_code = sobject.get_value('episode_code') sobject = my.sobject_dict.get(episode_code) if not sobject: return '' publish_link = PublishLinkWdg(sobject.get_search_type(), \ sobject.get_id(), config_base='publish_pickup') publish_link.set_iframe_width(70) return publish_link else: return ''
def get_display(my): my.view = my.kwargs.get('view') if not my.view: my.view = 'publish' widget = Widget() sobject = my.get_current_sobject() search_type = sobject.get_search_type() search_id = sobject.get_id() if my.get_option('preview') != 'false': my.thumb.set_current_index(my.get_current_index()) widget.add(my.thumb) publish_link = PublishLinkWdg(search_type,search_id, config_base=my.view) div = DivWdg(publish_link) div.set_style('clear: left; padding-top: 6px') widget.add(div) # build a popup link to show publish browsing browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS) browse_link.add_behavior({'type': 'click_up', 'cbjs_action': 'spt.popup.get_widget(evt, bvr)', 'options': {'popup_id' : 'publish_browser', 'class_name' : 'pyasm.prod.web.PublishBrowserWdg' , 'title': 'Publish Browser'}, 'args' : { 'search_type': search_type, 'search_id' : search_id } }) div.add(browse_link) div.set_style('padding-top: 6px') return widget
def get_display(my): widget = Widget() thumb = super(ThumbPublishWdg, my).get_display() widget.add(thumb) sobject = my.get_current_sobject() search_type = sobject.get_search_type() search_id = sobject.get_id() publish_link = PublishLinkWdg(search_type, search_id) div = DivWdg(publish_link) div.set_style('clear: left; padding-top: 6px') widget.add(div) # build an iframe to show publish browsing browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS) iframe = WebContainer.get_iframe() iframe.set_width(100) url = WebContainer.get_web().get_widget_url() url.set_option("widget", "pyasm.prod.web.PublishBrowserWdg") url.set_option("search_type", search_type) url.set_option("search_id", search_id) script = iframe.get_on_script(url.to_string()) browse_link.add_event("onclick", script) div.add(browse_link) div.set_style('padding-top: 6px') return widget
def _add_publish_link(self, main_div): publish_link = PublishLinkWdg(self.sobject.get_search_type(), self.sobject.get_id()) div = DivWdg(publish_link) div.add_style('padding-top', '5px') main_div.add(div) # build an iframe to show publish browsing search_type = self.sobject.get_search_type() search_id = self.sobject.get_id() from pyasm.widget import IconButtonWdg, IconWdg browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS) iframe = WebContainer.get_iframe() iframe.set_width(100) url = WebContainer.get_web().get_widget_url() url.set_option("widget", "pyasm.prod.web.PublishBrowserWdg") url.set_option("search_type", search_type) url.set_option("search_id", search_id) script = iframe.get_on_script(url.to_string()) browse_link.add_event("onclick", script) div.add(browse_link) div.set_style('padding-top: 6px')