# Path: exe/webui/common.py
# def newId():
# def docType():
# def header(style=u'default'):
# def footer():
# def hiddenField(name, value=u""):
# def textInput(name, value=u"", size=40, disabled=u"", **kwargs):
# def textArea(name, value="", disabled="", cols="80", rows="8"):
# def richTextArea(name, value="", width="100%", height=100, package=None):
# def image(name, value, width="", height="", alt=None):
# def flash(src, width, height, id_=None, params=None, **kwparams):
# def flashMovie(movie, width, height, resourcesDir='', autoplay='false'):
# def submitButton(name, value, enabled=True, **kwargs):
# def button(name, value, enabled=True, **kwargs):
# def feedbackButton(name, value=None, enabled=True, **kwparams):
# def submitImage(action, object_, imageFile, title=u"", isChanged=1):
# def insertSymbol(name, image, title, string, text ='', num=0):
# def confirmThenSubmitImage(message, action, object_, imageFile, 
#                            title=u"", isChanged=1):
# def option(name, checked, value):
# def checkbox(name, checked, value="", title="", instruction=""):
# def elementInstruc(instruc, imageFile="help.gif", label=None):
# def formField(type_, package, caption, action, object_='', instruction='', \
#         *args, **kwargs):
# def select(action, object_='', options=[], selection=None):
# def editModeHeading(text):
# def removeInternalLinks(html, anchor_name=""):
# def removeInternalLinkNodes(html):
# def findLinkedField(package, exe_node_path, anchor_name):
# def findLinkedNode(package, exe_node_path, anchor_name, check_fields=True):
# def getAnchorNameFromLinkName(link_name):
# def renderInternalLinkNodeFilenames(package, html):
# def requestHasCancel(request):


import sys
import logging
from exe.webui import common
from exe.webui.renderable import Renderable
from exe.engine.idevice   import Idevice
            from traceback import format_tb

    def renderEditButtons(self, undo=True):
        """
        Returns an XHTML string for the edit buttons
        """
        
        html  = common.submitImage(u"done", self.id, 
                                   u"/images/stock-apply.png", 
                                   _(u"Done"),1)

        if undo:
            html  += common.submitImage(u"cancel", self.id, 
                                   u"/images/stock-undo.png", 
                                   _(u"Undo Edits"),1)
        else:
            html  += common.submitImage(u"no_cancel", self.id, 
                                   u"/images/stock-undoNOT.png", 
                                   _(u"Can NOT Undo Edits"),1)

        html += common.confirmThenSubmitImage(
            _(u"This will delete this iDevice."
              u"\\n"
              u"Do you really want to do this?"),
            u"delete",
            self.id, u"/images/stock-cancel.png", 
            _(u"Delete"), 1)

        if self.idevice.isFirst():
            html += common.image(u"movePrev", u"/images/stock-go-up-off.png")
        else:

# Path: exe/webui/common.py
# def newId():
# def docType():
# def header(style=u'default'):
# def footer():
# def hiddenField(name, value=u""):
# def textInput(name, value=u"", size=40, disabled=u"", **kwargs):
# def textArea(name, value="", disabled="", cols="80", rows="8"):
# def richTextArea(name, value="", width="100%", height=100, package=None):
# def image(name, value, width="", height="", alt=None):
# def flash(src, width, height, id_=None, params=None, **kwparams):
# def flashMovie(movie, width, height, resourcesDir='', autoplay='false'):
# def submitButton(name, value, enabled=True, **kwargs):
# def button(name, value, enabled=True, **kwargs):
# def feedbackButton(name, value=None, enabled=True, **kwparams):
# def submitImage(action, object_, imageFile, title=u"", isChanged=1):
# def insertSymbol(name, image, title, string, text ='', num=0):
# def confirmThenSubmitImage(message, action, object_, imageFile, 
#                            title=u"", isChanged=1):
# def option(name, checked, value):
# def checkbox(name, checked, value="", title="", instruction=""):
# def elementInstruc(instruc, imageFile="help.gif", label=None):
# def formField(type_, package, caption, action, object_='', instruction='', \
#         *args, **kwargs):
# def select(action, object_='', options=[], selection=None):
# def editModeHeading(text):
# def removeInternalLinks(html, anchor_name=""):
# def removeInternalLinkNodes(html):
# def findLinkedField(package, exe_node_path, anchor_name):
# def findLinkedNode(package, exe_node_path, anchor_name, check_fields=True):
# def getAnchorNameFromLinkName(link_name):
# def renderInternalLinkNodeFilenames(package, html):
# def requestHasCancel(request):


# Path: exe/webui/block.py
import sys
import logging
from exe.webui import common
from exe.webui.renderable import Renderable
from exe.engine.idevice   import Idevice
            from traceback import format_tb


    def renderEditButtons(self, undo=True):
        """
        Returns an XHTML string for the edit buttons
        """
        
        html  = common.submitImage(u"done", self.id, 
                                   u"/images/stock-apply.png", 
                                   _(u"Done"),1)

        if undo:
            html  += common.submitImage(u"cancel", self.id, 
                                   u"/images/stock-undo.png", 
                                   _(u"Undo Edits"),1)
        else:
            html  += common.submitImage(u"no_cancel", self.id, 
                                   u"/images/stock-undoNOT.png", 
                                   _(u"Can NOT Undo Edits"),1)

        html += common.confirmThenSubmitImage(
            _(u"This will delete this iDevice."
              u"\\n"
              u"Do you really want to do this?"),
            u"delete",
            self.id, u"/images/stock-cancel.png", 
            _(u"Delete"), 1)

        if self.idevice.isFirst():
            html += common.image(u"movePrev", u"/images/stock-go-up-off.png")
        else:

            html += common.submitImage(u"movePrev", self.id, 