From ff947a3cc7fdd62393ecf7042e8208e5cb856571 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 7 Jun 2011 23:52:52 +0000 Subject: administrators can now hide/show device pages --- h-source/Application/Include/languages.php | 3 +++ h-source/Application/Include/myFunctions.php | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'h-source/Application/Include') diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index b66e5e8..45e6a74 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -228,6 +228,9 @@ class Lang /*0190*/"possible other names of the device" => "eventuali altri nomi del dispositivo", /*0191*/"Description entry preview" => "Anteprima del campo descrizione", /*0192*/"Page preview" => "Anteprima della pagina", + /*0193*/"This device page has been hidden" => "La pagina di questo dispositivo รจ stata nascosta", + /*0194*/"restore the device page" => "ripristina la pagina", + /*0195*/"hide the device page" => "nascondi la pagina", ), 'es' => array ( diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 4bff411..174c7ea 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -4622,6 +4622,24 @@ function getHardwareInfoFromTalkId($id = 0) return count($res) > 0 ? $res[0]['hardware'] : null; } +//get hardware info from id +function getHardwareInfoFromId($id = 0) +{ + $clean['id'] = (int)$id; + $hw = new HardwareModel(); + $res = $hw->select()->where(array('id_hard'=>$clean['id']))->send(); + $controller = 'home/index/en'; + $model = ''; + if (count($res) > 0) + { + $controller = Hardware::getControllerFromType($res[0]['hardware']['type']); + $controller = strcmp($controller,'') !== 0 ? $controller : 'home/index/en'; + $model = $res[0]['hardware']['model']; + } + + return array('controller'=>$controller,'model'=>$model); +} + //get the wiki page info from the talk id function getWikiPageInfoFromTalkId($id = 0) { @@ -4686,6 +4704,10 @@ function goToModeratedItem( $row = array() ) case 'page_del': $url = 'wiki/page/'.Lang::$current.'/'.encodeUrl(getWikiNameFromId($row['id'])); break; + case 'device': + $hardInfo = getHardwareInfoFromId($row['id']); + $url = $hardInfo['controller'].'/view/'.Lang::$current.'/'.$row['id'].'/'.encodeUrl($hardInfo['model']); + break; } return 'http://'.DOMAIN_NAME.'/'.$url; } -- cgit v1.2.3