users
[ class tree: users ] [ index: users ] [ all elements ]

Source for file edit_personal_page.php

Documentation is available at edit_personal_page.php

  1. <?php
  2. /**
  3.  * personal dashboard
  4.  *
  5.  * @copyright (c) 2004-15 bitweaver.org
  6.  *
  7.  * @package users
  8.  * @subpackage functions
  9.  */
  10.  
  11. /**
  12.  * required setup
  13.  */
  14. require_once( '../kernel/setup_inc.php' );
  15.  
  16. $gBitUser->verifyRegistered();
  17.  
  18. // Check if the page has changed
  19. if (isset($_REQUEST["fSavePage"])) {
  20.     $gBitUser->store( $_REQUEST );
  21.     header( "Location:".USERS_PKG_URL."index.php?home=".$gBitUser->mUsername );
  22.     die;
  23. }elseif( isset($_REQUEST["fCancel"]) ){
  24.     header( "Location:".USERS_PKG_URL."index.php?home=".$gBitUser->mUsername );
  25.     die;
  26. }
  27.  
  28. // see if we should show the attachments tab at all
  29. foreach( $gLibertySystem->mPlugins as $plugin ) {
  30.     if( ( $plugin['plugin_type'] == 'storage' ) && ( $plugin['is_active'] == 'y' ) ) {
  31.         $gBitSmarty->assign( 'show_attachments','y' );
  32.     }
  33. }
  34.  
  35. $gBitSmarty->assign('preview',0);
  36. // If we are in preview mode then preview it!
  37. if(isset($_REQUEST["preview"])) {
  38.     $gBitSmarty->assign('preview',1);
  39.     $gBitUser->mInfo['title'] = $_REQUEST["title"];
  40.     if(isset($_REQUEST["description"])) {
  41.         $gBitUser->mInfo['description'] = $_REQUEST["description"];
  42.     }
  43.     $gBitUser->mInfo['data'] = $_REQUEST["edit"];
  44.  
  45.     $parsed = $gBitUser->parseData($_REQUEST["edit"], (!empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] :
  46.         ( isset($gBitUser->mInfo['format_guid']) ? $gBitUser->mInfo['format_guid'] : 'tikiwiki' ) ) );
  47.     $gBitUser->mInfo['parsed_data'] = $parsed;
  48.     /* SPELLCHECKING INITIAL ATTEMPT */
  49.     //This nice function does all the job!
  50.     $gBitSmarty->assign_by_ref( 'pageInfo', $gBitUser->mInfo );
  51.     $gBitUser->invokeServices( 'content_preview_function' );
  52. }
  53. else {
  54.     $gBitUser->invokeServices( 'content_edit_function' );
  55. }
  56.  
  57. $gBitSmarty->assign_by_ref( 'pageInfo', $gBitUser->mInfo );
  58. $gBitSmarty->assign_by_ref( 'gContent', $gBitUser );
  59.  
  60. $gBitSmarty->assign( 'show_page_bar', 'y' );
  61. $gBitSystem->setConfig( 'wiki_description', 'n' );
  62.  
  63. $gBitSystem->display( 'bitpackage:users/edit_personal_page.tpl', NULL, array( 'display_mode' => 'edit' ) );
  64. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:27 +0000 by phpDocumentor 1.5.0-lsces