コード例 #1
0
ファイル: AJAX.py プロジェクト: olivierh59500/pyflag
    def make_menu_javascript(self, query):
        """ Creates the javascript required to generate the menu """
        ## Find all families:
        module_list = Registry.REPORTS.get_families()
        Theme.order_families(module_list)
        menus = []
        menus_titles = []

        result = ''
        for k in module_list:
            submenu_text = ''
            ## Add the reports in the family:
            report_list = Registry.REPORTS.family[k]
            for r in report_list:
                if r.hidden: continue

                submenu_text += '''<div dojoType="MenuItem2" caption="%s"  onClick="update_container('main','%s');"></div>\n''' % (
                    r.name,
                    FlagFramework.query_type((), family=k, report=r.name))

            if len(submenu_text) > 0:
                menus.append(
                    '<div dojoType="PopupMenu2" widgetId="%s" toggle="wipe">%s</div>\n'
                    % (k, submenu_text))
                menus_titles.append(
                    '<div dojoType="MenuBarItem2" caption="%s" submenuId="%s"></div>\n'
                    % (k, k))

        return result + '''
        %s
        <div dojoType="MenuBar2" id="menubar" layoutAlign="top">%s</div>
        <div dojoType="ToolbarContainer" layoutAlign="top" id="ToolbarContainer" bindArgs="preventCache:false;">
        <div dojoType="Toolbar" id="toolbar"></div></div>
        ''' % ('\n'.join(menus), '\n'.join(menus_titles))
コード例 #2
0
ファイル: Menus.py プロジェクト: anarchivist/pyflag
    def make_menu_javascript(self,query):
        """ Creates the javascript function required to generate the menu """
        result = '''<table class=MenuBar><tr>'''
        submenus = ''
        
        ## Find all families:
        module_list = Registry.REPORTS.get_families()
        Theme.order_families(module_list)

        for k in module_list:
            items = 0
            submenu_text = '\n<table class=PopupMenu id="PopupMenu%s">' % k
            ## Add the reports in the family:
            report_list = Registry.REPORTS.family[k]
            for r in report_list:
                if r.hidden: continue
                submenu_text+="<tr class='MenuItem' onclick='SelectMenuItem(\"f?report=%s&family=%s\")'><td>%s</td></tr>\n" % (r.name, k, r.name)
                items += 1
                continue

            if items > 0:
                result += "\n<td class=MenuBarItem id='MenuBarItem%s' onmouseover='displaySubMenu(\"%s\")'>%s</td>" % (k,k,k.replace(" ","&nbsp;"))
                submenus += submenu_text + "</table>"

        return result + "<td style='width=100%'></td></tr></table>" + submenus
コード例 #3
0
ファイル: AJAX.py プロジェクト: anarchivist/pyflag
    def make_menu_javascript(self,query):
        """ Creates the javascript required to generate the menu """
        ## Find all families:
        module_list = Registry.REPORTS.get_families()
        Theme.order_families(module_list)
        menus = []
        menus_titles=[]

        result = ''
        for k in module_list:
            submenu_text = ''
            ## Add the reports in the family:
            report_list = Registry.REPORTS.family[k]
            for r in report_list:
                if r.hidden: continue

                submenu_text+='''<div dojoType="MenuItem2" caption="%s"  onClick="update_container('main','%s');"></div>\n''' % (r.name,FlagFramework.query_type((),family=k,report=r.name))

            if len(submenu_text)>0:
                menus.append('<div dojoType="PopupMenu2" widgetId="%s" toggle="wipe">%s</div>\n' % (k,submenu_text))
                menus_titles.append('<div dojoType="MenuBarItem2" caption="%s" submenuId="%s"></div>\n'%(k,k))


        return result+'''
        %s
        <div dojoType="MenuBar2" id="menubar" layoutAlign="top">%s</div>
        <div dojoType="ToolbarContainer" layoutAlign="top" id="ToolbarContainer" bindArgs="preventCache:false;">
        <div dojoType="Toolbar" id="toolbar"></div></div>
        ''' % ('\n'.join(menus),'\n'.join(menus_titles))
