Файл: adultscript-2.0.3-pro/files/admin/templates/default/photo_comments.tpl.php
Строк: 233
<?php defined('_VALID') or die('Restricted Access!'); ?>
<script type="text/javascript" src="<?php echo TPL_REL; ?>/js/jquery.jeditable.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.editable').editable('<?php echo BASE_URL; ?>/ajax.php?s=comment_edit_photo&d=backend', {
loadurl : '<?php echo BASE_URL; ?>/ajax.php?s=comment_load_photo&d=backend',
type : 'textarea',
cancel : 'Cancel',
submit : 'Save',
indicator : '<img src="<?php echo TPL_REL;?>/images/indicator.gif">',
tooltip : 'Click to edit...',
style : 'width: 100%;'
});
$("a[id^='edit_comment_']").click(function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var split_arr = click_id.split('_');
$("#" + split_arr[2] + "_" + split_arr[3]).trigger('click');
});
});
</script>
<?php echo $this->fetch('errors'); ?>
<?php echo $this->fetch('messages'); ?>
<?php echo $this->fetch('warnings'); ?>
<script type="text/javascript">
var lang_question_suspend = "Are you sure you want to suspend this comment?";
var lang_question_activate = "Are you sure you want to activate this comment?";
var lang_question_delete = "Are you sure you want to delete this comment?";
$(document).ready(function() {
$("a[id^='manage_comment_']").click(function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('_');
var action = click_arr[2];
var comment_id = click_arr[3];
if (action == 'suspend') {
var answer = confirm(lang_question_suspend);
} else if (action == 'activate') {
var answer = confirm(lang_question_activate);
} else if (action == 'delete') {
var answer = confirm(lang_question_delete);
}
if (answer) {
$("input[name='action']").val(action);
$("input[name='comment_id']").val(comment_id);
$("#manage_comments_form").submit();
}
});
});
</script>
<div id="container" class="clearfix">
<div id="page">
<?php echo $this->fetch('photo_menu'); ?>
<div class="content clearfix">
<?php echo $this->fetch('photo_view_menu'); ?>
<?php if ($this->comments): ?>
<form name="manage_comments_form" id="manage_comments_form" method="post" action="<?php echo CURRENT_URL; ?>">
<input name="action" type="hidden" value="" />
<input name="comment_id" type="hidden" value="" />
</form>
<form name="actionsForm" id="actionsForm" method="post" action="<?php echo CURRENT_URL; ?>">
<div class="box_menu">
<div class="box_menu_left">
<select name="action" id="actions_top">
<option value="suspend">Suspend</option>
<option value="activate">Activate</option>
<option value="delete">Delete</option>
</select>
<input name="submit_actions" type="submit" class="button butDef" value="Go!" />
</div>
<div class="box_menu_right">
<div class="barNav clearfix"><?php echo p('pagination', $this->pagination, CURRENT_URL); ?></div>
</div>
<div class="clear"></div>
</div>
<table cellpadding="0" cellspacing="0" border="0" id="table" class="uiTable">
<thead>
<tr>
<th class="nosort" style="width: 12px; text-align: center;"><input name="checkbox_all" type="checkbox" id="check_all" /></th>
<th><h3>Username</h3></th>
<th><h3>Ip</h3></th>
<th><h3>Comment</h3></th>
<th><h3>Post Date</h3></th>
<th><h3>Status</h3></th>
<th><h3>Actions</h3></th>
</tr>
</thead>
<tbody>
<?php $count = count($this->comments);
foreach ($this->comments as $comment):
if ($comment['status'] == '1'):
$status_image = 'accept.png';
$status = 'suspend';
$alt = 'Active';
else:
$status_image = 'cancel.png';
$status = 'activate';
$alt = 'Suspended';
endif;
?>
<tr id="row_<?php echo $comment['comment_id']; ?>">
<td><input name="checkbox_comment_<?php echo $comment['comment_id']; ?>" type="checkbox" id="checkbox_item_<?php echo $comment['comment_id']; ?>" /></td>
<td><strong><?php if ($comment['username'] == ''): echo 'none'; else: echo '<a href="',ADMIN_URL,'/index.php?q=user/view&id=',$comment['user_id'],'">',e($comment['username']),'</a>'; endif; ?></strong></td>
<td><?php echo long2ip($comment['ip']); ?></td>
<td width="50%" style="padding: 2px;"><div id="<?php echo $this->photo_id,'_',$comment['comment_id']; ?>" class="editable"><?php echo nl2br($comment['comment']); ?></div></td>
<td><?php echo $comment['add_date']; ?></td>
<td>
<a href="#change_status" id="manage_comment_<?php echo $status; ?>_<?php echo $comment['comment_id']; ?>"><img src="<?php echo TPL_REL; ?>/images/<?php echo $status_image; ?>" alt="<?php echo $alt; ?>" /></a>
</td>
<td>
<a href="#edit_comment" id="edit_comment_<?php echo $this->photo_id,'_', $comment['comment_id']; ?>"><img src="<?php echo TPL_REL; ?>/images/comment_edit.png" alt="Edit" /></a>
<a href="#delete_comment" id="manage_comment_delete_<?php echo $comment['comment_id']; ?>" title="" /><img src="<?php echo TPL_REL; ?>/images/comment_delete.png" alt="Delete" /></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="box_menu">
<div class="box_menu_left">
<select name="action" id="actions_bottom">
<option value="suspend">Suspend</option>
<option value="activate">Activate</option>
<option value="delete">Delete</option>
</select>
<input name="submit_actions" type="submit" class="button butDef" value="Go!" />
</div>
<div class="box_menu_right">
<div class="barNav clearfix"><?php echo p('pagination', $this->pagination, CURRENT_URL); ?></div>
</div>
<div class="clear"></div>
</div>
</form>
<?php else: ?>
<div class="none">No comments yet!</div>
<?php endif; ?>
</div>
<div class="legend">
<img src="<?php echo TPL_REL; ?>/images/comment_edit.png" alt="film_edit" /> Edit Comment
<img src="<?php echo TPL_REL; ?>/images/comment_delete.png" alt="film_delete" /> Delete Comment
<img src="<?php echo TPL_REL; ?>/images/accept.png" alt="accept" /> Active - Action Suspend
<img src="<?php echo TPL_REL; ?>/images/cancel.png" alt="cancel" /> Suspended - Action Activate
</div>
</div>
</div>