Файл: adultscript-2.0.3-pro/files/admin/templates/default/photo_upload.tpl.php
Строк: 134
<?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 image = 2;
$(document).ready(function() {
$("a[id='add-more']").click(function(e) {
e.preventDefault();
var iCODE = '<div class="image-container-' + image + '">';
var iCODE = iCODE + '<fieldset id="image-container' + image + '">';
var iCODE = iCODE + '<legend>Image ' + image + '</legend>';
var iCODE = iCODE + '<div class="required">';
var iCODE = iCODE + '<label for="image_' + image + '">File</label>';
var iCODE = iCODE + '<input name="image_' + image + '" type="file" id="image_' + image + '" />';
var iCODE = iCODE + '</div>';
var iCODE = iCODE + '<div class="optional">';
var iCODE = iCODE + '<label for="caption_' + image + '">Caption (optional)</label>';
var iCODE = iCODE + '<input name="caption_' + image + '" type="text" id="caption_' + image + '" class="extra" value="" />';
var iCODE = iCODE + '</div>';
var iCODE = iCODE + '<div class="optional">';
var iCODE = iCODE + '<label for="description_' + image + '">Description (optional)</label>';
var iCODE = iCODE + '<input name="description_' + image + '" type="text" id="description_' + image + '" class="extra" value="" />';
var iCODE = iCODE + '</div>';
var iCODE = iCODE + '<a href="#remove" id="remove-' + image + '" class="remove">Remove</a>';
var iCODE = iCODE + '</fieldset>';
var iCODE = iCODE + '</div>';
var iDIV = document.createElement('div');
$(iDIV).html(iCODE);
$(this).before(iDIV);
image++;
});
$("a[id^='remove-']").live('click', function(e) {
e.preventDefault();
var id = $(this).attr('id').match(/remove-(.*)/)[1];
$(".image-container-" + id).remove();
});
});
</script>
<div id="container" class="clearfix">
<div id="page">
<?php echo $this->fetch('photo_menu'); ?>
<div class="content clearfix">
<?php echo $this->fetch('photo_upload_menu'); ?>
<form id="photo-upload-form" method="post" enctype="multipart/form-data" action="<?php echo ADMIN_URL; ?>/index.php?q=photo/upload">
<fieldset>
<legend>Album Information</legend>
<div class="required">
<label for="username">Username</label>
<input name="username" type="text" id="username" class="medium" maxlength="16" value="<?php echo e($this->album['username']); ?>" />
</div>
<div class="required">
<label for="title">Title:</label>
<input name="title" type="text" id="title" class="mega" maxlength="100" value="<?php echo e($this->album['title']); ?>" />
</div>
<div class="required">
<label for="desc">Description:</label>
<textarea name="description" id="desc" class="mega"><?php echo e($this->album['description']); ?></textarea>
</div>
<div class="required">
<label for="tags">Tags:</label>
<textarea name="tags" id="tags" class="mega"><?php echo e($this->album['tags']); ?></textarea>
</div>
<div class="required">
<label for="category">Category:</label>
<div class="categs">
<?php foreach ($this->categories as $cat): ?>
<div style="width: 120px; float: left;"><input name="categories[]" type="checkbox" value="<?php echo $cat['cat_id']; ?>"<?php if (in_array($cat['cat_id'], $this->album['category'])): echo ' checked="checked"'; endif; ?>> <?php echo e($cat['name']); ?></div>
<?php endforeach; ?>
<div class="clear_left"></div>
</div>
</div>
<div class="clear"></div>
<div class="required">
<label for="type">Broadcast:</label>
<select name="type" id="type">
<option value="public"<?php if ($this->album['type'] == 'public'): echo ' selected="selected"'; endif; ?>>Public</option>
<option value="private"<?php if ($this->album['type'] == 'private'): echo ' selected="selected"'; endif; ?>>Private</option>
</select>
</div>
<div class="required">
<label for="status">Status:</label>
<select name="status" id="status">
<option value="0"<?php if ($this->album['status'] == '0'): echo ' selected="selected"'; endif; ?>>Suspended</option>
<option value="1"<?php if ($this->album['status'] == '1'): echo ' selected="selected"'; endif; ?>>Active</option>
</select>
</div>
</fieldset>
<?php if (VF::cfg_item('module.photo.allow_password') == '1'): ?>
<fieldset>
<legend>Password Protection</legend>
<div class="required">
<label for="password">Password</label>
<input name="password" type="text" id="password" class="medium" value="" />
<span class="help-info">Enter a password to password protect this album! Leavy empty for none.</span>
</div>
</fieldset>
<?php endif; ?>
<fieldset>
<legend>Album Photos</legend>
<fieldset id="image-container-1">
<legend>Image 1</legend>
<div class="required">
<label for="image_1">File</label>
<input name="image_1" type="file" id="image_1" />
</div>
<div class="optional">
<label for="caption_1">Caption (optional)</label>
<input name="caption_1" type="text" id="caption_1" class="extra" value="" />
</div>
<div class="optional">
<label for="description_1">Description (optional)</label>
<input name="description_1" type="text" id="description_1" class="extra" value="" />
</div>
</fieldset>
<div id="image-container" style="display: none;"></div>
<a href="#add-more" id="add-more">Add More</a>
</fieldset>
<div class="submit">
<input name="submit_upload" type="submit" id="submit_upload" class="button butDef" value=" Upload Album " />
</div>
</form>
</div>
</div>
</div>