aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2010-12-05 00:27:57 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2010-12-05 00:27:57 +0000
commitb037354596f218a8bb42920437f8ea358fbabc8a (patch)
treec65071de22a7d155ccdca26d1dfdf190824cb9de
parentb64ea63443e33fc070298c0130461c834de342bc (diff)
moderators actions list visible - part 2
-rw-r--r--h-source/Application/Controllers/ModeratorsController.php2
-rw-r--r--h-source/Application/Include/myFunctions.php42
-rw-r--r--h-source/Application/Views/Issues/view.php1
-rw-r--r--h-source/Application/Views/Moderators/index.php2
-rw-r--r--h-source/Application/Views/talk.php1
-rwxr-xr-xh-source/Public/Css/website.css2
6 files changed, 45 insertions, 5 deletions
diff --git a/h-source/Application/Controllers/ModeratorsController.php b/h-source/Application/Controllers/ModeratorsController.php
index f7a5737..2f4123f 100644
--- a/h-source/Application/Controllers/ModeratorsController.php
+++ b/h-source/Application/Controllers/ModeratorsController.php
@@ -41,8 +41,6 @@ class ModeratorsController extends BaseController
{
$this->shift(1);
- Params::$nullQueryValue = 'undef';
-
$this->s['registered']->check('moderator');
$whereClauseArray = array(
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php
index cf1708f..e182690 100644
--- a/h-source/Application/Include/myFunctions.php
+++ b/h-source/Application/Include/myFunctions.php
@@ -307,7 +307,7 @@ function gtext($string)
{
return Lang::$i18n[Lang::$current][$string];
}
- return $string;
+ return $string;
}
//rewrite the vendor name
@@ -322,3 +322,43 @@ function betterVendor($string)
return (array_key_exists($string,$names)) ? $names[$string] : $string;
}
+
+//get the hardware info from the talk id
+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'];
+}
+
+//get the issue info from the message id
+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 the URL to the moderated object page
+function goToModeratedItem( $row = array() )
+{
+ $url = null;
+
+ switch ($row['type'])
+ {
+ case 'message':
+ $url = 'issues/view/'.Lang::$current.'/'.getIssueNumberFromMessageId($row['id']).'#message-'.$row['id'];
+ break;
+ case 'talk':
+ $hardInfo = getHardwareInfoFromTalkId($row['id']);
+ $controller = MyStrings::$reverse[$hardInfo['type']];
+ $url = $controller.'/talk/'.Lang::$current.'/'.$hardInfo['id_hard'].'#talk-'.$row['id'];
+ break;
+ case 'user':
+ $url = 'meet/user/'.Lang::$current.'/'.getUserName($row['id']);
+ break;
+ }
+ return 'http://'.DOMAIN_NAME.'/'.$url;
+}
diff --git a/h-source/Application/Views/Issues/view.php b/h-source/Application/Views/Issues/view.php
index 906cf0d..1575d23 100644
--- a/h-source/Application/Views/Issues/view.php
+++ b/h-source/Application/Views/Issues/view.php
@@ -133,6 +133,7 @@
<?php } else { ?>
<?php if ($ismoderator) { ?>
+ <a name="message-<?php echo $row['messages']['id_mes'];?>"></a>
<div class="issues_message_item_hidden">
<?php echo gtext("this message has been deleted");?>
diff --git a/h-source/Application/Views/Moderators/index.php b/h-source/Application/Views/Moderators/index.php
index 7594695..7bbe3f3 100644
--- a/h-source/Application/Views/Moderators/index.php
+++ b/h-source/Application/Views/Moderators/index.php
@@ -43,7 +43,7 @@
<?php foreach ($table as $row) { ?>
<tr class="listRow">
<td class="simpleText">
- <span class='textItem'><?php echo $row['history']['id_history'];?></span>
+ <span class='textItem'><a href="<?php echo goToModeratedItem($row['history']);?>"><?php echo $row['history']['id_history'];?></a></span>
</td>
<td class="simpleText">
<span class='textItem'><?php echo $u->getUser($row['history']['created_by']);?></span>
diff --git a/h-source/Application/Views/talk.php b/h-source/Application/Views/talk.php
index 1cb549e..c251080 100644
--- a/h-source/Application/Views/talk.php
+++ b/h-source/Application/Views/talk.php
@@ -71,6 +71,7 @@
<?php } else { ?>
<?php if ($ismoderator) { ?>
+ <a name="talk-<?php echo $message['talk']['id_talk'];?>"></a>
<div class="talk_message_item_hidden">
this message has been deleted
diff --git a/h-source/Public/Css/website.css b/h-source/Public/Css/website.css
index 1586249..baf0932 100755
--- a/h-source/Public/Css/website.css
+++ b/h-source/Public/Css/website.css
@@ -1485,7 +1485,7 @@ tr.listHead {
}
tr.listHead td {
- padding:8px;
+ padding:8px 4px;
background:#ADD8E6;
border-top:1px solid #4169E1;
border-bottom:1px solid #4169E1;