diff --git a/mnemo/lib/Api.php b/mnemo/lib/Api.php index 47d32e851dd..02d7f2ce7c5 100644 --- a/mnemo/lib/Api.php +++ b/mnemo/lib/Api.php @@ -516,6 +516,23 @@ public function addNotpad($name, array $params = array()) return $notepad->getName(); } + /** + * Delete notepad. + * + * @param string $id The notepad id. + * @since 4.2.0 + */ + public function deleteNotepad($id) + { + // Delete the notepad. + $storage = $GLOBALS['injector'] + ->getInstance('Mnemo_Factory_Driver') + ->create($id); + $storage->deleteAll(); + $share = $GLOBALS['mnemo_shares']->getShare($id); + $GLOBALS['mnemo_shares']->removeShare($share); + } + /** * Update a notepad's title and/or description. *