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

Source for file mod_user_pages.php

Documentation is available at mod_user_pages.php

  1. <?php
  2. // $Header$
  3. /**
  4.  * Params:
  5.  * - content_type_guid : if set, show only those content_type_guid's
  6.  * - show_date : if set, show date of last modification
  7.  * @package liberty
  8.  * @subpackage modules
  9.  */
  10.  
  11.  
  12. global $gQueryUser, $gBitUser, $module_rows, $module_params, $gLibertySystem, $module_title;
  13.  
  14.  
  15. $userId = $gBitUser->mUserId;
  16. if( !empty( $gQueryUser->mUserId ) ) {
  17.     $userId = $gQueryUser->mUserId;
  18. }
  19.  
  20. if( empty( $module_title ) ) {
  21.     if( !empty( $module_params['content_type_guid'] ) && !empty( $gLibertySystem->mContentTypes[$module_params['content_type_guid']] ) ) {
  22.         $title = tra( "Last Changes" ).': '.$gLibertySystem->getContentTypeName( $module_params['content_type_guid'], TRUE );
  23.         $_template->tpl_vars['contentType'] = new Smarty_variable( $module_params['content_type_guid'] );
  24.     } else {
  25.         $_template->tpl_vars['contentType'] = new Smarty_variable( FALSE );
  26.         $title = tra( "Last Changes" );
  27.     }
  28.     $_template->tpl_vars['moduleTitle'] = new Smarty_variable( $title );
  29. }
  30.  
  31. if( !empty( $module_params['show_date'] ) ) {
  32.     $_template->tpl_vars['userShowDate'] = new Smarty_variable(  TRUE  );
  33. }
  34.  
  35. $listHash = array(
  36.     'content_type_guid' => !empty( $module_params['content_type_guid'] ) ? $module_params['content_type_guid'] : NULL,
  37.     'offset' => 0,
  38.     'max_records' => $module_rows,
  39.     'sort_mode' => 'last_modified_desc',
  40.     'user_id' => $userId,
  41. );
  42. $modLastPages = $gBitUser->getContentList( $listHash );
  43. $_template->tpl_vars['modLastPages'] = new Smarty_variable( $modLastPages );
  44. ?>

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