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

Source for file mod_last_changes.php

Documentation is available at mod_last_changes.php

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

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