Файл: adultscript-2.0.3-pro/files/admin/templates/default/csv.tpl.php
Строк: 424
<?php defined('_VALID') or die('Restricted Access!'); ?>
<script type="text/javascript">
var unique = "<?php echo $this->unique; ?>";
function update_import_progress(import_id)
{
$.ajax({
url: base_url + '/ajax.php?s=mass_csv_progress&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: { import_id: import_id },
success: function(response){
$(".progress_msg").html('');
$(".bar").css('width', response.progress + '%');
$(".progress_msg").html(response.msg);
setTimeout("update_import_progress('" + import_id + "')", 3600);
}
});
}
$(document).ready(function() {
var import_id = $("input[name='unique']").val();
$("input[name='submit_import']").click(function(e) {
$.ajax({
url: base_url + '/ajax.php?s=mass_csv_progress&d=backend',
cache: false,
type: "POST",
dataType: "json",
data: { import_id: unique },
success: function(response){
$("#progress_container").fadeIn();
setTimeout("update_import_progress('" + import_id + "')", 1200);
$("#csv-import-form").submit();
}
});
});
$("select[id='category_method']").change(function() {
if ($(this).val() == 'select') {
$("#categories-container").show();
} else {
$("#categories-container").hide();
}
});
$("select[id='csv_method']").change(function() {
$("div[id^='csv_']").hide();
$("#csv_" + $(this).val()).show();
});
$("select[id='method']").change(function() {
if ($(this).val() == 'hotlink') {
$("#mobile-container").show();
} else {
$("#mobile-container").hide();
}
});
$("select[id='method']").change(function() {
if ($(this).val() == 'flv') {
$("#queue-container").show();
} else {
$("#queue-container").hide();
}
});
$("select[id='method']").change(function() {
if ($(this).val() == 'embed') {
$("select[id='thumb_method']").val('download');
$("#convert_videos").hide();
$("#embed_replace").show();
} else {
$("#convert_videos").show();
$("#embed_replace").hide();
}
});
});
</script>
<?php echo $this->fetch('errors'); ?>
<?php echo $this->fetch('messages'); ?>
<?php echo $this->fetch('warnings'); ?>
</script>
<div id="container" class="clearfix">
<div id="page">
<?php echo $this->fetch('video_menu'); ?>
<div class="content clearfix">
<?php echo $this->fetch('video_add_menu'); ?>
<form name="csv-import-form" id="csv-import-form" method="post" enctype="multipart/form-data" action="<?php echo ADMIN_URL; ?>/index.php?q=csv">
<input name="unique" type="hidden" id="unique" value="<?php echo $this->unique; ?>" />
<input name="submitted" type="hidden" value="1" />
<fieldset>
<legend>Video Information</legend>
<div class="required">
<label for="username">Username</label>
<input name="username" type="text" id="username" class="medium" value="<?php echo e($this->option['username']); ?>" />
</div>
<div class="required">
<label for="category">Categories:</label>
<select name="category_method" id="category_method">
<option value="auto"<?php if ($this->option['categ_method'] == 'auto'): echo ' selected="selected"'; endif; ?>>Autodetect</option>
<option value="select"<?php if ($this->option['categ_method'] == 'select'): echo ' selected="selected"'; endif; ?>>Select</option>
</select><br /><br />
<div id="categories-container" class="categories"<?php if ($this->option['categ_method'] == 'auto'): echo ' style="display: none;"'; endif; ?>>
<?php echo p('categories_select', $this->categories, $this->option['category']); ?>
</div>
</div>
<div class="clear"></div>
<div class="optional">
<label for="type">Type</label>
<input name="type" type="radio" id="type_public" class="radio" value="public"<?php if ($this->option['type'] == 'public'): echo ' checked="checked"'; endif; ?> /> Public
<input name="type" type="radio" id="type_private" class="radio" value="private"<?php if ($this->option['type'] == 'private'): echo ' checked="checked"'; endif; ?> /> Private
</div>
<?php if (VModule::enabled('premium')): ?>
<div class="optional">
<label for="premium">Premium</label>
<input name="premium" type="radio" id="premium" class="radio" value="1"<?php if ($this->option['premium'] == '1'): echo ' checked="checked"'; endif; ?> /> Yes
<input name="premium" type="radio" class="radio" value="0"<?php if ($this->option['premium'] == '0'): echo ' checked="checked"'; endif; ?> /> No
</div>
<?php endif; ?>
<div class="optional">
<label for="status">Status</label>
<input name="status" type="radio" id="status_active" class="radio" value="1"<?php if ($this->option['status'] == '1'): echo ' checked="checked"'; endif; ?> /> Active
<input name="status" type="radio" id="status_suspended" class="radio" value="0"<?php if ($this->option['status'] == '0'): echo ' checked="checked"'; endif; ?> /> Suspended
</div>
</fieldset>
<fieldset>
<legend>Video Channel</legend>
<div class="required">
<label for="channel_id">Channel:</label>
<select name="channel_id" id="channel_id">
<option value="">-------------</option>
<?php foreach ($this->channels as $channel): ?>
<option value="<?php echo $channel['channel_id']; ?>"<?php if ($this->option['channel_id'] == $channel['channel_id']): echo ' selected="selected"'; endif; ?>><?php echo e($channel['name']); ?></option>
<?php endforeach; ?>
</select>
</div>
</fieldset>
<fieldset>
<legend>Import Properties</legend>
<div class="required">
<label for="method">Import Method</label>
<select name="method" id="method">
<option value="flv"<?php if ($this->option['method'] == 'flv'): echo ' selected="selected"'; endif; ?>>FLV Source</option>
<option value="embed"<?php if ($this->option['method'] == 'embed'): echo ' selected="selected"'; endif; ?>>Embed Code</option>
<option value="hotlink"<?php if ($this->option['method'] == 'hotlink'): echo ' selected="selected"'; endif; ?>>Hotlink Video</option>
</select>
</div>
<div class="required">
<label for="thumb_method">Thumb Method</label>
<select name="thumb_method" id="thumb_method">
<option value="generate"<?php if ($this->option['thumb_method'] == 'generate'): echo ' selected="selected"'; endif; ?>>Extract from FLV</option>
<option value="download"<?php if ($this->option['thumb_method'] == 'download'): echo ' selected="selected"'; endif; ?>>Download Thumb</option>
</select>
</div>
<div class="required" id="mobile-container"<?php if ($this->method != 'hotlink'): echo ' style="display: none;"'; endif; ?>>
<label for="mobile">Mobile</label>
<select name="mobile" id="mobile">
<option value="0"<?php if ($this->option['mobile'] == '1'): echo ' selected="selected"'; endif; ?>>Yes</option>
<option value="1"<?php if ($this->option['mobile'] == '0'): echo ' selected="selected"'; endif; ?>>No</option>
</select>
</div>
<div class="required" id="queue-container"<?php if ($this->option['method'] != 'flv'): echo ' style="display: none;"'; endif; ?>>
<label for="queue">Queue</label>
<select name="queue" id="queue">
<option value="1"<?php if ($this->option['queue'] == '1'): echo ' selected="selected"'; endif; ?>>Yes</option>
<option value="0"<?php if ($this->option['queue'] == '0'): echo ' selected="selected"'; endif; ?>>No</option>
</select>
</div>
</fieldset>
<fieldset>
<legend>Import Options</legend>
<div class="required">
<label for="duplicates">Block Duplicates</label>
<input name="duplicates" type="radio" id="duplicates_yes" class="radio" value="1"<?php if ($this->option['duplicates'] == '1'): echo ' checked="checked"'; endif; ?> /> Yes
<input name="duplicates" type="radio" id="duplicates_no" class="radio" value="0"<?php if ($this->option['duplicates'] == '0'): echo ' checked="checked"'; endif; ?> /> No
</div>
<div class="required">
<label for="ignore">Ignore</label>
<input name="ignore" type="radio" id="ignore_yes" class="radio" value="1"<?php if ($this->option['ignore'] == '1'): echo ' checked="checked"'; endif; ?> /> Yes
<input name="ignore" type="radio" id="ignore_no" class="radio" value="0"<?php if ($this->option['ignore'] == '0'): echo ' checked="checked"'; endif; ?> /> No<br />
<span class="help-info">Ignore rows with empty/incomplete/error fields and only add correct ones (dont stop on errors)!</span>
</div>
<div class="required" id="embed_replace"<?php if ($this->option['method'] != 'embed'): echo ' style="display: none;"'; endif; ?>>
<label for="replace">Replace:</label>
<input name="search" type="text" id="replace_search" class="large" value="<?php echo e($this->option['search']); ?>" />
<input name="replace" type="text" id="replace_with" class="large" value="<?php echo e($this->option['replace']); ?>" /><br />
<span class="help-info">Use to change width/height of embed code (search=width='640' height='360', replace=width='650' height='490')!</span>
</div>
<div class="required">
<label for="limit">Limit</label>
<input name="limit" type="text" id="limit" class="small" value="<?php echo $this->option['limit']; ?>" />
<span class="help-info">Limit the number of videos to add from CSV!</span>
</div>
<div class="required">
<label for="limit_proc">Process Limit:</label>
<input name="limit_proc" type="text" id="limit_proc" class="small" value="<?php echo $this->option['limit_proc']; ?>" />
<span class="help-info">Limit the number of rows to process before giving up if no valid videos can be added!</span>
</div>
</fieldset>
<fieldset>
<legend>CSV Properties</legend>
<div style="width: 100%; text-align: center; padding: 5px 0;">
<select name="order_1" id="order_1">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '1'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
<select name="order_2" id="order_2">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '2'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
<select name="order_3" id="order_3">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '3'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
<select name="order_4" id="order_4">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '4'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
<br />
<select name="order_5" id="order_5">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '5'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
<select name="order_6" id="order_6">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '6'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
<select name="order_7" id="order_7">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '7'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
<select name="order_8" id="order_8">
<option value="">---</option>
<?php foreach ($this->orders as $k => $v): ?>
<option value="<?php echo $k; ?>"<?php if ($v == '8'): echo ' selected="selected"'; endif; ?>><?php echo $k; ?></option>
<?php endforeach; ?>
</select>
</div>
<br />
<div class="required">
<label for="csv_method">Input Method:</label>
<select name="csv_method" id="csv_method">
<option value="file"<?php if ($this->option['csv_method'] == 'file'): echo ' selected="selected"'; endif; ?>>File</option>
<option value="text"<?php if ($this->option['csv_method'] == 'text'): echo ' selected="selected"'; endif; ?>>Text</option>
<select>
</div>
<div id="csv_file" class="required"<?php if ($this->option['csv_method'] != 'file'): echo ' style="display: none;"'; endif; ?>>
<label for="csv">CSV File</label>
<input name="csv" type="file" id="csv" />
</div>
<div id="csv_text" class="required"<?php if ($this->option['csv_method'] != 'text'): echo ' style="display: none;"'; endif; ?>>
<label for="csv">CSV Text</label>
<textarea name="csv" id="csv" rows="10" class="mega"></textarea>
</div>
<div class="required">
<label for="delimiter">Separator</label>
<select name="delimiter" id="delimiter">
<option value="|"<?php if ($this->option['delimiter'] == '|'): echo ' selected="selected"'; endif; ?>>Pipe (|)</option>
<option value=","<?php if ($this->option['delimiter'] == ','): echo ' selected="selected"'; endif; ?>>Comma (,)</option>
<option value="tab"<?php if ($this->option['delimiter'] == 'tab'): echo ' selected="selected"'; endif; ?>>Tab</option>
<option value=";"<?php if ($this->option['delimiter'] == ';'): echo ' selected="selected"'; endif; ?>>Semicolon (;)</option>
</select>
</div>
</fieldset>
<div id="progress_container" style="display: none;">
<fieldset>
<legend>CSV Import Progress</legend>
<div id="progress" style="width: 98%;"><div class="bar" style="width: 0;"> </div></div>
<div class="progress_msg">Processing...please wait!</div>
</fieldset>
</div>
<div class="submit">
<input name="submit_import" type="button" id="submit_import" class="button butDef" value=" Import Videos " />
</div>
</form>
</div>
</div>
</div>