var mymode=""; var act_func; var act_id; var layout_opt="desktop"; var page_view="getpage.php"; var stream_view="streameditor.php"; var base_script="index.php"; var act_action=""; var selected_image_id=""; var selected_image_name=""; var act_images_list=new Array(); var act_pages_list=new Array(); var default_empty_img='images/nix.gif'; var flg_call=true; var exit_allowed=false; var selected_page_id=""; var sort_edit_mode=""; var showmode="common"; var act_index_id=''; var act_start_id=''; var refresh_self=false; var content_mode='pageview'; var streammodeflg=false; var act_uid=''; var act_name=''; var act_pid=''; var act_paragraph_id=''; var act_container_id=''; var act_visibility_opt=false; var message_out=false; function ajaxCall(ajaxurl,fdata){ if (objectuid) fdata.oid=objectuid; if (parentuid) fdata.pid=parentuid; if (sessionuid) fdata.sid=sessionuid; if (myaction) fdata.action=myaction; fdata.sflag=true; $.ajax({ url: ajaxurl, data: fdata, datatype: "json", type: "POST", success: function(data) { ajaxCallResponse(data); } }); } function ajaxCallResponse(data) { var result = $.parseJSON(data); var parentobj=(null!=opener)?opener:parent; exit_allowed=true; if (result.response=='ok') { if (result.oid) { $("#oid").val(result.oid); } if (mymode=='page'&&act_func=='deletepage'||mymode=='paragraph'&&(act_func=='deleteparagraph'||act_func=='deletecontainer')) { location.reload(); } else { if (result.action=='loadpages') { $('#pagescontent').html(result.html); act_pages_list=result.pageslist; act_index_id=result.indexuid; if (refresh_self) { refresh_self=false; var myid=(act_index_id.length>0)?act_index_id:act_pages_list[0]; $('#pid_'+myid).click(); } set_edit_functions(true); return; } else if (result.action=='setoptions') { return; } else if (result.action=='loadstreamcontent') { if (result.html.length>0) { $('#streamareaid').html(result.html); } else { $('#streamareaid').html($('#nohtmlcontent').html()); } contentobjectvar=result.contentobjectvar; act_content_list=result.contentlist; streammodeflg=true; set_edit_functions(true); return; } else if (result.action=='setproperties') { allowinit=true; init_stream_block(); toggle_streams_properties(); return; } else if (result.action=='getnewpage') { if (result.topicid) { // selected_page_id=result.pageid; $('#pid_'+result.topicid).click(); } return; } if (mymode=='paragraph') { close_modal_window(); show_wait_message(); refresh_only_ng_content(); return; } if (null!=parentobj) { parentobj.location.reload(); } else { show_wait_message(); location.reload(); } } } else if (result.msg=='LoggedIn') { var answer = confirm(unescape('Es ist bereits ein Benutzer mit diesem Namen angemeldet. Mit Klick auf OK wird der andere Benutzer abgemeldet. Dabei gehen seine noch nicht gespeicherten \u00c4nderungen verloren.')); if (answer) { login_opt=true; if (typeof send_prepared_data=='function') send_prepared_data(); } return; } else { if (result.action=='dologin'||result.code=='30003') { if (null!=parentobj) { if(typeof parentobj.remove_session == 'function') { parentobj.remove_session(result.sname); parent.location.reload(); } } else { if(typeof remove_session == 'function') { remove_session(result.sname); location.reload(); } } return; } else if (result.action=='login'&&result.code=='30001'&&result.block>=3) { set_block_mode(); } message_out=true; alert(unescape(result.message)); } } function process_cfunction(what) { if (''==act_sid) { jump_to_startpage(true); return; } var arr = what.split("/"); if (!(arr[0]&&arr[1])) return false; act_func=arr[0]; act_id=arr[1]; var oid=''; var pid=''; var myurl=''; var mode=''; var vartxt=''; switch (act_func) { case 'addpage': pid=act_id; vartxt='Seite im Ordner \''+act_folder_name+'\' neu anlegen'; mode='page'; break; case 'editpage': oid=act_id; vartxt='Seiteneigenschaften editieren'; mode='page'; break; case 'addparagraphtext': pid=act_id; vartxt='JS_ADD_PARAGRAPH_TXT'; mode='paragraph'; break; case 'editparagraph': oid=act_id; vartxt='Absatz editieren'; mode='paragraph'; break; case 'deleteparagraph': var answer = confirm("M\u00f6chtest Du den Absatz wirklich in den Papierkorb verschieben?"); if (answer) { mymode='paragraph'; call_object_function(); return; } break; case 'deletecontainer': var answer = confirm("M\u00f6chtest Du wirklich alle Abs\u00e4tze aus diesem Container in den Papierkorb verschieben?"); if (answer) { mymode='paragraph'; call_object_function(); return; } break; case 'deletepage': var answer = confirm("Bist Du sicher, da\u00df Du die Seite '"+act_page_name+"' in den Papierkorb verschieben m\u00f6chtest?"); if (answer) { mymode='page'; call_object_function(); return; } break; case 'deletepicture': var answer = confirm("Bist Du sicher, da\u00df Du '"+selected_image_name+"' in den Papierkorb verschieben m\u00f6chtest?"); if (answer) { call_object_function(); return; } break; case 'page': if ($('#pid_'+act_id).length>0){ $('#pid_'+act_id).click(); } else { act_func='getnewpage'; act_uid=act_id; call_object_function(); } return; break; case 'topic': // refresh_self=true; $('#pid_'+act_id).click(); return; break; default: alert(act_func + ' => ' + act_id + ' noch nicht implementiert'); return; break; } if (oid||pid) { if (oid) myurl=action_url+'oid='+act_id; else if (pid) myurl=action_url+'pid='+act_id; myurl+='&mode='+mode; if (typeof $('#myIframe').iframeAutoHeight == 'function') { $('#myIframe').remove(); $('#ngcontent').hide(); $('#myIframeContainer').show(); showmode='edit'; $('