public static function getInstance() { if (empty(self::$instance)) { self::$instance = new Trash_Handler(); } return self::$instance; }
public function delete($identifier) { $database_notes = Database_Notes::getInstance(); $trash_handler = Trash_Handler::getInstance(); if (Filter_Client::enabled()) { // Client: record the action in the database. $database_noteactions = Database_NoteActions::getInstance(); $session_logic = Session_Logic::getInstance(); $database_noteactions->record($session_logic->currentUser(), $identifier, self::noteActionDelete, ""); } else { // Server: notification. $this->handlerDeleteNote($identifier); } $trash_handler->consultationNote($identifier); $database_notes->delete($identifier); }
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ require_once "../bootstrap/bootstrap.php"; page_access_level(Filter_Roles::CONSULTANT_LEVEL); $database_modifications = Database_Modifications::getInstance(); $database_notes = Database_Notes::getInstance(); $database_logs = Database_Logs::getInstance(); $session_logic = Session_Logic::getInstance(); $username = $session_logic->currentUser(); // Handle AJAX call to remove a change notification. @($remove = $_POST['remove']); if (isset($remove)) { $trash_handler = Trash_Handler::getInstance(); $trash_handler->changeNotification($remove); $database_modifications->deleteNotification($remove); die; } // Handle AJAX call to navigate to the passage belonging to the change notification. @($navigate = $_POST['navigate']); if (isset($navigate)) { $id = $navigate; $passage = $database_modifications->getNotificationPassage($id); if ($passage != NULL) { $ipc_focus = Ipc_Focus::getInstance(); $ipc_focus->set($passage['book'], $passage['chapter'], $passage['verse']); Navigation_Passage::recordHistory($passage['book'], $passage['chapter'], $passage['verse']); } // Set the correct default Bible for the user.