sync(dev): fehlende Admin-Theme-Assets vom Live-Stand ergaenzt (nichts ueberschrieben)
This commit is contained in:
@@ -0,0 +1,837 @@
|
||||
|
||||
|
||||
|
||||
var admin_structure = {
|
||||
|
||||
set_configuration_type: function (id, is_checked) {
|
||||
var jqxhr;
|
||||
|
||||
jqxhr = $.ajax({
|
||||
url: './index.php?admin_modul=admin_structure&action=set_configuration_type&id=' + id + "&checked=" + is_checked,
|
||||
});
|
||||
|
||||
jqxhr.success(function(return_data) {
|
||||
var my_data;
|
||||
|
||||
try {
|
||||
my_data = $.parseJSON(return_data);
|
||||
|
||||
if (my_data.status == 'success') {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'Gespeichert',
|
||||
message: 'Konfiguration wird übernommen.'
|
||||
});
|
||||
} else {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'set_configuration_type Server side error: ' + my_data.message
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'set_configuration_type JSON error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'set_configuration_type URL error'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// banner id is bull now
|
||||
delete_banner: function (id, banner_image) {
|
||||
var jqxhr;
|
||||
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Löschen',
|
||||
denial: 'Abbrechen',
|
||||
confirmationFunction: function() {
|
||||
var jqxhr;
|
||||
|
||||
jqxhr = $.ajax({
|
||||
url: './index.php?admin_modul=admin_structure&action=delete_banner&id=' + id + '&banner_image=' + banner_image
|
||||
});
|
||||
|
||||
jqxhr.success(function(return_data) {
|
||||
var my_data;
|
||||
|
||||
try {
|
||||
my_data = $.parseJSON(return_data);
|
||||
|
||||
if (my_data.status == 'success') {
|
||||
// TODO just remove the sucker
|
||||
|
||||
$('.banner_container').each(function () {
|
||||
if ($(this).find('.delete_banner').attr('image') == banner_image) {
|
||||
$(this).empty().remove();
|
||||
}
|
||||
});
|
||||
//$('#banner_upload_container').css({'display':'block'});
|
||||
} else {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_banner server side error: ' + my_data.message
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_banner JSON error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_banner URL error'
|
||||
});
|
||||
});
|
||||
},
|
||||
heading: 'Banner Löschen',
|
||||
message: 'Wollen sie wirklich diesen Banner löschen?'
|
||||
});
|
||||
},
|
||||
|
||||
delete_textbox_image: function (id) {
|
||||
var jqxhr;
|
||||
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Löschen',
|
||||
denial: 'Abbrechen',
|
||||
confirmationFunction: function() {
|
||||
var jqxhr;
|
||||
|
||||
jqxhr = $.ajax({
|
||||
url: './index.php?admin_modul=admin_structure&action=delete_textbox_image&id=' + id
|
||||
});
|
||||
|
||||
jqxhr.success(function(return_data) {
|
||||
var my_data;
|
||||
|
||||
try {
|
||||
my_data = $.parseJSON(return_data);
|
||||
|
||||
if (my_data.status == 'success') {
|
||||
$('#textbox_image_container').empty();
|
||||
$('#textbox_image_container').append('<div id="textbox_image_upload_container">Bild hinzufügen:<br /><input id="textbox_image_upload" name="textbox_image" type="file" /></div>');
|
||||
$('#textbox_image_upload').uploadify({
|
||||
'uploader' : '../../../../libs/uploadify/uploadify.swf',
|
||||
'script' : './index.php?admin_modul=admin_structure',
|
||||
'cancelImg' : '../../../../libs/uploadify/cancel.png',
|
||||
'folder' : '../../../../libs/uploads',
|
||||
'scriptData' : {
|
||||
'action' : 'upload_textbox_image',
|
||||
'id': $('#textbox_id').val()
|
||||
},
|
||||
'auto' : true,
|
||||
'multi' : true,
|
||||
'onComplete' : function(event, ID, fileObj, response, data) {
|
||||
var path,
|
||||
image,
|
||||
my_return_data;
|
||||
|
||||
try {
|
||||
my_return_data = $.parseJSON(response);
|
||||
if (my_return_data.status == 'success') {
|
||||
path = my_return_data.path;
|
||||
image = my_return_data.image;
|
||||
|
||||
admin_structure.append_textbox_image(image, path);
|
||||
}
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_textbox_image server side error: ' + my_data.message
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_textbox_image JSON error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_textbox_image URL error'
|
||||
});
|
||||
});
|
||||
},
|
||||
heading: 'Bild Löschen',
|
||||
message: 'Wollen sie wirklich dieses Bild löschen?'
|
||||
});
|
||||
},
|
||||
|
||||
save_layout: function(form_url, form_data) {
|
||||
var jqxhr;
|
||||
|
||||
jqxhr = $.ajax({
|
||||
url: form_url,
|
||||
type: 'POST',
|
||||
data: form_data
|
||||
});
|
||||
|
||||
jqxhr.success(function(return_data) {
|
||||
var my_data;
|
||||
|
||||
try {
|
||||
my_data = $.parseJSON(return_data);
|
||||
|
||||
if (my_data.status == 'success') {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'Gespeichert',
|
||||
message: 'Das Seitenlayout wurde gespeichert.'
|
||||
});
|
||||
} else {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'save_layout Server side ' + mydata.message
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'save_layout JSON error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'save_layout URL error'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
sort_widgets: function() {
|
||||
var i,
|
||||
element
|
||||
|
||||
i = 1;
|
||||
while (element = $('#sortable li.' + i)) {
|
||||
if (element.length == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
$(element).appendTo('#sortable');
|
||||
|
||||
i++;
|
||||
}
|
||||
},
|
||||
|
||||
resort_widgets: function() {
|
||||
i = 1;
|
||||
|
||||
$('#sortable li .order_number').each(function() {
|
||||
$(this).val(i++);
|
||||
});
|
||||
},
|
||||
|
||||
get_sub_structure: function() {
|
||||
url = window.location;
|
||||
url += '&action=get_sub_structure';
|
||||
url += '&parent_id=' + $('#select_parent_structure').val();
|
||||
url += '&id=' + $('input[name=id]').val();
|
||||
|
||||
$('#sortable_menu_items').load(url);
|
||||
},
|
||||
|
||||
delete_structure: function(del_url) {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'ja',
|
||||
enial: 'nein',
|
||||
heading: 'Seite Löschen?',
|
||||
message: 'Wollen sie diese seite wirklich löschen?',
|
||||
confirmationFunction: function() {
|
||||
var jqxhr;
|
||||
|
||||
jqxhr = $.ajax({
|
||||
url: del_url
|
||||
});
|
||||
|
||||
jqxhr.success(function(return_data) {
|
||||
var mydata;
|
||||
|
||||
try {
|
||||
mydata = $.parseJSON(return_data);
|
||||
|
||||
if (mydata.status == 'success') {
|
||||
window.location.reload();
|
||||
} else {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_structure Server side ' + mydata.message
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_structure JSON error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'delete_structure URL error'
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//TODO: insert rest of path
|
||||
append_banner: function(image_name, path) {
|
||||
var html = '<div class="banner_container" style="position:relative;background:#cecece;margin-top:10px;height:100px;">';
|
||||
html += '<a class="delete_banner" image="' + image_name + '" href="#" style="position:absolute;right:0px;top:0px;">Banner entfernen</a>';
|
||||
html += '<img class="banner_image" style="width:150px;border:1px solid #000000;" src="' + path + image_name + '" />';
|
||||
html += '<div style="position:absolute;top:20px;left:200px;">';
|
||||
html += 'Link: (z.B.: http://www.meine_domain.de)<br />';
|
||||
html += '<input name="banner_link[' + image_name + ']" value="" class="content_box_banner" style="width:300px;"><br />';
|
||||
html += '<input type="checkbox" name="image_link_target[' + image_name + ']" value="1" />Link in neuem Fenster öffnen:<br />';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
$('#banner_container').append(html);
|
||||
},
|
||||
//TODO: insert rest of path
|
||||
append_textbox_image: function(image_name, path) {
|
||||
var html = '<a class="delete_textbox_image" href="#" style="position:relative;right:0px;top:0px;">Bild entfernen</a><br />';
|
||||
html += '<img class="textbox_image" style="width:150px;border:1px solid #000000;" src="' + path + image_name + '" />';
|
||||
html += '<input name="textbox_image_name" value="' + image_name + '" type="hidden" />';
|
||||
html += '<div class="body">';
|
||||
html += '<label for="content_box_slider">Position</label><br />';
|
||||
html += '<select name="textbox_image_position">';
|
||||
html += '<option value="left">links</option>';
|
||||
html += '<option value="right" selected>rechts</option>';
|
||||
html += '</select>';
|
||||
html += '</div>';
|
||||
html += '<div class="body">';
|
||||
html += '<label for="content_box_slider">Link</label><br />';
|
||||
html += '<input name="textbox_image_link" value="" type="text" />';
|
||||
html += '</div>';
|
||||
$('#textbox_image_container').empty();
|
||||
$('#textbox_image_container').append(html);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
//================
|
||||
//
|
||||
// setup page
|
||||
//
|
||||
//================
|
||||
|
||||
$('#adminLeftFloater').rsTabs();
|
||||
$('#adminRightFloater').rsTabs();
|
||||
|
||||
// sort on load
|
||||
admin_structure.sort_widgets();
|
||||
|
||||
$('.edit_title_toggler').click(function() {
|
||||
$(this).toggleClass('edit_title_hidden').next('.toggleable_container').toggle(200);
|
||||
});
|
||||
|
||||
var structure_id = $('#structure_id');
|
||||
|
||||
if (structure_id.length > 0) {
|
||||
$("#demo1").jstree({
|
||||
// ui : {
|
||||
// select_limit : 1,
|
||||
// get_selected : function() {
|
||||
// alert('get_selected');
|
||||
// }
|
||||
// },
|
||||
core : {
|
||||
initially_open : 'phtml_' + structure_id.val()
|
||||
},
|
||||
plugins : ["themes", "html_data"]
|
||||
});
|
||||
|
||||
//alert('phtml_' + structure_id.val())
|
||||
} else {
|
||||
$("#demo1").jstree({
|
||||
plugins : ["themes", "html_data"]
|
||||
});
|
||||
}
|
||||
|
||||
$('#sortable_menu_items').sortable({
|
||||
update: function (e, ui) {
|
||||
$(this).children().each(function(index) {
|
||||
$(this).children('input[name="sort_item_pos[]"]').val(index);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
$('textarea.content_box_textbox').tinymce({
|
||||
script_url : '../../../libs/tinymce/tinymce.min.js',
|
||||
width: 960,
|
||||
height: 500,
|
||||
plugins: 'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking save table contextmenu directionality emoticons template paste',
|
||||
convert_urls: false,
|
||||
branding: false,
|
||||
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media",
|
||||
statusbar: false
|
||||
});
|
||||
|
||||
$('#sortable').sortable({
|
||||
update: function (e, ui) {
|
||||
admin_structure.resort_widgets()
|
||||
},
|
||||
start: function(e, ui) {
|
||||
$('textarea.content_box_textbox').tinymce().remove();
|
||||
},
|
||||
stop: function(e, ui) {
|
||||
$('textarea.content_box_textbox').tinymce({
|
||||
script_url : '../../../libs/tinymce/tinymce.min.js',
|
||||
width: 960,
|
||||
height: 500,
|
||||
plugins: 'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking save table contextmenu directionality emoticons template paste',
|
||||
branding: false,
|
||||
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media",
|
||||
statusbar: false
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#file_upload').uploadify({
|
||||
'uploader' : '../../../../libs/uploadify/uploadify.swf',
|
||||
'script' : './index.php?admin_modul=admin_structure',
|
||||
'cancelImg' : '../../../../libs/uploadify/cancel.png',
|
||||
'folder' : '../../../../libs/uploads',
|
||||
'scriptData' : {
|
||||
'action' : 'upload_banner',
|
||||
'id': $('#banner_id').val()
|
||||
},
|
||||
'auto' : true,
|
||||
'multi' : true,
|
||||
'onComplete' : function(event, ID, fileObj, response, data) {
|
||||
var path,
|
||||
banner,
|
||||
my_return_data;
|
||||
|
||||
try {
|
||||
my_return_data = $.parseJSON(response);
|
||||
|
||||
if (my_return_data.status == 'success') {
|
||||
path = my_return_data.path;
|
||||
banner = my_return_data.image;
|
||||
|
||||
admin_structure.append_banner(banner, path);
|
||||
}
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//================
|
||||
//
|
||||
// event binding
|
||||
//
|
||||
//================
|
||||
|
||||
// enalbe widget when checkbox is checked
|
||||
// most widgets don't use it, just get rid of this
|
||||
$('#sortable input[type="checkbox"]').click(function () {
|
||||
var name = $(this).attr('name');
|
||||
|
||||
$('.' + name).attr('disabled', !$(this).attr('checked'));
|
||||
});
|
||||
|
||||
// the next three ebents select the way the item box shows
|
||||
// the products in the frontend
|
||||
$('#button_article_list_1').click(function() {
|
||||
$(this).addClass("active");
|
||||
$('#button_article_list_2').removeClass("active");
|
||||
$('#button_article_list_3').removeClass("active");
|
||||
$('input[name="article_list_style"]').val('1');
|
||||
});
|
||||
|
||||
$('#button_article_list_2').click(function() {
|
||||
$(this).addClass("active");
|
||||
$('#button_article_list_1').removeClass("active");
|
||||
$('#button_article_list_3').removeClass("active");
|
||||
$('input[name="article_list_style"]').val('2');
|
||||
});
|
||||
|
||||
$('#button_article_list_3').click(function() {
|
||||
$(this).addClass("active");
|
||||
$('#button_article_list_1').removeClass("active");
|
||||
$('#button_article_list_2').removeClass("active");
|
||||
$('input[name="article_list_style"]').val('3');
|
||||
});
|
||||
|
||||
// delete_banner
|
||||
$('.delete_banner').click(function(e) {
|
||||
var id;
|
||||
|
||||
e.preventDefault();
|
||||
banner_image = $(this).attr('image');
|
||||
id = $('#banner_id').val();
|
||||
|
||||
admin_structure.delete_banner(id, banner_image);
|
||||
});
|
||||
|
||||
$('#get_parent_site_configuration').change(function(e) {
|
||||
var id,
|
||||
is_checked;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
id = $('#structure_id').val();
|
||||
if ($(this).prop('checked')) {
|
||||
is_checked = '1';
|
||||
} else {
|
||||
is_checked = '0';
|
||||
}
|
||||
|
||||
admin_structure.set_configuration_type(id, is_checked);
|
||||
});
|
||||
|
||||
$('#select_parent_structure').change(function() {
|
||||
admin_structure.get_sub_structure();
|
||||
});
|
||||
|
||||
$('.edit_icon_bar .delete').click(function(e) {
|
||||
var url;
|
||||
e.preventDefault();
|
||||
url = $(this).attr('href');
|
||||
admin_structure.delete_structure(url);
|
||||
});
|
||||
|
||||
$('#save_layout_form').submit(function(e) {
|
||||
var form_data,
|
||||
form_url;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
form_data = $(this).serialize();
|
||||
form_url = $(this).attr('action');
|
||||
|
||||
admin_structure.save_layout(form_url, form_data);
|
||||
});
|
||||
|
||||
$('#customerGroup').change(function() {
|
||||
$('#pricesAjaxPreloader').css({
|
||||
'display': 'block'
|
||||
});
|
||||
|
||||
$.post('/index.php?admin_modul=admin_structure', {
|
||||
'action': 'get_discount',
|
||||
'id': $('#s_id').val(),
|
||||
'customerGroup': $(this).val()
|
||||
}, function(data) {
|
||||
if (data.discounts) {
|
||||
$.each(data.discounts, function(key, val) {
|
||||
$('#form_field_discount_' + key).val(val);
|
||||
});
|
||||
} else {
|
||||
$('.ajax_empty input').val('');
|
||||
}
|
||||
|
||||
$('#pricesAjaxPreloader').css({
|
||||
'display': 'none'
|
||||
});
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
$('#save_discounts').submit(function(e) {
|
||||
var form_data,
|
||||
form_url;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
form_data = $(this).serialize();
|
||||
form_url = $(this).attr('action');
|
||||
|
||||
var jqxhr;
|
||||
jqxhr = $.ajax({
|
||||
url: form_url,
|
||||
type: 'POST',
|
||||
data: form_data
|
||||
});
|
||||
|
||||
jqxhr.success(function(return_data) {
|
||||
var my_data;
|
||||
|
||||
try {
|
||||
my_data = $.parseJSON(return_data);
|
||||
|
||||
if (my_data.status == 'success') {
|
||||
/*bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'Gespeichert',
|
||||
message: 'Die Rabatte wurde gespeichert.'
|
||||
});*/
|
||||
|
||||
$('#pricesAjaxPreloader').css({
|
||||
'display': 'block'
|
||||
});
|
||||
|
||||
$.post('/index.php?admin_modul=admin_structure', {
|
||||
'action': 'get_discount',
|
||||
'id': $('#s_id').val(),
|
||||
'customerGroup': $('#customerGroup').val()
|
||||
}, function(data) {
|
||||
if (data.discounts) {
|
||||
$.each(data.discounts, function(key, val) {
|
||||
$('#form_field_discount_' + key).val(val);
|
||||
});
|
||||
} else {
|
||||
$('.ajax_empty input').val('');
|
||||
}
|
||||
|
||||
$('#pricesAjaxPreloader').css({
|
||||
'display': 'none'
|
||||
});
|
||||
}, 'json');
|
||||
} else {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'save_discount Server side ' + mydata.message
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'save_discount JSON error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
bend.dialogs.confirmationDialog({
|
||||
confirmation: 'Ok',
|
||||
showDenial: false,
|
||||
heading: 'ERROR',
|
||||
message: 'save_discount URL error'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var id = $('input[name="id"]').val();
|
||||
|
||||
$('#logo_upload').uploadify({
|
||||
'uploader' : '../../../../libs/uploadify/uploadify.swf',
|
||||
'script' : './index.php?admin_modul=admin_structure',
|
||||
'cancelImg' : '../../../../libs/uploadify/cancel.png',
|
||||
'folder' : '../../../../libs/uploads',
|
||||
'scriptData': {
|
||||
'action': 'upload',
|
||||
'id': id
|
||||
},
|
||||
'fileDesc' : 'Web Image Files',
|
||||
'buttonText': 'Logo',
|
||||
'auto' : true,
|
||||
'multi' : false,
|
||||
'onComplete': function(event, ID, fileObj, response, data) {
|
||||
try {
|
||||
var mydata = $.parseJSON(response);
|
||||
|
||||
if (mydata.status == 'success') {
|
||||
window.location.href = './index.php?admin_modul=admin_structure&id=' + id;
|
||||
} else {
|
||||
$().easywayShopMessageDialog("ERROR: can't save", {}, function() {
|
||||
$().easywayShopMessageDialog(mydata.data, {}, function() {});
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
$().easywayShopMessageDialog("ERROR: can't upload", {}, function() {});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#header_upload').uploadify({
|
||||
'uploader' : '../../../../libs/uploadify/uploadify.swf',
|
||||
'script' : './index.php?admin_modul=admin_structure',
|
||||
'cancelImg' : '../../../../libs/uploadify/cancel.png',
|
||||
'folder' : '../../../../libs/uploads',
|
||||
'scriptData': {
|
||||
'action': 'upload_header_image',
|
||||
'id': id
|
||||
},
|
||||
'fileDesc' : 'Web Image Files',
|
||||
'buttonText': 'Headergrafik',
|
||||
'auto' : true,
|
||||
'multi' : false,
|
||||
'onComplete': function(event, ID, fileObj, response, data) {
|
||||
try {
|
||||
var mydata = $.parseJSON(response);
|
||||
|
||||
if (mydata.status == 'success') {
|
||||
window.location.href = './index.php?admin_modul=admin_structure&id=' + id;
|
||||
} else {
|
||||
$().easywayShopMessageDialog("ERROR: can't save", {}, function() {
|
||||
$().easywayShopMessageDialog(mydata.data, {}, function() {});
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
$().easywayShopMessageDialog("ERROR: can't upload", {}, function() {});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#textbox_image_upload').uploadify({
|
||||
'uploader' : '../../../../libs/uploadify/uploadify.swf',
|
||||
'script' : './index.php?admin_modul=admin_structure',
|
||||
'cancelImg' : '../../../../libs/uploadify/cancel.png',
|
||||
'folder' : '../../../../libs/uploads',
|
||||
'scriptData' : {
|
||||
'action' : 'upload_textbox_image',
|
||||
'id': $('#textbox_id').val()
|
||||
},
|
||||
'fileDesc' : 'Web Image Files',
|
||||
'buttonText': 'Textbild',
|
||||
'auto' : true,
|
||||
'multi' : true,
|
||||
'onComplete' : function(event, ID, fileObj, response, data) {
|
||||
try {
|
||||
var path,
|
||||
image,
|
||||
my_return_data;
|
||||
|
||||
my_return_data = $.parseJSON(response);
|
||||
if (my_return_data.status == 'success') {
|
||||
path = my_return_data.path;
|
||||
image = my_return_data.image;
|
||||
|
||||
admin_structure.append_textbox_image(image, path);
|
||||
}
|
||||
else {
|
||||
$().easywayShopMessageDialog("ERROR: can't save", {}, function() {
|
||||
$().easywayShopMessageDialog(mydata.data, {}, function() {});
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
$().easywayShopMessageDialog("ERROR: can't upload", {}, function() {});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// delete textbox_image
|
||||
$('.delete_textbox_image').live('click',function(e) {
|
||||
var id;
|
||||
|
||||
e.preventDefault();
|
||||
id = $('#textbox_id').val();
|
||||
|
||||
admin_structure.delete_textbox_image(id);
|
||||
});
|
||||
|
||||
$('#delete_image').click(function(e) {
|
||||
e.preventDefault();
|
||||
var url = $(this).attr('href');
|
||||
var jqxhr = $.ajax({
|
||||
'url': url
|
||||
});
|
||||
|
||||
jqxhr.success(function(data) {
|
||||
try {
|
||||
data = $.parseJSON(data);
|
||||
|
||||
if (data.status == 'success') {
|
||||
window.location.reload();
|
||||
} else {
|
||||
$().easywayShopMessageDialog("ERROR: no save'", {}, function() {});
|
||||
}
|
||||
} catch(e) {
|
||||
$().easywayShopMessageDialog("ERROR: wrong answer", {}, function() {});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
$().easywayShopMessageDialog("ERROR", {}, function() {});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#delete_header_image').click(function(e) {
|
||||
e.preventDefault();
|
||||
var url = $(this).attr('href');
|
||||
var jqxhr = $.ajax({
|
||||
'url': url
|
||||
});
|
||||
|
||||
jqxhr.success(function(data) {
|
||||
try {
|
||||
data = $.parseJSON(data);
|
||||
|
||||
if (data.status == 'success') {
|
||||
window.location.reload();
|
||||
} else {
|
||||
$().easywayShopMessageDialog("ERROR: no save'", {}, function() {});
|
||||
}
|
||||
} catch(e) {
|
||||
$().easywayShopMessageDialog("ERROR: wrong answer", {}, function() {});
|
||||
}
|
||||
});
|
||||
|
||||
jqxhr.error(function() {
|
||||
$().easywayShopMessageDialog("ERROR", {}, function() {});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user