Ejemplo n.º 1
0
    function listpending_reviews($reviews, $pathWay, $option)
    {
        global $mtconf;
        require_once $mtconf->getjconf('absolute_path') . '/administrator/components/com_mtree/spy.mtree.html.php';
        ?>
		<script language="javascript" type="text/javascript" src="<?php 
        echo $mtconf->getjconf('live_site') . $mtconf->get('relative_path_to_js_library');
        ?>
"></script>
		<script language="javascript" type="text/javascript">
		jQuery.noConflict();
		var predefined_reply=new Array();
		<?php 
        $num_of_predefined_reply = 0;
        for ($j = 1; $j <= 5; $j++) {
            if ($mtconf->get('predefined_reply_' . $j . '_title') != '' && $mtconf->get('predefined_reply_' . $j . '_message') != '') {
                echo 'predefined_reply[' . $j . ']="' . str_replace("'", "\\'", str_replace('"', '\\"', str_replace("\t", "\\t", str_replace("\r\n", "\\n", str_replace("\\", "\\\\", $mtconf->get('predefined_reply_' . $j . '_message')))))) . "\";\n";
                $num_of_predefined_reply++;
            }
        }
        ?>
		function selectreply(value,rev_id){
			jQuery('#emailmsg_'+rev_id).val( predefined_reply[value] );
		}
		function toggleemaileditor(rev_id){
			jQuery('#emaileditor_'+rev_id).slideToggle('fast');
		}
		</script>
		<form action="index2.php" method="post" name="adminForm">
		<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
		<?php 
        if (count($reviews) <= 0) {
            ?>
			<tr><th align="left">&nbsp;</th></tr>
			<tr class="row0"><td><?php 
            echo JText::_('No review found');
            ?>
</td></tr>
			<?php 
        } else {
            $k = 0;
            for ($i = 0, $n = count($reviews); $i < $n; $i++) {
                $row =& $reviews[$i];
                ?>
				<thead><tr><th style="text-align:left" align="left"<?php 
                echo $mtconf->get('use_internal_notes') ? ' colspan="2"' : '';
                ?>
><?php 
                echo mtfHTML::rating($row->value);
                ?>
&nbsp;<a href="index2.php?option=com_mtree&amp;task=editlink&amp;link_id=<?php 
                echo $row->link_id;
                ?>
"><?php 
                echo $row->link_name;
                ?>
</a> by <?php 
                if ($row->user_id > 0) {
                    echo '<a href="index2.php?option=com_mtree&task=spy&task2=viewuser&id=' . $row->user_id . '">' . $row->username . '</a>';
                } elseif (!empty($row->email)) {
                    echo '<a href="mailto:' . $row->email . '">' . $row->guest_name . '</a>';
                } else {
                    echo $row->guest_name;
                }
                ?>
, <?php 
                echo $row->rev_date;
                ?>
 - <a href="<?php 
                echo $mtconf->getjconf('live_site') . "/index.php?option=com_mtree&task=viewlink&link_id={$row->link_id}";
                ?>
" target="_blank"><?php 
                echo JText::_('View listing');
                ?>
</a></th></tr></thead>
				<tr align="left">
					<td<?php 
                echo $mtconf->get('use_internal_notes') ? ' width="65%"' : '';
                ?>
 valign="top" style="border-bottom:0px"><?php 
                echo JText::_('Review title');
                ?>
: <input class="text_area" type="text" name="rev_title[<?php 
                echo $row->rev_id;
                ?>
]" value="<?php 
                echo htmlspecialchars($row->rev_title);
                ?>
" size="60" /></td>
					<?php 
                if ($mtconf->get('use_internal_notes')) {
                    ?>
<td valign="middle" width="35%" style="border-bottom:0px"><?php 
                    echo JText::_('Internal notes');
                    ?>
:</td><?php 
                }
                ?>
				</tr>
				<tr align="left">
					<td<?php 
                echo $mtconf->get('use_internal_notes') ? ' width="65%"' : '';
                ?>
>
						<textarea class="text_area" style="width:100%;height:150px" name="rev_text[<?php 
                echo $row->rev_id;
                ?>
]"><?php 
                echo htmlspecialchars($row->rev_text);
                ?>
</textarea>
						<p />
						<label for="app_<?php 
                echo $row->rev_id;
                ?>
"><input type="radio" name="rev[<?php 
                echo $row->rev_id;
                ?>
]" value="1" id="app_<?php 
                echo $row->rev_id;
                ?>
" /><?php 
                echo JText::_('Approve');
                ?>
</label>
						<label for="ign_<?php 
                echo $row->rev_id;
                ?>
"><input type="radio" name="rev[<?php 
                echo $row->rev_id;
                ?>
]" value="0" id="ign_<?php 
                echo $row->rev_id;
                ?>
" checked="checked" /><?php 
                echo JText::_('Ignore');
                ?>
</label>
						<label for="rej_<?php 
                echo $row->rev_id;
                ?>
"><input type="radio" name="rev[<?php 
                echo $row->rev_id;
                ?>
]" value="-1" id="rej_<?php 
                echo $row->rev_id;
                ?>
" /><?php 
                echo JText::_('Reject');
                ?>
</label>
						<?php 
                if ($row->value > 0) {
                    ?>
						<label for="rejrv_<?php 
                    echo $row->rev_id;
                    ?>
"><input type="radio" name="rev[<?php 
                    echo $row->rev_id;
                    ?>
]" value="-2" id="rejrv_<?php 
                    echo $row->rev_id;
                    ?>
" /><?php 
                    echo JText::_('Reject and remove vote');
                    ?>
</label>
						<?php 
                }
                if (!empty($row->email)) {
                    ?>
						
						<span style="margin-top:2px;display:block;clear:left;"><input type="checkbox"<?php 
                    echo $row->send_email ? ' checked' : '';
                    ?>
 name="sendemail[<?php 
                    echo $row->rev_id;
                    ?>
]" value="1" id="sendemail_<?php 
                    echo $row->rev_id;
                    ?>
" onclick="toggleemaileditor(<?php 
                    echo $row->rev_id;
                    ?>
)" /> <label for="sendemail_<?php 
                    echo $row->rev_id;
                    ?>
"><?php 
                    echo JText::_('Send email to reviewer upon approval or rejection');
                    ?>
</label></span>
						<div id="emaileditor_<?php 
                    echo $row->rev_id;
                    ?>
"<?php 
                    echo !$row->send_email ? ' style="display:none"' : '';
                    ?>
>
							<select onchange="selectreply(this.value,<?php 
                    echo $row->rev_id;
                    ?>
)"<?php 
                    echo $num_of_predefined_reply == 0 ? ' disabled' : '';
                    ?>
