diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-02-25 00:25:29 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-02-25 00:25:29 +0000 |
commit | e9973f35a33f0ad72ff2fbd74250283d0e23e375 (patch) | |
tree | 8f3f4ef63ef92a1d8acf2f8499658623915f6486 /h-source/Application/Include/myFunctions.php | |
parent | d7cc67e72a3f53629104d811986acd688f104cda (diff) |
added list of actions carried out by administrators
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 9e05ed2..ddbc16f 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -484,7 +484,7 @@ function getHardwareInfoFromTalkId($id = 0) $clean['id'] = (int)$id; $talk = new TalkModel(); $res = $talk->select('hardware.type,hardware.id_hard')->from('hardware inner join talk')->using('id_hard')->where(array('id_talk'=>$clean['id']))->send(); - return $res[0]['hardware']; + return count($res) > 0 ? $res[0]['hardware'] : null; } //get the wiki page info from the talk id @@ -493,7 +493,7 @@ 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']; + return count($res) > 0 ? $res[0]['wiki']['id_wiki'] : ''; } //get the issue info from the message id @@ -502,7 +502,16 @@ function getIssueNumberFromMessageId($id = 0) $clean['id'] = (int)$id; $mess = new MessagesModel(); $res = $mess->select('issues.id_issue')->from('issues inner join messages')->using('id_issue')->where(array('id_mes'=>$clean['id']))->toList('issues.id_issue')->send(); - return $res[0]; + return count($res) > 0 ? $res[0] : ''; +} + +//get thw wiki name from the id +function getWikiNameFromId($id = 0) +{ + $clean['id'] = (int)$id; + $wiki = new WikiModel(); + $name = $wiki->getTheModelName($clean['id']); + return $name; } //return the URL to the moderated object page @@ -517,8 +526,15 @@ function goToModeratedItem( $row = array() ) break; case 'talk': $hardInfo = getHardwareInfoFromTalkId($row['id']); - $controller = Hardware::$typeToController[$hardInfo['type']]; - $url = $controller.'/talk/'.Lang::$current.'/'.$hardInfo['id_hard'].'#talk-'.$row['id']; + if (isset($hardInfo)) + { + $controller = Hardware::$typeToController[$hardInfo['type']]; + $url = $controller.'/talk/'.Lang::$current.'/'.$hardInfo['id_hard'].'#talk-'.$row['id']; + } + else + { + $url = 'last/modactions/'.Lang::$current; + } break; case 'user': $url = 'meet/user/'.Lang::$current.'/'.getUserName($row['id']); @@ -529,7 +545,12 @@ function goToModeratedItem( $row = array() ) case 'wiki_talk': $url = 'wiki/talk/'.Lang::$current.'/'.getWikiPageInfoFromTalkId($row['id']).'#wiki-talk-'.$row['id']; break; - + case 'page': + $url = 'wiki/page/'.Lang::$current.'/'.encodeUrl(getWikiNameFromId($row['id'])); + break; + case 'page_del': + $url = 'wiki/page/'.Lang::$current.'/'.encodeUrl(getWikiNameFromId($row['id'])); + break; } return 'http://'.DOMAIN_NAME.'/'.$url; } |