__ ( 'Past events', 'dbem' ), 'all' => __ ( 'All events', 'dbem' ), 'future' => __ ( 'Future events', 'dbem' ) ); $action_scope = ( !empty($_REQUEST['em_obj']) && $_REQUEST['em_obj'] == 'em_bookings_events_table' ); $action = ( $action_scope && !empty($_GET ['action']) ) ? $_GET ['action']:''; $order = ( $action_scope && !empty($_GET ['order']) ) ? $_GET ['order']:'ASC'; $limit = ( $action_scope && !empty($_GET['limit']) ) ? $_GET['limit'] : 20;//Default limit $page = ( $action_scope && !empty($_GET['pno']) ) ? $_GET['pno']:1; $offset = ( $action_scope && $page > 1 ) ? ($page-1)*$limit : 0; $scope = ( $action_scope && !empty($_GET ['scope']) && array_key_exists($_GET ['scope'], $scope_names) ) ? $_GET ['scope']:'future'; // No action, only showing the events list switch ($scope) { case "past" : $title = __ ( 'Past Events', 'dbem' ); break; case "all" : $title = __ ( 'All Events', 'dbem' ); break; default : $title = __ ( 'Future Events', 'dbem' ); $scope = "future"; } $owner = !current_user_can('edit_others_events') ? get_current_user_id() : false; $events = EM_Events::get( array('scope'=>$scope, 'limit'=>0, 'order'=>$order, 'bookings'=>true, 'owner' => $owner ) ); $events_count = count ( $events ); $use_events_end = get_option ( 'dbem_use_event_end' ); ?>