This repository has been archived on 2026-07-13. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ah-treereader/AH-TreeReader/examples/ajax_loadCategoryTree.php
T
2017-05-14 15:10:03 +02:00

164 lines
5.2 KiB
PHP

<script type="text/javascript">
jQuery(document).ready(function($) {
userAction.ajax_session_timeout();
});
</script>
<ul><li class="root" style="background-image: none;"><span class="options"><a class="icon_create root" parentId="0" catId="1"></a></span>
<div style="float: left;"><input type="text" modeCategory="new" parentId="0" placeholder="[de]" catId="1" name="de" value="" class="create" />
<input type="text" modeCategory="new" parentId="0" placeholder="[en]" catId="1" name="en" value="" class="create" />
<input type="text" modeCategory="new" parentId="0" placeholder="[fr]" catId="1" name="fr" value="" class="create" />
<a class="icon_save create" parentId="0" catId="1"></a></div><div class="clear"></div></li></ul>
<ul>
<li class="first submenu" id='cat_2660'><span class="read" catId="2660"><a href='javascript:void(0)'>Advertising Media</a></span><input name='categories[]' type='checkbox' value='2660' />
<div class="clear"></div><div class="clear"></div></li>
<li class=" submenu" id='cat_14000'><span class="read" catId="14000"><a href='javascript:void(0)'>BAH Image series</a></span><input name='categories[]' type='checkbox' value='14000' />
<div class="clear"></div><div class="clear"></div></li>
<li id='cat_10943'><span class="read" catId="10943"><a href='javascript:void(0)'>BAH Internal Videos</a></span><input name='categories[]' type='checkbox' value='10943' />
<div class="clear"></div><div class="clear"></div></li>
<li class=" submenu" id='cat_6923'><span class="read" catId="6923"><a href='javascript:void(0)'>BAH Webshop</a></span><input name='categories[]' type='checkbox' value='6923' />
<div class="clear"></div><div class="clear"></div></li>
<li class=" submenu" id='cat_8983'><span class="read" catId="8983"><a href='javascript:void(0)'>BAH archive</a></span><input name='categories[]' type='checkbox' value='8983' />
<div class="clear"></div><div class="clear"></div></li>
<li class=" submenu" id='cat_14344'><span class="read" catId="14344"><a href='javascript:void(0)'>M-CAP-Links</a></span><input name='categories[]' type='checkbox' value='14344' />
<div class="clear"></div><div class="clear"></div></li>
<li id='cat_4123'><span class="read" catId="4123"><a href='javascript:void(0)'>Medical Care </a></span><input name='categories[]' type='checkbox' value='4123' />
<div class="clear"></div><div class="clear"></div></li>
</ul>
<script type="text/javascript">
$.ajax({
url : "../assets/js/editCategories.php",
type : "POST"
}).done(function (data) {
// Bei Erfolg
$('#editCategoryTree').html('');
$('#editCategoryTreeDetailLayer').html('');
if($('#detailLayerBig').html() == "")
{
$('#editCategoryTree').append(data);
}
else
{
$('#editCategoryTreeDetailLayer').append(data);
}
});
/********** CHECKBOX DETAIL LAYER **********/
$('.detailLayer .folders input[type="checkbox"]').each(function() {
$(this).hide();
if($(this).attr("checked") == "checked")
{
var $image = $("<img class='checkbox' src='../assets/p/checkbox_active_layer.png' />").insertAfter(this);
}
else
{
var $image = $("<img class='checkbox' src='../assets/p/checkbox_inactive_layer.png' />").insertAfter(this);
}
$image.click(function(e) {
e.stopPropagation();
var $checkbox = $(this).prev();
$(this).prev().hide();
if($checkbox.attr('checked') == "checked")
{
// $checkbox.prop('checked',false);
$checkbox.attr('checked',false);
$image.attr("src", "../assets/p/checkbox_inactive_layer.png");
}
else
{
// $checkbox.prop('checked',true);
$checkbox.attr('checked',true);
$image.attr("src", "../assets/p/checkbox_active_layer.png");
}
});
});
if($('.addCategorys img').attr('src','../assets/p/checkbox_inactive_layer.png').length == 0)
{
$('.addCategorys .folders input[type="checkbox"]').each(function() {
$(this).hide();
if($(this).attr("checked") == "checked")
{
var $image = $("<img class='checkbox' src='../assets/p/checkbox_active_layer.png' />").insertAfter(this);
}
else
{
var $image = $("<img class='checkbox' src='../assets/p/checkbox_inactive_layer.png' />").insertAfter(this);
}
$image.click(function() {
var $checkbox = $(this).prev();
$(this).prev().hide();
if($checkbox.attr('checked') == "checked")
{
// $checkbox.prop('checked',false);
$checkbox.attr('checked',false);
$image.attr("src", "../assets/p/checkbox_inactive_layer.png");
}
else
{
// $checkbox.prop('checked',true);
$checkbox.attr('checked',true);
$image.attr("src", "../assets/p/checkbox_active_layer.png");
}
});
});
}
$(".detailLayer .actionWrapper .edit").attr('disabled', false);
$(".detailLayer .actionWrapper .edit").css('cursor', 'pointer');
</script>
<script type="text/javascript">
jQuery(document).ready(function($) {
if($('.detailLayer').css('display') == "block")
{
$('.folders input[value="14320"]').attr('checked','checked');
$('.folders input[value="14320"]').prop('checked',true);
$('.folders input[value="14320"]').next().attr('src','../assets/p/checkbox_active_layer.png');
}
});
</script>