Exemplo n.º 1
0
 def load_all(self):
     height = None
     if self.userid == 'admin' :
         menu = ColMenu.tidy_data(config.menu['main'] + config.menu['main_admin'])
     else:
         menu = ColMenu.tidy_data(config.menu['main'])
     background = self.render_str('menu_main')
     return (menu, height, background)
Exemplo n.º 2
0
 def load_all(self):
     height = None
     menu = ColMenu.tidy_data(config.menu[self.menuname])
     if ('menu_%s' % self.menuname) in config.all_static_file:
         background = self.render_str('menu_%s' % self.menuname)
     else:
         background = ''
     return (menu, height, background)
Exemplo n.º 3
0
 def load_all(self):
     sections = manager.section.get_all_section()
     height = len(sections)
     sections_d = map(self.wrapper_li, enumerate(sections))
     if sections_d :
         sections_d[0] += (self.second_start_point,)
     menu = ColMenu.tidy_data(tuple(sections_d) + config.menu['section'])
     background = self.render_str('menu_section')
     return (menu, height, background)
Exemplo n.º 4
0
 def tidy_perm_menu(self, menu):
     buf = []
     for op in menu :
         if op[0] :
             if manager.perm.check_perm(self.userid, op[0]) :
                 buf.append(op[1:])
         else:
             buf.append(op[1:])
     if not buf:
         self.pause_back(u'你无权进入这个菜单!')
     return ColMenu.tidy_data(buf)
Exemplo n.º 5
0
 def tidy_perm_menu(self, menu):
     buf = []
     for op in menu:
         if op[0]:
             if manager.perm.check_perm(self.userid, op[0]):
                 buf.append(op[1:])
         else:
             buf.append(op[1:])
     if not buf:
         self.pause_back(u'你无权进入这个菜单!')
     return ColMenu.tidy_data(buf)
Exemplo n.º 6
0
 def load_all(self):
     sections = manager.query.get_all_section()
     if not sections:
         self.cls()
         self.writeln(u'未设置分类讨论区!')
         self.pause()
         self.goto_back()            
     height = len(sections)
     sections_d = map(self.wrapper_li, enumerate(sections))
     if sections_d :
         sections_d[0] += (self.second_start_point,)
     menu = ColMenu.tidy_data(sections_d + config.menu['section'])
     background = self.render_str('menu_section')
     return (menu, height, background)
Exemplo n.º 7
0
 def initialize(self):
     manager.status.set_status(self.seid, manager.status.SELECT)
     title = config.menu['__zhname__']['sections']
     sections = manager.query.get_all_section()
     if not sections :
         self.cls()
         self.pause_back(u'未设置分类讨论区!')
     height = len(sections)
     section_d = map(self._wrapper_li, enumerate(sections))
     if section_d :
         section_d[0] += (self._SECOND_COL,)
     menu = ColMenu.tidy_data(section_d + config.menu['__section__'])
     background = self.render_str('menu_section')
     self.setup(title, background, menu, height=height)
Exemplo n.º 8
0
 def initialize(self):
     manager.status.set_status(self.seid, manager.status.SELECT)
     title = config.menu['__zhname__']['sections']
     sections = manager.query.get_all_section()
     if not sections:
         self.cls()
         self.pause_back(u'未设置分类讨论区!')
     height = len(sections)
     section_d = map(self._wrapper_li, enumerate(sections))
     if section_d:
         section_d[0] += (self._SECOND_COL, )
     menu = ColMenu.tidy_data(section_d + config.menu['__section__'])
     background = self.render_str('menu_section')
     self.setup(title, background, menu, height=height)
Exemplo n.º 9
0
 def load_all(self):
     height = None
     menu = ColMenu.tidy_data(config.menu[self.menuname])
     background = self.render_str('menu_%s' % self.menuname)
     return (menu, height, background)
Exemplo n.º 10
0
 def load_all(self):
     height = None
     menu = ColMenu.tidy_data(config.menu['main'])
     background = self.render_str('menu_main')
     return (menu, height, background)