Файл: adultscript-2.0.3-pro/files/admin/templates/default/photo_album_view.tpl.php
Строк: 369
<?php defined('_VALID') or die('Restricted Access!'); ?>
<?php echo $this->fetch('errors'); ?>
<?php echo $this->fetch('messages'); ?>
<?php echo $this->fetch('warnings'); ?>
<script type="text/javascript">
var lang_question_asuspend = "Are you sure you want to suspend this photo album?";
var lang_question_aactivate = "Are you sure you want to activate this photo album?";
var lang_question_adelete = "Are you sure you want to delete this photo album?";
var lang_question_suspend = "Are you sure you want to suspend this photo?";
var lang_question_activate = "Are you sure you want to activate this photo?";
var lang_question_delete = "Are you sure you want to delete this photo?";
$(document).ready(function() {
$("input[id^='manage_album_']").click(function() {
var action = $(this).attr('id').match(/manage_album_(.*)/)[1];
if (action == 'suspend') {
var answer = confirm(lang_question_asuspend);
} else if (action == 'activate') {
var answer = confirm(lang_question_aactivate);
} else if (action == 'delete') {
var answer = confirm(lang_question_adelete);
}
if (answer) {
$("input[name='aaction']").val(action);
$("#album-view-form").submit();
}
});
$("a[id^='manage_photo_']").click(function(e) {
e.preventDefault();
var click_id = $(this).attr('id');
var click_arr = click_id.split('_');
var action = click_arr[2];
var photo_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='photo_id']").val(photo_id);
$("#manage_photo_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_album_view_menu'); ?>
<?php if ($this->album): ?>
<form id="album-view-form" method="post" action="">
<input name="aaction" type="hidden" value="" />
<input name="album_id" type="hidden" value="<?php echo $this->album_id; ?>" />
<div class="view_left">
<fieldset>
<legend>Album Information</legend>
<span class="info">ID</span>
<span class="data"><?php echo $this->album['album_id']; ?></span>
<span class="info clear">Username</span>
<span class="data"><a href="<?php echo ADMIN_URL,'/index.php?q=user/view&id=',$this->album['user_id']; ?>"><?php echo ($this->album['username']); ?></a></span>
<span class="info clear">Title</span>
<span class="data"><?php echo e($this->album['title']); ?></span>
<span class="info clear">Description</span>
<span class="data"><?php echo e($this->album['description']); ?></span>
<?php $categories = explode(',', $this->album['name']);
$ids = explode(',', $this->album['cats']);
$count = count($categories)-1; ?>
<span class="info clear">Categories</span>
<span class="data">
<?php foreach ($categories as $index => $name): ?>
<a href="<?php echo ADMIN_URL,'/index.php?q=photo/manage&c=',$ids[$index]; ?>"><?php echo e($name); ?></a><?php if ($index !== $count): echo ', '; endif; ?>
<?php endforeach; ?>
</span>
<span class="info clear">Tags</span>
<?php $tags = explode(',', $this->album['tags']);
$count = count($tags)-1; ?>
<span class="data">
<?php foreach ($tags as $index => $tag): ?>
<?php echo e($tag); if ($index !== $count): echo ', '; endif; ?>
<?php endforeach; ?>
</span>
<span class="info clear">Type</span>
<span class="data"><?php echo ucfirst($this->album['type']); ?></span>
</fieldset>
<fieldset>
<legend>Album Properties</legend>
<span class="info clear">Rating</span>
<span class="data"><?php echo $this->album['rating']; ?></span>
<span class="info clear">Rated By</span>
<span class="data"><?php echo $this->album['rated_by']; ?></span>
<span class="info clear">Total Photos</span>
<span class="data"><?php echo $this->album['total_photos']; ?></span>
<span class="info clear">Total Views</span>
<span class="data"><a href="<?php echo ADMIN_URL,'/index.php?q=photo/views&id=',$this->album['album_id']; ?>"><?php echo $this->album['total_views']; ?></a></span>
</fieldset>
<fieldset>
<legend>Date Information</legend>
<span class="info clear">Add Date</span>
<span class="data"><?php echo $this->album['add_date']; ?></span>
</fieldset>
</div>
<div class="view_right">
<fieldset>
<legend>Album Status</legend>
<span class="status"><?php echo $this->statuses[$this->album['status']]; ?></span>
<?php if ($this->album['locked'] == '1'): ?>
<span class="status">Locked</span>
<?php endif; ?>
</fieldset>
<fieldset>
<legend>Album Cover</legend>
<div style="width: 100%; text-align: center; padding: 10px 0;">
<img src="<?php echo RELATIVE_URL,'/media/photos/covers/',$this->album_id,'.jpg'; ?>" alt="" />
</div>
</fieldset>
<div style="width: 100%; text-align: center; padding: 10px 0;">
<input type="button" class="button butDef" value=" Edit " onClick="window.location='<?php echo ADMIN_URL,'/index.php?q=photo/edit&id=',$this->album['album_id']; ?>'" />
<?php if ($this->album['status'] == '0' OR $this->album['status'] == '2'): ?>
<input type="button" class="button butDef" value=" Publish " id="manage_album_activate" />
<?php endif; ?>
<?php if ($this->album['status'] == '1'): ?>
<input type="button" class="button butDef" value=" Suspend " id="manage_album_suspend" />
<?php endif; ?>
<input type="button" class="button butDef" value=" Delete" id="manage_album_delete" />
</div>
</div>
<div class="clear"></div>
</form>
<?php if ($this->photos): ?>
<form id="manage_photo_form" method="post" action="<?php echo CURRENT_URL; ?>">
<input name="action" type="hidden" value="" />
<input name="photo_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>
<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>Id</h3></th>
<th><h3>Photo</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->photos);
foreach ($this->photos as $photo):
if ($photo['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 $photo['photo_id']; ?>">
<td><input name="checkbox_photo_<?php echo $photo['photo_id']; ?>" type="checkbox" id="checkbox_item_<?php echo $photo['photo_id']; ?>" /></td>
<td><strong><?php echo $photo['photo_id']; ?></strong></td>
<td><img src="<?php echo RELATIVE_URL,'/media/photos/thumbs/',$photo['photo_id'],'.jpg'; ?>" alt="<?php echo e($photo['caption']); ?>" id="photo-view-<?php echo $photo['photo_id'],'-',$photo['ext']; ?>" /></td>
<td>
View: <strong><?php echo $photo['total_views']; ?></strong><br />
Comments: <strong><?php echo $photo['total_comments']; ?></strong><br />
Favorites: <strong><?php echo $photo['total_favorites']; ?></strong><br /><br />
Rating: <strong><?php echo $photo['rating']; ?></strong><br />
Rated By: <strong><?php echo $photo['rated_by']; ?></strong>
</td>
<td><?php echo $photo['add_date']; ?></td>
<td><a href="#status" id="manage_photo_<?php echo $status,'_',$photo['photo_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></td>
<td>
<a href="<?php echo ADMIN_URL; ?>/index.php?q=photo/photo&id=<?php echo $photo['photo_id']; ?>" title="View Photo"><img src="<?php echo TPL_REL; ?>/images/image.png" alt="View" /></a>
<a href="<?php echo ADMIN_URL; ?>/index.php?q=photo/photo_edit&id=<?php echo $photo['photo_id']; ?>" title="Edit Photo"><img src="<?php echo TPL_REL; ?>/images/image_edit.png" alt="Edit" /></a>
<a href="#delete_photo" id="manage_photo_delete_<?php echo $photo['photo_id']; ?>" title="Delete Photo" /><img src="<?php echo TPL_REL; ?>/images/image_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>
<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 photos found!</div>
<?php endif; else: ?>
<div class="none">Invalid album id! Are you sure this photo album exists!?</div>
<?php endif; ?>
</div>
</div>
</div>