Example #1
0
 def renderEditButtons(self):
     """
     Returns an XHTML string for the edit buttons
     """
     html  = common.submitImage(u"done", self.id, 
                                u"/images/stock-apply.png", 
                                _(u"Done"),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, 
                                    u"/images/stock-go-up.png", 
                                    _(u"Move Up"),1)
     if self.idevice.isLast():
         html += common.image(u"moveNext", u"/images/stock-go-down-off.png")
     else:
         html += common.submitImage(u"moveNext", self.id, 
                                    u"/images/stock-go-down.png", 
                                    _(u"Move Down"),1)
     options  = [(_(u"---Move To---"), "")]
     options += self.__getNodeOptions(self.package.root, 0)
     html += common.select(u"move", self.id, options)
     if self.purpose.strip() or self.tip.strip():
         html += u'<a title="%s" ' % _(u'Pedagogical Help')
         html += u'onmousedown="Javascript:updateCoords(event);" '
         html += u"onclick=\"Javascript:showMe('p"+self.id+"', 420, 240);\" "
         html += u'href="Javascript:void(0)" style="cursor:help;"> ' 
         html += u'<img alt="%s" class="info" src="/images/info.png" ' \
                 % _('Information')
         html += u'style="align:middle;" /></a>\n'
         html += u'<div id="p%s" style="display:none;">' % self.id
         html += u'<div style="float:right;">'
         html += u'<img alt="%s" src="/images/stock-stop.png" ' % _('Close')
         html += u' title="%s" ' % _(u"Close")
         html += u'onmousedown="Javascript:hideMe();"/></div>'
         if self.purpose != "":
             html += u'<div class="popupDivLabel">'
             html += u' ' + _(u"Purpose") + u'</div>'
             html += self.purpose 
         if self.tip != "":
             html += u'<div class="block"><b>' + _(u"Tip:") + u'</b></div>'
             html += self.tip 
             html += u'\n'
         html += u'</div><br/><br/>\n'    
     return html
Example #2
0
 def renderView(self):
     """
     Returns an XHTML string for viewing this image
     """
     if not self.field.imageResource:
         self.field.setDefaultImage()
     html = common.image("img"+self.id, 
                          self.field.imageResource.storageName, 
                          self.field.width,
                          self.field.height)
     return html
Example #3
0
    def renderEdit(self):
        """
        Returns an XHTML string with the form element for editing this field
        """
        html = common.textInput("name" + self.id, self.field.name, 25)
        html += common.submitImage("deleteField", self.id, "/images/stock-cancel.png", _("Delete"), 1)
        html += "<br/>\n"
        html += common.image(
            "img" + self.id, "/images/" + ImageEditorElement.DefaultImage, self.field.width, self.field.height
        )
        html += "<br/>\n"

        this_package = None
        html += common.formField("richTextArea", this_package, "", "instruc", self.id, "", self.field.instruc)
        return html
Example #4
0
    def renderPreview(self):
        """
        Returns an XHTML string with the form element for previewing this field
        """
        html = "<b>" + self.field.name + "</b> "
        if self.field.instruc != "":
            html += common.elementInstruc(self.field.instruc)
        html += "<br/>"
        html += common.image(
            "img" + self.id, "/images/" + ImageEditorElement.DefaultImage, self.field.width, self.field.height
        )
        floatArr = [[_(u"Left"), "left"], [_(u"Right"), "right"], [_(u"None"), "none"]]

        this_package = None
        html += common.formField("select", this_package, _("Align:"), "float" + self.id, "", "", floatArr, "")
        html += "<br/>\n"
        return html
Example #5
0
    def renderEdit(self):
        """
        Returns an XHTML string with the form element for editing this field
        """
        html  = common.textInput("name"+self.id, self.field.name, 25)
        html += common.submitImage("deleteField", self.id, 
                                   "/images/stock-cancel.png", 
                                   _("Delete"), 1)
        html += "<br/>\n"
        html += common.image("img"+self.id, 
                             "/images/"+ImageEditorElement.DefaultImage,
                             self.field.width,
                             self.field.height)
        html += "<br/>\n"

        this_package = None
        html += common.formField('richTextArea', this_package, '','instruc',
                                 self.id, '',
                                 self.field.instruc)
        return html