コード例 #4
0
ファイル: Standard.py プロジェクト: anarchivist/pyflag
    def navbar(self,query=None,next=None,previous=None,pageno=None):
        """ Returns the HTML for the navigation bar. """
        if query==None: query=FlagFramework.query_type(())
        
        if not query.has_key('family'):
            query['family']=''
            
        if next:
            #Make a link
            q=query.clone()
            q.FillQueryTarget(next)
            next = '<a href="f?%s"><img height=25 src="/images/forward.png" border="0"></a>' % (str(q))
        else:
            next = '<img src="/images/arrow_right_grey.gif" height=25 border="0">'

        if previous<0:
            previous =  '<img src="/images/arrow_left_grey.gif" height=25 border="0">'
        else:
            q=query.clone()
            q.FillQueryTarget(previous)
            previous = '<a href="f?%s"><img height=25 src="/images/back.png"  border="0"></a>' %  (str(q))

        bar = {'family': Theme.propegate(query,FlagFramework.query_type()),'back': previous,'case': query['case'],'pageno':  pageno,'next': next,'reset': str(query)+'&reset=1','stop': str(query)+'&stop=1'}

        toolbar = '''<table><tr>
        <td valign="bottom"><a href="%(family)s"><img height=25 src="/images/home_grey.png" border="0"></a></td><td valign="bottom">%(back)s</td><td>%(case)s - page %(pageno)s</td><td valign="bottom">%(next)s</td> <td valign="bottom">
        <td valign="bottom"><a href="flag?%(reset)s"><img height=25 src="/images/reset_grey.png" border="0"></a></td></tr></table>''' % bar

        return toolbar
コード例 #5
0
ファイル: Standard.py プロジェクト: olivierh59500/pyflag
    def navbar(self, query=None, next=None, previous=None, pageno=None):
        """ Returns the HTML for the navigation bar. """
        if query == None: query = FlagFramework.query_type(())

        if not query.has_key('family'):
            query['family'] = ''

        if next:
            #Make a link
            q = query.clone()
            q.FillQueryTarget(next)
            next = '<a href="f?%s"><img height=25 src="/images/forward.png" border="0"></a>' % (
                str(q))
        else:
            next = '<img src="/images/arrow_right_grey.gif" height=25 border="0">'

        if previous < 0:
            previous = '<img src="/images/arrow_left_grey.gif" height=25 border="0">'
        else:
            q = query.clone()
            q.FillQueryTarget(previous)
            previous = '<a href="f?%s"><img height=25 src="/images/back.png"  border="0"></a>' % (
                str(q))

        bar = {
            'family': Theme.propegate(query, FlagFramework.query_type()),
            'back': previous,
            'case': query['case'],
            'pageno': pageno,
            'next': next,
            'reset': str(query) + '&reset=1',
            'stop': str(query) + '&stop=1'
        }

        toolbar = '''<table><tr>
        <td valign="bottom"><a href="%(family)s"><img height=25 src="/images/home_grey.png" border="0"></a></td><td valign="bottom">%(back)s</td><td>%(case)s - page %(pageno)s</td><td valign="bottom">%(next)s</td> <td valign="bottom">
        <td valign="bottom"><a href="flag?%(reset)s"><img height=25 src="/images/reset_grey.png" border="0"></a></td></tr></table>''' % bar

        return toolbar
コード例 #6
0
ファイル: Standard.py プロジェクト: anarchivist/pyflag
    def menu(self,flag,query, result):
        """ Draws the menu for the current family.

        @arg flag: A Flag object containing the appropriate dispatcher
        @arg query: The user query
        """
        family = query['family']
        module_list = Registry.REPORTS.get_families()
        Theme.order_families(module_list)
        
        result=flag.ui()

        result.result='''<table cellspacing=0 cellpadding=0 width="100%" border=0 
                  hspace="0" vspace="0" height="300">
              <tbody> 
              <tr> 
                <td width=5><img height=22 alt="table corner" 
                        src="images/metbarleft.gif" 
                        width=5></td>
                <td width="918"> 
                  <table cellspacing=0 cellpadding=0 width="100%" 
                        background="images/metbarfill.gif" 
                        border=0 hspace="0" vspace="0">

                    <tbody>                    <tr> 
                      <td height=22> 
                        <div align="left"><font 
                              face="Verdana, Arial, Helvetica, sans-serif" 
                              size=2></font><font 
                              face="Verdana, Arial, Helvetica, sans-serif"><b><font size="2">Main 
                          Menu</font></b></font></div>
                      </td>
                    </tr>                    </tbody> 
                  </table>
                </td>
                <td width=10><img height=22 alt="table corner" 
                        src="images/metbarend.gif" 
                        width=8></td>

              </tr>              <tr> 
                <td width=5 
                      background="images/sidebarleft.gif">&nbsp;</td>
                <td valign=top width="918"> 
                  <p><font size="+1" face="Arial, Helvetica, sans-serif">'''
        
        for k in module_list:
            link = flag.ui()
            link.link(k,family=k)
            result.result+='''&nbsp;&nbsp;%s<br />\n''' % (link,)

            if family==k:
                report_list = Registry.REPORTS.family[family]
                for r in report_list:
                    if r.hidden: continue
                    link = flag.ui()
                    link.link(r.name,target=Theme.propegate(query,FlagFramework.query_type()),tooltip=r.__doc__,report=r.name)
                    
                    result.result+="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><big>&middot;</big></strong>&nbsp;%s <br />\n" % link
                result.result+="<br/>"

        result.result+='''                    </font></p>
                </td>
                <td width=10 
                      background="images/sidebarrgt.gif">&nbsp;</td>

              </tr>
              <tr> 
                <td width=5><img height=22 alt="table corner" 
                        src="images/greenbarleft.gif" 
                        width=5></td>
                <td width="918"> 
                  <table cellspacing=0 cellpadding=0 width="100%" 
                        background="images/greenbarfill.gif" 
                        border=0>
                    <tbody> 
                    <tr> 
                      <td height=22>&nbsp;</td>
                    </tr>
                    </tbody> 
                  </table>

                </td>
                <td width=10><img height=22 alt="table corner" src="images/greenbarrgt.gif" width=8></td>
              </tr>
              </tbody> 
            </table>
            '''

        return result
