From 878f70432bdfdd12a5c9788cec3d04ed862eafa6 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 10 Jul 2011 21:01:21 +0000 Subject: a message is now shown in talk pages when the page is deleted --- .../Application/Controllers/GenericController.php | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'h-source/Application/Controllers') diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index c80f6d0..1539f9f 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -55,7 +55,9 @@ class GenericController extends BaseController } $this->orderPopup = $popup; - + + $data['isApproved'] = true; + $this->append($data); } protected function insert($lang = 'en', $token = '') @@ -457,6 +459,17 @@ class GenericController extends BaseController $this->loadViewAll('catalogue'); } + protected function passWhoAskedForDeletion($id_hard) + { + $clean['id_hard'] = (int)$id_hard; + + $deletion = new DeletionModel(); + $data['deletion'] = $deletion->select()->where(array('id_hard'=>$clean['id_hard']))->send(); + $data['deletionUsers'] = $deletion->getList($data['deletion'],'created_by'); + + $this->append($data); + } + protected function view($lang = 'en', $id_hard = 0, $name = null) { $this->shift(3); @@ -491,12 +504,7 @@ class GenericController extends BaseController $data['isDeleted'] = $this->m['HardwareModel']->isDeleted($clean['id_hard']); $data['isApproved'] = strcmp($data['table'][0]['hardware']['approved'],'yes') === 0 ? true : false; - if ($data['isDeleted']) - { - $deletion = new DeletionModel(); - $data['deletion'] = $deletion->select()->where(array('id_hard'=>$clean['id_hard']))->send(); - $data['deletionUsers'] = $deletion->getList($data['deletion'],'created_by'); - } + $this->passWhoAskedForDeletion($clean['id_hard']); } $this->append($data); @@ -559,8 +567,10 @@ class GenericController extends BaseController $data['rev1'] = $res1; $data['rev2'] = $res2; + $this->passWhoAskedForDeletion($clean['id']); + $this->append($data); - $this->loadViewAll('history'); + $this->loadViewAll('history,if_page_deleted'); } protected function revision($lang = 'en', $id_rev = 0) @@ -712,7 +722,7 @@ class GenericController extends BaseController $data['notice'] = $this->m['HardwareModel']->notice; } - + $this->append($data); $this->loadViewAll('climb'); } @@ -765,9 +775,11 @@ class GenericController extends BaseController // javascript for moderator $data['md_javascript'] = "moderator_dialog(\"hide\",\"talk\");moderator_dialog(\"show\",\"talk\");"; $data['go_to'] = $this->currPage."/".$this->lang."/".$clean['id_hard']; + + $this->passWhoAskedForDeletion($clean['id_hard']); $this->append($data); - $this->loadViewAll('talk,moderator_dialog'); + $this->loadViewAll('talk,if_page_deleted,moderator_dialog'); } protected function getViewLink($id,$ne_name) -- cgit v1.2.3