@@ 878-903 (lines=26) @@ | ||
875 | ||
876 | ||
877 | ||
878 | protected function _trash_or_restore_venue( $venue_status = 'trash', $redirect_after = TRUE ) { |
|
879 | $VNU_ID = isset( $this->_req_data['VNU_ID'] ) ? absint( $this->_req_data['VNU_ID'] ) : FALSE; |
|
880 | ||
881 | //loop thru venues |
|
882 | if ( $VNU_ID ) { |
|
883 | //clean status |
|
884 | $venue_status = sanitize_key( $venue_status ); |
|
885 | // grab status |
|
886 | if (!empty($venue_status)) { |
|
887 | $success = $this->_change_venue_status($VNU_ID, $venue_status); |
|
888 | } else { |
|
889 | $success = FALSE; |
|
890 | $msg = __('An error occurred. The venue could not be moved to the trash because a valid venue status was not not supplied.', 'event_espresso'); |
|
891 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
892 | } |
|
893 | } else { |
|
894 | $success = FALSE; |
|
895 | $msg = __('An error occurred. The venue could not be moved to the trash because a valid venue ID was not not supplied.', 'event_espresso'); |
|
896 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
897 | } |
|
898 | $action = $venue_status == 'trash' ? 'moved to the trash' : 'restored from the trash'; |
|
899 | ||
900 | if ( $redirect_after ) |
|
901 | $this->_redirect_after_action($success, 'Venue', $action, array('action' => 'default')); |
|
902 | ||
903 | } |
|
904 | ||
905 | ||
906 |
@@ 1691-1715 (lines=25) @@ | ||
1688 | * @param string $event_status |
|
1689 | * @return void |
|
1690 | */ |
|
1691 | protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = TRUE ) { |
|
1692 | //determine the event id and set to array. |
|
1693 | $EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : FALSE; |
|
1694 | // loop thru events |
|
1695 | if ($EVT_ID) { |
|
1696 | // clean status |
|
1697 | $event_status = sanitize_key($event_status); |
|
1698 | // grab status |
|
1699 | if (!empty($event_status)) { |
|
1700 | $success = $this->_change_event_status($EVT_ID, $event_status); |
|
1701 | } else { |
|
1702 | $success = FALSE; |
|
1703 | $msg = __('An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.', 'event_espresso'); |
|
1704 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
1705 | } |
|
1706 | } else { |
|
1707 | $success = FALSE; |
|
1708 | $msg = __('An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.', 'event_espresso'); |
|
1709 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
1710 | } |
|
1711 | $action = $event_status == 'trash' ? 'moved to the trash' : 'restored from the trash'; |
|
1712 | ||
1713 | if ( $redirect_after ) |
|
1714 | $this->_redirect_after_action($success, 'Event', $action, array('action' => 'default')); |
|
1715 | } |
|
1716 | ||
1717 | /** |
|
1718 | * _trash_or_restore_events |