>
								<option><?php 
                    echo JText::_('Select a pre defined reply');
                    ?>
</option>
								<?php 
                    for ($k = 1; $k <= 5; $k++) {
                        if ($mtconf->get('predefined_reply_' . $k . '_title') != '') {
                            echo '<option value="' . $k . '">' . $mtconf->get('predefined_reply_' . $k . '_title') . '</option>';
                        }
                    }
                    ?>
							</select>&nbsp;<?php 
                    echo JText::_('Or enter the email message');
                    ?>
							<p />
							<textarea name="emailmsg[<?php 
                    echo $row->rev_id;
                    ?>
]" id="emailmsg_<?php 
                    echo $row->rev_id;
                    ?>
" class="text_area" style="width:100%;height:110px"><?php 
                    echo $row->email_message;
                    ?>
</textarea>
						</div>
						<?php 
                }
                ?>
					</td>
					<td valign="top"><textarea class="text_area" style="width:100%;height:150px;" name="admin_note[<?php 
                echo $row->rev_id;
                ?>
]"><?php 
                echo htmlspecialchars($row->admin_note);
                ?>
</textarea></td>
				</tr>				
				<?php 
                $k = 1 - $k;
            }
        }
        ?>

		</table>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="listpending_reviews" />
		<input type="hidden" name="returntask" value="listpending_reviews" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
Ejemplo n.º 2
0
 function userActivity($log_type, $value, $link_id, $link_name)
 {
     global $mtconf;
     $ret = '';
     switch ($log_type) {
         case 'vote':
             if ($value > 0) {
                 $ret .= mtfHTML::rating($value);
             } else {
                 $ret .= mtfHTML::rating(0);
             }
             break;
         case 'votereview':
             if ($value == 1) {
                 $ret = '<img src="' . $mtconf->getjconf('live_site') . '/components/com_mtree/img/comment_add.png" width="16" height="16" hspace="0" />';
             } elseif ($value == -1) {
                 $ret = '<img src="' . $mtconf->getjconf('live_site') . '/components/com_mtree/img/comment_delete.png" width="16" height="16" hspace="0" />';
             }
             break;
         case 'review':
             return '<img src="' . $mtconf->getjconf('live_site') . '/components/com_mtree/img/comment.png" width="16" height="16" hspace="0" />';
             break;
         case 'replyreview':
             return '<img src="' . $mtconf->getjconf('live_site') . '/components/com_mtree/img/user_comment.png" width="16" height="16" hspace="0" />';
             break;
         case 'addfav':
             return '<img src="' . $mtconf->getjconf('live_site') . '/components/com_mtree/img/heart_add.png" width="16" height="16" hspace="0" />';
             break;
         case 'removefav':
             return '<img src="' . $mtconf->getjconf('live_site') . '/components/com_mtree/img/heart_delete.png" width="16" height="16" hspace="0" />';
             break;
         default:
             return '<a href="index2.php?option=com_mtree&task=spy&task2=viewlisting&id=' . $link_id . '">' . $log_type . '</a>';
             break;
     }
     return $ret;
 }