aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Include/myFunctions.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-06-07 23:52:52 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-06-07 23:52:52 +0000
commitff947a3cc7fdd62393ecf7042e8208e5cb856571 (patch)
tree1e6e1373b82f541c97442653789197ac2716d80e /h-source/Application/Include/myFunctions.php
parent67e4728487c9c9ef4bab31b4cb5f98baeac502d3 (diff)
administrators can now hide/show device pages
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r--h-source/Application/Include/myFunctions.php22
1 files changed, 22 insertions, 0 deletions
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;
}