Файл: adultscript-2.0.3-pro/files/admin/templates/default/photo_manage.tpl.php
Строк: 419
<?php defined('_VALID') or die('Restricted Access!'); ?>
<?php echo $this->fetch('errors'); ?>
<?php echo $this->fetch('messages'); ?>
<?php echo $this->fetch('warnings'); ?>
<link href="<?php echo TPL_REL; ?>/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
<script src="<?php echo TPL_REL; ?>/js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript">
var lang_question_suspend = "Are you sure you want to suspend this photo album?";
var lang_question_activate = "Are you sure you want to activate this photo album?";
var lang_question_delete = "Are you sure you want to delete this photo album?";
var lang_question_unassign = "Are you sure you want to remove the assigned banner from this photo album?";
$(document).ready(function() {
$("a[id^='manage_album_']").click(function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('_');
var action = click_arr[2];
var album_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);
} else if (action == 'unassign') {
var answer = confirm(lang_question_unassign);
}
if (answer) {
$("input[name='action']").val(action);
$("input[name='album_id']").val(album_id);
$("#manage_album_form").submit();
}
});
$("a[id^='remove_']").click(function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('_');
var video_id = click_arr[1];
$("input[name='id']").val(video_id);
$("#remove_ad_form").submit();
});
$("a[id^='adv_add_']").click(function(e) {
e.preventDefault();
$("input[name='id']").val($(this).attr('id').match(/adv_add_(.*)/)[1]);
$("a[id^='assign_adv_']").css("background-image", "url('<?php echo TPL_URL; ?>/images/coins.png')");
$("#dialog").dialog({
width: 600,
height: 360
});
});
$("a[id^='assign_adv_']").live('click', function(e) {
e.preventDefault();
var video_id = $("input[name='id']").val();
var adv_id = $(this).attr('id').match(/assign_adv_(.*)/)[1];
$(this).css("background-image", "url('<?php echo TPL_URL; ?>/images/ajax-loader.gif')");
$.ajax({
url: base_url + '/ajax.php?s=assign_video_adv&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: { video_id: video_id, adv_id: adv_id },
success: function(response) {
if (response.status == '1') {
$("a[id='assign_adv_" + adv_id + "']").css("background-image", "url('<?php echo TPL_URL; ?>/images/coins_add.png')");
$("span[id='adv_" + video_id + "']").html('<a href="#unassign_adv" id="manage_video_adv_' + video_id + '" title="Unassign video advertising from this video!"><img src="<?php echo TPL_URL; ?>/images/coins_delete.png" alt="" /></a>');
} else {
$("a[id='assign_adv_" + adv_id + "']").css("background-image", "url('<?php echo TPL_URL; ?>/images/coins.png')");
}
$("#dialog").dialog({ buttons: { "Done": function() { $(this).dialog("close"); }}});
}
});
});
$("#dialog-pornstar").dialog({
autoOpen: false,
width: 600,
height: 390
});
$("a[id^='manage_pornstar_']").live('click', function(e) {
e.preventDefault();
var album_id = $(this).attr('id').match(/manage_pornstar_(.*)/)[1];
$.ajax({
url: base_url + '/ajax.php?s=manage_photo_pornstar&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: {album_id: album_id},
success: function(response) {
$("#dialog-pornstar").html(response.code);
$("#dialog-pornstar").dialog('open');
}
});
});
$("a[id^='pornstar-pagination-']").live('click', function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('-');
var album_id = click_arr[2];
var letter = click_arr[3];
$.ajax({
url: base_url + '/ajax.php?s=manage_photo_pornstar&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: {album_id: album_id, page: letter},
success: function(response) {
$("#dialog-pornstar").dialog('close');
$("#dialog-pornstar").html(response.code);
$("#dialog-pornstar").dialog('open');
}
});
});
$("a[id^='assign-pornstar-']").live('click', function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('-');
var model_id = click_arr[2];
var album_id = click_arr[3];
$.ajax({
url: base_url + '/ajax.php?s=assign_photo_pornstar&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: {model_id: model_id, album_id: album_id},
success: function(response) {
$("#dialog-pornstar").dialog('close');
$.ajax({
url: base_url + '/ajax.php?s=manage_photo_pornstar&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: {album_id: album_id},
success: function(response) {
$("#dialog-pornstar").html(response.code);
$("#dialog-pornstar").dialog('open');
}
});
}
});
});
$("a[id^='remove-pornstar-']").live('click', function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('-');
var model_id = click_arr[2];
var album_id = click_arr[3];
$.ajax({
url: base_url + '/ajax.php?s=unassign_photo_pornstar&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: {model_id: model_id, album_id: album_id},
success: function(response) {
$("#dialog-pornstar").dialog('close');
$.ajax({
url: base_url + '/ajax.php?s=manage_photo_pornstar&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: {album_id: album_id},
success: function(response) {
$("#dialog-pornstar").html(response.code);
$("#dialog-pornstar").dialog('open');
}
});
}
});
});
});
</script>
<div id="container" class="clearfix">
<div id="page">
<?php echo $this->fetch('photo_menu'); ?>
<div class="content clearfix">
<?php echo $this->fetch('photo_manage_menu'); ?>
<?php echo $this->fetch('photo_search'); ?>
<?php if ($this->albums): ?>
<form id="manage_album_form" method="post" action="<?php echo CURRENT_URL; ?>">
<input name="action" type="hidden" value="" />
<input name="album_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>
<option value="unassign">Remove Advertising</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>
<div id="dialog" title="Assign Photo Album Advertising Banner" style="display: none;">
<input name="id" type="hidden" value="" />
<?php if ($this->advs): ?>
<ul>
<?php foreach ($this->advs as $adv): ?>
<li><a href="#" id="assign_adv_<?php echo $adv['adv_id']; ?>"><?php echo e($adv['adv_name']); ?></a></li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<div class="none">No advertising banners found for the Photo Album group! Click <a href="<?php echo ADMIN_URL; ?>/index.php?q=adv/add">here</a> to add banners!</div>
<?php endif; ?>
</div>
<div id="dialog-pornstar" title="Manage Album Pornstars" style="display: none;"></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>Title</h3></th>
<th><h3>Categories</h3></th>
<th><h3>Username</h3></th>
<th><h3>Properties</h3></th>
<?php if ($this->option['flagged'] == '1'): ?>
<th><h3>Report</h3></th>
<?php endif; ?>
<th><h3>Add Date</h3></th>
<th><h3>Status</h3></th>
<th><h3>Actions</h3></th>
</tr>
</thead>
<tbody>
<?php $count = count($this->albums);
foreach ($this->albums as $album):
if ($album['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 $album['album_id']; ?>">
<td><input name="checkbox_album_<?php echo $album['album_id']; ?>" type="checkbox" id="checkbox_item_<?php echo $album['album_id']; ?>" /></td>
<td>
<a href="<?php echo ADMIN_URL,'/index.php?q=photo/view&id=',$album['album_id']; ?>">
<strong><?php echo e($album['title']); ?></strong><br /><br />
<img src="<?php echo MEDIA_URL,'/photos/covers/',$album['album_id']; ?>.jpg" alt="<?php echo e($album['title']); ?>" />
</a>
</td>
<td>
<?php $categories = explode(',', $album['category']);
$names = explode(',', $album['name']);
foreach ($categories as $key => $value) {
echo '<strong><a href="'.ADMIN_URL.'/index.php?q=photo/manage&c='.$value.'">'.e($names[$key]).'</a></strong><br />';
}
?>
</td>
<td><strong><a href="<?php echo ADMIN_URL; ?>/index.php?q=user/view&id=<?php echo $album['username']; ?>"><?php echo e($album['username']); ?></strong></td>
<td>
Photos: <strong><?php echo $album['total_photos']; ?></strong><br />
Views: <strong><?php echo $album['total_views']; ?></strong><br />
Rating: <strong><?php echo $album['rating']; ?></strong><br />
Votes: <strong><?php echo $album['rated_by']; ?></strong><br /><br />
Flagged: <strong><?php if ($album['flagged'] == '1'): echo 'yes'; else: echo 'no'; endif; ?></strong>
</td>
<?php if ($this->option['flagged'] == '1'): ?>
<td></td>
<?php endif; ?>
<td><?php echo $album['add_date']; ?></td>
<td><?php if ($album['status'] == '3'): echo '<strong>Processing</strong>'; else: ?><a href="#status" id="manage_album_<?php echo $status,'_',$album['album_id']; ?>" title="Click to <?php echo $status; ?> this photo album!"><img src="<?php echo TPL_REL; ?>/images/<?php echo $status_image; ?>" alt="<?php echo $alt; ?>" /></a><?php endif; ?></td>
<td>
<a href="<?php echo ADMIN_URL; ?>/index.php?q=photo/view&id=<?php echo $album['album_id']; ?>" title="View Photo Album"><img src="<?php echo TPL_REL; ?>/images/image.png" alt="View" /></a>
<a href="<?php echo ADMIN_URL; ?>/index.php?q=photo/edit&id=<?php echo $album['album_id']; ?>" title="Edit Photo Album"><img src="<?php echo TPL_REL; ?>/images/image_edit.png" alt="Edit" /></a>
<a href="<?php echo ADMIN_URL; ?>/index.php?q=photo/add&id=<?php echo $album['album_id']; ?>" title="Add Photos To This Album"><img src="<?php echo TPL_REL; ?>/images/image_add.png" alt="Add" /></a>
<a href="#delete_album" id="manage_album_delete_<?php echo $album['album_id']; ?>" title="Delete Photo Album" /><img src="<?php echo TPL_REL; ?>/images/image_delete.png" alt="Delete" /></a>
<?php if (VModule::enabled('pornstar')): ?>
<a href="#manage_pornstars" id="manage_pornstar_<?php echo $album['album_id']; ?>" title="Manage pornstars for this photo album!"><img src="<?php echo TPL_REL; ?>/images/user.png" alt="" /></a>
<?php endif; ?>
</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>
<option value="unassign">Remove Advertising</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>
<?php else: ?>
<div class="none">No photo albums found!</div>
<?php endif; ?>
</div>
<div class="legend">
<img src="<?php echo TPL_REL; ?>/images/image.png" alt="film_view" /> View Album
<img src="<?php echo TPL_REL; ?>/images/image_edit.png" alt="film_edit" /> Edit Album
<img src="<?php echo TPL_REL; ?>/images/image_delete.png" alt="film_delete" /> Delete Album
<img src="<?php echo TPL_REL; ?>/images/coins_add.png" alt="coins_add" /> Assign Adv
<img src="<?php echo TPL_REL; ?>/images/coins_delete.png" alt="coins_delete" /> Remove Adv
<?php if (VModule::enabled('pornstar')): ?>
<img src="<?php echo TPL_REL; ?>/images/user.png" alt="" /> Manage Models
<?php endif; ?>
<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>