Changes between Version 19 and Version 20 of DeveloperGuidelinesNewModule


Ignore:
Timestamp:
01/31/09 11:42:29 (13 years ago)
Author:
Fran Boon
Comment:

Controller header

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesNewModule

    v19 v20  
    100100Create a file: {{{/controllers/module.py}}}
    101101
    102 Add the T2 framework functions:
     102Add the S3 framework functions:
    103103{{{
    104 # T2 framework functions
    105 def login():
    106     response.view='default/login.html'
    107     return dict(form=t2.login(),module_name=module_name,modules=modules,options=options)
    108 def logout(): t2.logout(next='login')
    109 def register(): redirect(URL(r=request,c='default',f='register'))
    110 def profile(): redirect(URL(r=request,c='default',f='profile'))
     104module='veh'
     105# Current Module (for sidebar title)
     106module_name=db(db.s3_module.name==module).select()[0].name_nice
     107# List Modules (from which to build Menu of Modules)
     108modules=db(db.s3_module.enabled=='Yes').select(db.s3_module.ALL,orderby=db.s3_module.priority)
     109# List Options (from which to build Menu for this Module)
     110options=db(db['%s_menu_option' % module].enabled=='Yes').select(db['%s_menu_option' % module].ALL,orderby=db['%s_menu_option' % module].priority)
    111111}}}
    112112