diff options
| author | Antonio Gallo <tonicucoz@gmail.com> | 2010-12-05 00:27:57 +0000 | 
|---|---|---|
| committer | Antonio Gallo <tonicucoz@gmail.com> | 2010-12-05 00:27:57 +0000 | 
| commit | b037354596f218a8bb42920437f8ea358fbabc8a (patch) | |
| tree | c65071de22a7d155ccdca26d1dfdf190824cb9de /h-source/Application | |
| parent | b64ea63443e33fc070298c0130461c834de342bc (diff) | |
moderators actions list visible - part 2
Diffstat (limited to 'h-source/Application')
| -rw-r--r-- | h-source/Application/Controllers/ModeratorsController.php | 2 | ||||
| -rw-r--r-- | h-source/Application/Include/myFunctions.php | 42 | ||||
| -rw-r--r-- | h-source/Application/Views/Issues/view.php | 1 | ||||
| -rw-r--r-- | h-source/Application/Views/Moderators/index.php | 2 | ||||
| -rw-r--r-- | h-source/Application/Views/talk.php | 1 | 
5 files changed, 44 insertions, 4 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  | 