コード例 #7
0
ファイル: Standard.py プロジェクト: olivierh59500/pyflag
    def menu(self, flag, query, result):
        """ Draws the menu for the current family.

        @arg flag: A Flag object containing the appropriate dispatcher
        @arg query: The user query
        """
        family = query['family']
        module_list = Registry.REPORTS.get_families()
        Theme.order_families(module_list)

        result = flag.ui()

        result.result = '''<table cellspacing=0 cellpadding=0 width="100%" border=0 
                  hspace="0" vspace="0" height="300">
              <tbody> 
              <tr> 
                <td width=5><img height=22 alt="table corner" 
                        src="images/metbarleft.gif" 
                        width=5></td>
                <td width="918"> 
                  <table cellspacing=0 cellpadding=0 width="100%" 
                        background="images/metbarfill.gif" 
                        border=0 hspace="0" vspace="0">

                    <tbody>                    <tr> 
                      <td height=22> 
                        <div align="left"><font 
                              face="Verdana, Arial, Helvetica, sans-serif" 
                              size=2></font><font 
                              face="Verdana, Arial, Helvetica, sans-serif"><b><font size="2">Main 
                          Menu</font></b></font></div>
                      </td>
                    </tr>                    </tbody> 
                  </table>
                </td>
                <td width=10><img height=22 alt="table corner" 
                        src="images/metbarend.gif" 
                        width=8></td>

              </tr>              <tr> 
                <td width=5 
                      background="images/sidebarleft.gif">&nbsp;</td>
                <td valign=top width="918"> 
                  <p><font size="+1" face="Arial, Helvetica, sans-serif">'''

        for k in module_list:
            link = flag.ui()
            link.link(k, family=k)
            result.result += '''&nbsp;&nbsp;%s<br />\n''' % (link, )

            if family == k:
                report_list = Registry.REPORTS.family[family]
                for r in report_list:
                    if r.hidden: continue
                    link = flag.ui()
                    link.link(r.name,
                              target=Theme.propegate(
                                  query, FlagFramework.query_type()),
                              tooltip=r.__doc__,
                              report=r.name)

                    result.result += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><big>&middot;</big></strong>&nbsp;%s <br />\n" % link
                result.result += "<br/>"

        result.result += '''                    </font></p>
                </td>
                <td width=10 
                      background="images/sidebarrgt.gif">&nbsp;</td>

              </tr>
              <tr> 
                <td width=5><img height=22 alt="table corner" 
                        src="images/greenbarleft.gif" 
                        width=5></td>
                <td width="918"> 
                  <table cellspacing=0 cellpadding=0 width="100%" 
                        background="images/greenbarfill.gif" 
                        border=0>
                    <tbody> 
                    <tr> 
                      <td height=22>&nbsp;</td>
                    </tr>
                    </tbody> 
                  </table>

                </td>
                <td width=10><img height=22 alt="table corner" src="images/greenbarrgt.gif" width=8></td>
              </tr>
              </tbody> 
            </table>
            '''

        return result