Example #6
0
 def renderPreview(self):
     """
     Returns an XHTML string with the form element for previewing this field
     """
     html  = "<b>" + self.field.name + "</b> "
     if self.field.instruc != "":
         html += common.elementInstruc(self.field.instruc)
     html += "<br/>" 
     html += common.image("img"+self.id, 
                          "/images/"+ImageEditorElement.DefaultImage,
                          self.field.width,
                          self.field.height)
     floatArr    = [[_(u'Left'), 'left'],
                   [_(u'Right'), 'right'],
                   [_(u'None'),  'none']]
     html += common.formField('select', _("Align:"),
                              "float" + self.id, '',
                              '',
                              floatArr, '')
     html += "<br/>\n"
     return html
Example #7
0
    def renderPreview(self):
        """
        Returns an XHTML string with the form element for previewing this field
        """
        html  = "<b>" + self.field.name + "</b> "
        if self.field.instruc != "":
            html += common.elementInstruc(self.field.instruc)
        html += "<br/>" 
        html += common.image("img"+self.id, 
                             "/images/"+ImageEditorElement.DefaultImage,
                             self.field.width,
                             self.field.height)
        floatArr    = [[_(u'Left'), 'left'],
                      [_(u'Right'), 'right'],
                      [_(u'None'),  'none']]

        this_package = None
        html += common.formField('select', this_package, _("Align:"),
                                 "float" + self.id, '',
                                 '',
                                 floatArr, '')
        html += "<br/>\n"
        return html
Example #8
0
    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, u"/images/stock-go-up.png",
                                       _(u"Move Up"), 1)

        if self.idevice.isLast():
            html += common.image(u"moveNext", u"/images/stock-go-down-off.png")
        else:
            html += common.submitImage(u"moveNext", self.id,
                                       u"/images/stock-go-down.png",
                                       _(u"Move Down"), 1)

        options = [(_(u"---Move To---"), "")]
        options += self.__getNodeOptions(self.package.root, 0)
        html += common.select(u"move", self.id, options)

        if self.purpose.strip() or self.tip.strip():
            html += u'<a title="%s" ' % _(u'Pedagogical Help')
            html += u'onmousedown="Javascript:updateCoords(event);" '
            html += u"onclick=\"Javascript:showMe('p" + self.id + "', 420, 240);\" "
            html += u'href="Javascript:void(0)" style="cursor:help;"> '
            html += u'<img alt="%s" class="info" src="/images/info.png" ' \
                    % _('Information')
            html += u'style="align:middle;" /></a>\n'
            html += u'<div id="p%s" style="display:none;">' % self.id
            html += u'<div style="float:right;">'
            html += u'<img alt="%s" src="/images/stock-stop.png" ' % _('Close')
            html += u' title="%s" ' % _(u"Close")
            html += u'onmousedown="Javascript:hideMe();"/></div>'

            if self.purpose != "":
                html += u'<div class="popupDivLabel">'
                html += u' ' + _(u"Purpose") + u'</div>'
                html += self.purpose

            if self.tip != "":
                html += u'<div class="block"><b>' + _(u"Tip:") + u'</b></div>'
                html += self.tip
                html += u'\n'

            html += u'</div><br/><br/>\n'

        return html
