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

Source for file list_events.php

Documentation is available at list_events.php

  1. <?php
  2. /**
  3.  * Script to produce a list of events
  4.  *
  5.  * URL parameters
  6.  * $_REQUEST["submit_mult"]
  7.  * $_REQUEST["checked"]
  8.  * $_REQUEST['event_after']
  9.  *
  10.  * @copyright (c) 2004 bitweaver Events
  11.  * @package events
  12.  * @subpackage functions
  13.  */
  14.  
  15. /**
  16.  * required setup
  17.  */
  18. require_once('../kernel/setup_inc.php' );
  19. require_once(EVENTS_PKG_PATH.'BitEvents.php' );
  20.  
  21. // Is package installed and enabled
  22. $gBitSystem->verifyPackage('events' );
  23.  
  24. // Now check permissions to access this page
  25. $gBitSystem->verifyPermission('p_events_view' );
  26.  
  27. /* mass-remove:
  28. the checkboxes are sent as the array $_REQUEST["checked[]"], values are the wiki-PageNames,
  29. e.g. $_REQUEST["checked"][3]="HomePage"
  30. $_REQUEST["submit_mult"] holds the value of the "with selected do..."-option list
  31. we look if any page's checkbox is on and if remove_events is selected.
  32. then we check permission to delete events.
  33. if so, we call histlib's method remove_all_versions for all the checked events.
  34. */
  35. if (isset($_REQUEST["submit_mult"]&& isset($_REQUEST["checked"]&& $_REQUEST["submit_mult"== "remove_events"{
  36.  
  37.     // Now check permissions to remove the selected events
  38.     $gBitSystem->verifyPermission'p_events_remove' );
  39.  
  40.     if!empty$_REQUEST['cancel') ) {
  41.         // user cancelled - just continue on, doing nothing
  42.     elseifempty$_REQUEST['confirm') ) {
  43.         $formHash['delete'TRUE;
  44.         $formHash['submit_mult''remove_events';
  45.         foreach$_REQUEST["checked"as $del {
  46.             $formHash['input']['<input type="hidden" name="checked[]" value="'.$del.'"/>';
  47.         }
  48.         $gBitSystem->confirmDialog$formHash
  49.             array
  50.                 'warning' => tra('Are you sure you want to delete these events?'' (' tra('Count: 'count$_REQUEST["checked"')',                
  51.                 'error' => tra('This cannot be undone!'),
  52.             )
  53.         );
  54.     else {
  55.         foreach ($_REQUEST["checked"as $deleteId{
  56.             $tmpPage new BitEvents$deleteId );
  57.             if!$tmpPage->load(|| !$tmpPage->expunge() ) {
  58.                 array_merge$errorsarray_values$tmpPage->mErrors ) );
  59.             }
  60.         }
  61.         if!empty$errors ) ) {
  62.             $gBitSmarty->assign_by_ref'errors'$errors );
  63.         }
  64.     }
  65. }
  66.  
  67. $events new BitEvents();
  68. ifempty$_REQUEST['event_after') ) {
  69.     $_REQUEST['event_after'$gBitSystem->getUTCTime();
  70. }
  71. $listevents $events->getList$_REQUEST );
  72.  
  73. $gBitSmarty->assign_by_ref('listInfo'$_REQUEST['listInfo']);
  74. $gBitSmarty->assign_by_ref('list'$listevents);
  75.  
  76. // Display the template
  77. $gBitSystem->display('bitpackage:events/list_events.tpl'tra('Events'array'display_mode' => 'list' ));
  78.  
  79. ?>

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