Subversion-Projekte lars-tiefland.ci

Revision

Revision 2381 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

    $(function(){
        $('.add_image').button({
            icons:{
                primary:'ui-icon-plus'
            }
        }).click(add_images);
        $('.add_folder').button({
            icons:{
                primary:'ui-icon-plus'
            }
        }).click(add_folder);
        $('.del_image').button({
            icons:{
                primary:'ui-icon-trash'
            }
        });
        
        $('.search').button({
            icons:{
                primary: "ui-icon-search"
            }
        }).click(search);
        
        $('#upload_dlg .nav').css("cursor","pointer").click(nav);
        
                $('#userQuestion').dialog({
                        autoOpen:false,
                        modal:true,
                        width:800,
                        resizable:false,
                        buttons:[{
                                text:"ja",
                                icons: {
                                        primary: "ui-icon-check"
                                },
                                showText: false,
                                click:function()
                                {
                                        $('#userResult').load("/backend/user/del",$('#user_form').serializeArray(),function(){
                                                $('#userResult').dialog("open");
                                        })
                                        $('#userQuestion').dialog("close");
                                }
                        },
                        {
                                text:"nein",
                                icons: {
                                        primary: "ui-icon-close"
                                },
                                showText: false,
                                click:function(){
                                        $('#userQuestion').dialog("close");
                                }
                        }]
                });
        function nav()
        {
            f_name=$(this).attr("data-fname");
            l_id=$('#lID').val();
            l_type=$('#lType').val();
            $('#upload_dlg').load("/backend/bildverwaltung/upload?folder="+f_name+"&l_type="+l_type+"&l_id="+l_id);
        }
        
        $('#upload_dlg').dialog({
            autoOpen: false,
            modal:true,
            width:"95%",
            height:600,
            resizable:false,
            close:function(){
                l_id=$('#lID').val();
                l_type=$('#lType').val();
                $('#bildverwaltung').load("/Online-Shop/bilder.php?l_id="+l_id+"&l_type="+l_type);
            },
            buttons:{
                "Abbrechen":function()
                {
                    l_id=$('#lID').val();
                    l_type=$('#lType').val();
                    $('#bildverwaltung').load("/Online-Shop/bilder.php?l_id="+l_id+"&l_type="+l_type);
                    $('#upload_dlg').dialog("close");
                }
            }
        });
        
        $('#folder_dialog').dialog({
            autoOpen:false,
            modal:true,
            width:800,
            resizable:false,
            buttons:{
                "Ordner anlegen":function(){
                    $.post("/backend/toolbox/mkdir/",$('#create_folder').serializeArray(),function(html){
                        //alert(html);
                    });
                    $('#folder_dialog').dialog("close");
                },
                "Abbruch": function(){
                    $('#folder_dialog').dialog("close");
                }
            }
        })
        
        function search(e)
        {
            e.preventDefault();
            $('#search_media').submit();
        }
        
        function add_images(e)
        {
            e.preventDefault();
            $('#upload_dlg').dialog('open');
        }
        
        function add_folder(e)
        {
            e.preventDefault();
            $('#folder_dialog').dialog("open");                
        }
        $('#taskResult').dialog({
            width:800,
            autoOpen:false,
            modal:true,
            resizable:false,
            buttons:[{
                text:"OK",
                icons: {
                    primary: "ui-icon-check"
                },
                showText: false,
                click:function()
                {
                    $('#taskResult').dialog("close");
                    document.location.reload();
                }
            }]
        });
        $('#taskForm').dialog({
            width:800,
            //height:600,
            autoOpen:false,
            modal:true,
            resizable:false,
            buttons:[{
                text:"speichern",
                icon: "ui-icon-check",
                showLabel: false,
                click:function()
                {
                    $('#taskResult').load("/backend/scheduler/save/",$('#scheduler_form').serializeArray(),function(){
                        $('#taskResult').dialog("open");
                    })
                    $('#taskForm').dialog("close");
                }
            },
            {
                text:"verwerfen",
                                icon:"ui-icon-close",
                showLabel: false,
                click:function(){
                    $('#taskForm').dialog("close");
                }
            }]
        })
/*        $( "#taskForm" ).dialog({
          buttons: [
            {
              text: "speicehrn",
              icons: {
                primary: "ui-icon-heart"
              },
              click: function() {
                $( this ).dialog( "close" );
              }
         
              // Uncommenting the following line would hide the text,
              // resulting in the label being used as a tooltip
            }
          ]
        });*/
        $('.task_edit').click(edit_task);
        $('.newTask').click(newTask);

        $('#userResult').dialog({
            width:800,
            autoOpen:false,
            modal:true,
            resizable:false,
            buttons:[{
                text:"OK",
                icons: {
                    primary: "ui-icon-check"
                },
                showText: false,
                click:function()
                {
                    $('#userResult').dialog("close");
                    document.location.reload();
                }
            }]
        });
        $('#userForm').dialog({
            width:800,
            //height:600,
            autoOpen:false,
            modal:true,
            resizable:false,
            buttons:[{
                text:"speichern",
                icon: {
                        icon:"ui-icon-check"
                                },
                showLabel: false,
                click:function()
                {
                    $.post("/backend/user/save/",$('#user_form').serializeArray(),function(erg){
                        ret=erg.split('|');
                        if(ret[0]==0)
                        {
                                    $('#userForm').dialog("close");
                            $('#userResult').html(ret[1]).dialog("open");
                        }
                        else
                        {
                                $('#userForm').html(ret[1]);
                        }
                    })
                }
            },
            {
                text:"verwerfen",
                                icon:{
                                        icon: "ui-icon-close"
                                },
                showLabel: false,
                click:function(){
                    $('#userForm').dialog("close");
                }
            }]
        })
        $('#userRechteForm').dialog({
            width:800,
            height:600,
            autoOpen:false,
            modal:true,
            resizable:false,
            buttons:[{
                text:"speichern",
                icon: {
                        icon:"ui-icon-check"
                                },
                showLabel: false,
                click:function()
                {
                    $.post("/backend/user_rechte/save/",$('#user_rechte_form').serializeArray(),function(erg){
                        ret=erg.split('|');
                        $('#userResult').html('Benutzerrechte gespeichert').dialog("open");
                            $('#userRechteForm').dialog("close");
                    })
                }
            },
            {
                text:"verwerfen",
                                icon:{
                                        icon: "ui-icon-close"
                                },
                showLabel: false,
                click:function(){
                    $('#userRechteForm').dialog("close");
                }
            }]
        })
        $('.user_edit').click(edit_user).button({
                icons:{
                        primary:"ui-icon-pencil"
                }
        });
        $('.user_del').click(del_user).button({
                icons:{
                        primary:"ui-icon-trash"
                }
        });
        $('.user_rights').click(user_rights).button();
        $('.new_user').click(newUser).button({
                icons:{
                        primary:"ui-icon-plus"
                }
        });
    });
    
        function del_user()
        {
                tIdArr=$(this).attr("id").split("_");
                tId=tIdArr[1];
                $('#userQuestion').load("/backend/user/del/"+tId,function(){
                        $('#userQuestion').dialog("open");
                })
        }
    function newTask(e)
    {
        e.preventDefault();
        url="/backend/scheduler/edit/";
        $.get(url,function(html)
        {
            $('#taskForm').html(html).dialog("open");
        });
    }
    function edit_task(e)
    {
        e.preventDefault();
        tIdArr=$(this).attr("id").split("_");
        tId=tIdArr[1];
        url="/backend/scheduler/edit/"+tId;
        $.get(url,function(html)
        {
            $('#taskForm').html(html).dialog("open");
        });
    }

    function newUser(e)
    {
        e.preventDefault();
        url="/backend/user/edit/";
        $.get(url,function(html)
        {
            $('#userForm').html(html).dialog("open");
        });
    }
    function edit_user(e)
    {
        e.preventDefault();
        if($(this).attr("id")!="edit_self")
        {
                tIdArr=$(this).attr("id").split("_");
                tId=tIdArr[1];
                url="/backend/user/edit/"+tId+"/";
        }
        else
        {
                url="/backend/user/edit_self/";
        }
        $.get(url,function(html)
        {
            $('#userForm').html(html).dialog("open");
        });
    }
    function user_rights(e)
    {
        e.preventDefault();
        tIdArr=$(this).attr("id").split("_");
        tId=tIdArr[1];
        url="/backend/user_rechte/edit/"+tId;
        $.get(url,function(html)
        {
            $('#userRechteForm').html(html).dialog("open");
        });
    }