From 8c287999487883a54271ae5e91bbb79b4fd15826 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 15 Feb 2011 01:11:53 +0000 Subject: added wiki - part 2 --- h-source/Application/Include/myFunctions.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'h-source/Application/Include') diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 0f87893..d494eb6 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -444,6 +444,15 @@ function getHardwareInfoFromTalkId($id = 0) return $res[0]['hardware']; } +//get the wiki page info from the talk id +function getWikiPageInfoFromTalkId($id = 0) +{ + $clean['id'] = (int)$id; + $talk = new WikitalkModel(); + $res = $talk->select('wiki.id_wiki')->from('wiki inner join wiki_talk')->using('id_wiki')->where(array('id_talk'=>$clean['id']))->send(); + return $res[0]['wiki']['id_wiki']; +} + //get the issue info from the message id function getIssueNumberFromMessageId($id = 0) { @@ -465,7 +474,7 @@ function goToModeratedItem( $row = array() ) break; case 'talk': $hardInfo = getHardwareInfoFromTalkId($row['id']); - $controller = MyStrings::$reverse[$hardInfo['type']]; + $controller = Hardware::$typeToController[$hardInfo['type']]; $url = $controller.'/talk/'.Lang::$current.'/'.$hardInfo['id_hard'].'#talk-'.$row['id']; break; case 'user': @@ -474,6 +483,10 @@ function goToModeratedItem( $row = array() ) case 'issue': $url = 'issues/view/'.Lang::$current.'/'.$row['id']; break; + case 'wiki_talk': + $url = 'wiki/talk/'.Lang::$current.'/'.getWikiPageInfoFromTalkId($row['id']).'#wiki-talk-'.$row['id']; + break; + } return 'http://'.DOMAIN_NAME.'/'.$url; } -- cgit v1.2.3