def cms_documentation(r, default_page, default_url):
 row = r.record
 if (not row):
  name = r.get_vars.get('name', default_page)
  table = r.resource.table
  query = ((table.name == name) & (table.deleted != True))
  row = current.db(query).select(table.id, table.title, table.body, limitby=(0, 1)).first()
 if (not row):
  if (name != default_page):
   r.error(404, current.T('Page not found'), next=URL(args=current.request.args, vars={}))
  else:
   from s3 import s3_redirect_default
   s3_redirect_default(default_url)
 from s3 import S3XMLContents
 return {'bypass': True, 'output': {'title': row.title, 'contents': S3XMLContents(row.body)}}

def cms_documentation ( r , default_page , default_url ) : row = r . record if ( not row ) : name = r . get_vars . get ( 'name' , default_page ) table = r . resource . table query = ( ( table . name == name ) & ( table . deleted != True ) ) row = current . db ( query ) . select ( table . id , table . title , table . body , limitby = ( 0 , 1 ) ) . first ( ) if ( not row ) : if ( name != default_page ) : r . error ( 404 , current . T ( 'Page not found' ) , next = URL ( args = current . request . args , vars = { } ) ) else : from s3 import s3_redirect_default s3_redirect_default ( default_url ) from s3 import S3XMLContents return { 'bypass' : True , 'output' : { 'title' : row . title , 'contents' : S3XMLContents ( row . body ) } }
render an online documentation page .