From b03422fc18f60240b8028306111db88439f1d2a4 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Sun, 23 Nov 2008 11:23:20 +0100 Subject: [PATCH] Fixed function name and add the timeline cleaning for wikirev/page deletion. --- src/IDF/Timeline.php | 2 +- src/IDF/WikiPage.php | 8 ++++++++ src/IDF/WikiRevision.php | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/IDF/Timeline.php b/src/IDF/Timeline.php index 68900ea..2d28ba6 100644 --- a/src/IDF/Timeline.php +++ b/src/IDF/Timeline.php @@ -144,7 +144,7 @@ class IDF_Timeline extends Pluf_Model * @param mixed Item to be removed * @return bool Success */ - public static function insert($item) + public static function remove($item) { if ($item->id > 0) { $sql = new Pluf_SQL('model_id=%s AND model_class=%s', diff --git a/src/IDF/WikiPage.php b/src/IDF/WikiPage.php index 3cc7c34..16d0cd6 100644 --- a/src/IDF/WikiPage.php +++ b/src/IDF/WikiPage.php @@ -135,6 +135,14 @@ class IDF_WikiPage extends Pluf_Model return Pluf_Text::cleanString(html_entity_decode($str, ENT_QUOTES, 'UTF-8')); } + /** + * We drop the information from the timeline. + */ + function preDelete() + { + IDF_Timeline::remove($this); + } + function get_current_revision() { $db = $this->getDbConnection(); diff --git a/src/IDF/WikiRevision.php b/src/IDF/WikiRevision.php index 48e0794..c5fd497 100644 --- a/src/IDF/WikiRevision.php +++ b/src/IDF/WikiRevision.php @@ -111,6 +111,14 @@ class IDF_WikiRevision extends Pluf_Model return $this->content; } + /** + * We drop the information from the timeline. + */ + function preDelete() + { + IDF_Timeline::remove($this); + } + function preSave($create=false) { if ($this->id == '') {