Example #9
0
    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.confirmThenSubmitImage(
                _(u"Exit without saving?"),
                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. 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", 16, 16, None, u"submit")
        else:
            html += common.submitImage(u"movePrev", self.id, 
                                       u"/images/stock-go-up.png", 
                                       _(u"Move Up"),1)

        if self.idevice.isLast():
            html += common.image(u"moveNext", u"/images/stock-go-down-off.png", 16, 16, None, u"submit")
        else:
            html += common.submitImage(u"moveNext", self.id, 
                                       u"/images/stock-go-down.png", 
                                       _(u"Move Down"),1)

        options  = [(_(u"---Move To---"), "")]
        options += self.__getNodeOptions(self.package.root, 0)
        html += common.select(u"move", self.id, options)

        if self.purpose.strip() or self.tip.strip():
            html += u'<a title="%s" ' % _(u'Pedagogical Help')
            html += u"onclick=\"showMessageBox('"+self.id+"');\" "
            html += u'href="javascript:void(0)" style="cursor:help;margin-left:.2em;">' 
            html += u'<img alt="%s" class="info" src="/images/info.png" ' \
                    % _('Information')
            html += u'style="align:middle;" /></a>\n'
            html += u'<div style="display:none;">'

            if self.purpose != "":
                html += u'<div id="'+self.id+'title">'+_(u"Purpose")+'</div>'
                html += u'<div id="'+self.id+'content">'+self.purpose+'</div>'
                
            if self.tip != "":
                html += u'<div id="'+self.id+'title">'+_(u"Tip:")+'</div>'
                html += u'<div id="'+self.id+'content">'+self.tip+'</div>'
                
            html += u'</div>\n'    
        
        return html
    def renderEditButtons(self, undo=True):
        """
        Returns an XHTML string for the edit buttons
        """
        html = "<br></br>"  #Added this so there is space between end of Idevice page and the icons at the botton when authoring
        html  += common.submitImage(u"done", self.id, 
                                   #u"/images/stock-apply.png", 
                                   u"/images/dialog-ok-apply-2.png",
                                   _(u"Done"),1)
        html +="&nbsp;" #Added

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

        html += common.confirmThenSubmitImage(
            _(u"This will delete this iDevice. Do you really want to do this?"),
            u"delete",
            #self.id, u"/images/stock-cancel.png", 
            self.id, u"/images/dialog-cancel-3.png",
            _(u"Delete"), 1)
        html +="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" #Added

        if self.idevice.isFirst():
            html += common.image(u"movePrev", u"/images/draw-arrow-up-off.png", alt=None, cssClass=u"submit")
            html +="&nbsp;"
        else:
            html += common.submitImage(u"movePrev", self.id, 
                                       u"/images/draw-arrow-up.png",
                                       _(u"Move Up"),1)
            html +="&nbsp;" 

        if self.idevice.isLast():
            html += common.image(u"moveNext", u"/images/draw-arrow-down-off.png", alt=None, 
                                 cssClass=u"submit")
            html +="&nbsp;" 
        else:
            html += common.submitImage(u"moveNext", self.id, 
                                       u"/images/draw-arrow-down.png",
                                       _(u"Move Down"),1)
            html +="&nbsp;" 
            
        html += "<br></br>" #There is no space, line between the finish icons in page and Move To option.    
        options  = [(_(u"---Move To---"), "")]
        options += self.__getNodeOptions(self.package.root, 0)
        html += common.select(u"move", self.id, options)

        if self.purpose.strip() or self.tip.strip():
            html += u'<a title="%s" ' % _(u'Pedagogical Help')
            html += u'onmousedown="Javascript:updateCoords(event);" '
            html += u"onclick=\"Javascript:showMe('p"+self.id+"', 420, 240);\" "
            html += u'href="Javascript:void(0)" style="cursor:help;"> ' 
            html += u'<img alt="%s" class="info" src="/images/info.png" ' \
                    % _('Information')
            html += u'style="align:middle;" /></a>\n'
            html += u'<div id="p%s" style="display:none;">' % self.id
            html += u'<div style="float:right;">'
            html += u'<img alt="%s" src="/images/stock-stop.png" ' % _('Close')
            html += u' title="%s" ' % _(u"Close")
            html += u'onmousedown="Javascript:hideMe();"/></div>'

            if self.purpose != "":
                html += u'<div class="popupDivLabel">'
                html += u' ' + _(u"Purpose") + u'</div>'
                html += self.purpose 
                
            if self.tip != "":
                html += u'<div class="block"><b>' + _(u"Tip:") + u'</b></div>'
                html += self.tip 
                html += u'\n'
                
            html += u'</div><br/><br/>\n'    
        
        return html