def page():
 found = True
 get_vars = request.get_vars
 if ('name' in get_vars):
  table = s3db.cms_post
  query = ((table.name == get_vars.name) & (table.deleted != True))
  row = db(query).select(table.id, limitby=(0, 1)).first()
  if row:
   request.args.append(str(row.id))
  else:
   found = False
 def prep(r):
  if (not found):
   r.error(404, T('Page not found'), next=auth.permission.homepage)
  s3db.configure(r.tablename, listadd=False)
  return True
 s3.prep = prep
 def postp(r, output):
  if (r.record and (not r.transformable())):
   output = {'item': s3base.S3XMLContents(r.record.body).xml()}
   current.menu.options = None
   response.view = s3base.S3CRUD._view(r, 'cms/page.html')
   if r.record.replies:
    ckeditor = URL(c='static', f='ckeditor', args='ckeditor.js')
    s3.scripts.append(ckeditor)
    adapter = URL(c='static', f='ckeditor', args=['adapters', 'jquery.js'])
    s3.scripts.append(adapter)
    js = ''.join(('i18n.reply="', str(T('Reply')), '"\nvar img_path=S3.Ap.concat(\'/static/img/jCollapsible/\')\nvar ck_config={toolbar:[[\'Bold\',\'Italic\',\'-\',\'NumberedList\',\'BulletedList\',\'-\',\'Link\',\'Unlink\',\'-\',\'Smiley\',\'-\',\'Source\',\'Maximize\']],toolbarCanCollapse:false,removePlugins:\'elementspath\'}\nfunction comment_reply(id){\n $(\'#cms_comment_post_id__row\').hide()\n $(\'#cms_comment_post_id__row1\').hide()\n $(\'#comment-title\').html(i18n.reply)\n $(\'#cms_comment_body\').ckeditorGet().destroy()\n $(\'#cms_comment_body\').ckeditor(ck_config)\n $(\'#comment-form\').insertAfter($(\'#comment-\'+id))\n $(\'#cms_comment_parent\').val(id)\n var post_id = $(\'#comment-\'+id).attr(\'post_id\')\n $(\'#cms_comment_post_id\').val(post_id)\n}'))
    s3.js_global.append(js)
  return output
 s3.postp = postp
 output = s3_rest_controller('cms', 'post')
 return output

def page ( ) : found = True get_vars = request . get_vars if ( 'name' in get_vars ) : table = s3db . cms_post query = ( ( table . name == get_vars . name ) & ( table . deleted != True ) ) row = db ( query ) . select ( table . id , limitby = ( 0 , 1 ) ) . first ( ) if row : request . args . append ( str ( row . id ) ) else : found = False def prep ( r ) : if ( not found ) : r . error ( 404 , T ( 'Page not found' ) , next = auth . permission . homepage ) s3db . configure ( r . tablename , listadd = False ) return True s3 . prep = prep def postp ( r , output ) : if ( r . record and ( not r . transformable ( ) ) ) : output = { 'item' : s3base . S3XMLContents ( r . record . body ) . xml ( ) } current . menu . options = None response . view = s3base . S3CRUD . _view ( r , 'cms/page.html' ) if r . record . replies : ckeditor = URL ( c = 'static' , f = 'ckeditor' , args = 'ckeditor.js' ) s3 . scripts . append ( ckeditor ) adapter = URL ( c = 'static' , f = 'ckeditor' , args = [ 'adapters' , 'jquery.js' ] ) s3 . scripts . append ( adapter ) js = '' . join ( ( 'i18n.reply="' , str ( T ( 'Reply' ) ) , '"\nvar img_path=S3.Ap.concat(\'/static/img/jCollapsible/\')\nvar ck_config={toolbar:[[\'Bold\',\'Italic\',\'-\',\'NumberedList\',\'BulletedList\',\'-\',\'Link\',\'Unlink\',\'-\',\'Smiley\',\'-\',\'Source\',\'Maximize\']],toolbarCanCollapse:false,removePlugins:\'elementspath\'}\nfunction comment_reply(id){\n $(\'#cms_comment_post_id__row\').hide()\n $(\'#cms_comment_post_id__row1\').hide()\n $(\'#comment-title\').html(i18n.reply)\n $(\'#cms_comment_body\').ckeditorGet().destroy()\n $(\'#cms_comment_body\').ckeditor(ck_config)\n $(\'#comment-form\').insertAfter($(\'#comment-\'+id))\n $(\'#cms_comment_parent\').val(id)\n var post_id = $(\'#comment-\'+id).attr(\'post_id\')\n $(\'#cms_comment_post_id\').val(post_id)\n}' ) ) s3 . js_global . append ( js ) return output s3 . postp = postp output = s3_rest_controller ( 'cms' , 'post' ) return output
get a wikipediapage object for the page with title title or the pageid pageid .