Marius Cramer
2015-01-13 9021d7fc7ee308c0df84ad29da0bf316f592ce89
- cleaned up javascript
23 files modified
1613 ■■■■ changed files
interface/lib/classes/listform.inc.php 10 ●●●● patch | view | raw | blame | history
interface/lib/classes/listform_tpl_generator.inc.php 4 ●●●● patch | view | raw | blame | history
interface/lib/classes/tform_tpl_generator.inc.php 2 ●●● patch | view | raw | blame | history
interface/web/admin/software_package_list.php 2 ●●● patch | view | raw | blame | history
interface/web/admin/software_update_list.php 26 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/system_config_branding_edit.html 2 ●●● patch | view | raw | blame | history
interface/web/dns/templates/dns_dmarc_edit.htm 2 ●●● patch | view | raw | blame | history
interface/web/index.php 8 ●●●●● patch | view | raw | blame | history
interface/web/js/scrigo.js.php 641 ●●●●● patch | view | raw | blame | history
interface/web/login/login_as.php 2 ●●● patch | view | raw | blame | history
interface/web/login/logout.php 2 ●●● patch | view | raw | blame | history
interface/web/login/templates/password_reset.htm 2 ●●● patch | view | raw | blame | history
interface/web/monitor/lib/module.conf.php 2 ●●● patch | view | raw | blame | history
interface/web/monitor/show_sys_state.php 86 ●●●● patch | view | raw | blame | history
interface/web/monitor/templates/show_log.htm 2 ●●● patch | view | raw | blame | history
interface/web/monitor/templates/show_sys_state.htm 2 ●●● patch | view | raw | blame | history
interface/web/sites/templates/aps_update_packagelist.htm 2 ●●● patch | view | raw | blame | history
interface/web/sites/templates/backup_stats_list.htm 10 ●●●● patch | view | raw | blame | history
interface/web/themes/default/assets/javascripts/ispconfig.js 709 ●●●●● patch | view | raw | blame | history
interface/web/themes/default/assets/javascripts/ispconfig.min.js 2 ●●● patch | view | raw | blame | history
interface/web/themes/default/assets/javascripts/responsive.js 2 ●●● patch | view | raw | blame | history
interface/web/themes/default/assets/javascripts/responsive.min.js 2 ●●● patch | view | raw | blame | history
interface/web/themes/default/templates/main.tpl.htm 91 ●●●●● patch | view | raw | blame | history
interface/lib/classes/listform.inc.php
@@ -354,23 +354,23 @@
        
        //* Show Back
        if(isset($vars['show_page_back']) && $vars['show_page_back'] == 1){
            $content .= '<li><a href="'."javascript:loadContent('".$vars['list_file'].'?page=0'.$vars['page_params']."');".'" aria-label="First">
            $content .= '<li><a href="#" data-load-content="'.$vars['list_file'].'?page=0'.$vars['page_params'].'" aria-label="First">
            <span aria-hidden="true">&laquo;</span></a></li>';
            $content .= '<li><a href="'."javascript:loadContent('".$vars['list_file'].'?page='.$vars['last_page'].$vars['page_params']."');".'" aria-label="Previous">
            $content .= '<li><a href="#" data-load-content='.$vars['list_file'].'?page='.$vars['last_page'].$vars['page_params'].'" aria-label="Previous">
            <span aria-hidden="true">&lsaquo;</span></a></li>';
        }
        $prev = -1;
        foreach($show_pages as $p) {
            if($prev != -1 && $p > $prev + 1) $content .= '<li class="disabled"><a href="#">…</a></li>';
            $content .= '<li' . ($p == $vars['page'] ? ' class="active"' : '') . '><a href="'."javascript:loadContent('".$vars['list_file'].'?page='.$p.$vars['page_params']."');".'">'. ($p+1) .'</a></li>';
            $content .= '<li' . ($p == $vars['page'] ? ' class="active"' : '') . '><a href="#" data-load-content="'.$vars['list_file'].'?page='.$p.$vars['page_params'].'">'. ($p+1) .'</a></li>';
            $prev = $p;
        }
        //.$vars['next_page'].' '.$this->lng('page_of_txt').' '.$vars['max_pages'].' &nbsp; ';
        //* Show Next
        if(isset($vars['show_page_next']) && $vars['show_page_next'] == 1){
            $content .= '<li><a href="'."javascript:loadContent('".$vars['list_file'].'?page='.$vars['next_page'].$vars['page_params']."');".'" aria-label="Next">
            $content .= '<li><a href="#" data-load-content="'.$vars['list_file'].'?page='.$vars['next_page'].$vars['page_params'].'" aria-label="Next">
            <span aria-hidden="true">&rsaquo;</span></a></li>';
            $content .= '<li><a href="'."javascript:loadContent('".$vars['list_file'].'?page='.$vars['pages'].$vars['page_params']."');".'" aria-label="Last">
            $content .= '<li><a href="#" data-load-content="'.$vars['list_file'].'?page='.$vars['pages'].$vars['page_params'].'" aria-label="Last">
            <span aria-hidden="true">&raquo;</span></a></li>';
        }
        $content .= '</ul></nav>';
interface/lib/classes/listform_tpl_generator.inc.php
@@ -44,7 +44,7 @@
  <div class="pnl_toolsarea">
    <fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
      <div class="buttons">
        <button class="iconstxt icoAdd" type="button" onclick="'."loadContent('".$module."/".$listDef["edit_file"]."');".'">
        <button class="iconstxt icoAdd" type="button" data-load-content="'.$module."/".$listDef["edit_file"].'">
          <span>{tmpl_var name="add_new_record_txt"}</span>
        </button>
      </div>
@@ -91,7 +91,7 @@
        foreach($listDef["item"] as $field) {
            $key = $field["field"];
            $html .= "            <td class=\"tbl_col_".$key."\"><a href=\"#\" onclick=\"loadContent('".$module."/".$listDef["edit_file"]."?id={tmpl_var name='id'}');\">{tmpl_var name=\"".$key."\"}</a></td>\n";
            $html .= "            <td class=\"tbl_col_".$key."\"><a href=\"#\" data-load-content=\"".$module."/".$listDef["edit_file"]."?id={tmpl_var name='id'}\">{tmpl_var name=\"".$key."\"}</a></td>\n";
        }
        $html .= "            <td class=\"tbl_col_buttons\">
interface/lib/classes/tform_tpl_generator.inc.php
@@ -137,7 +137,7 @@
    <div class=\"buttonHolder buttons\">
      <button class=\"positive iconstxt icoPositive\" type=\"button\" value=\"{tmpl_var name='btn_save_txt'}\" onclick=\"submitForm('pageForm','".$module."/".$formDef["action"]."');\"><span>{tmpl_var name='btn_save_txt'}</span></button>
      <button class=\"negative iconstxt icoNegative\" type=\"button\" value=\"{tmpl_var name='btn_cancel_txt'}\" onclick=\"loadContent('".$module."/".$formDef["list_default"]."');\"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
      <button class=\"negative iconstxt icoNegative\" type=\"button\" value=\"{tmpl_var name='btn_cancel_txt'}\" data-load-content=\"".$module."/".$formDef["list_default"]."\"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
interface/web/admin/software_package_list.php
@@ -165,7 +165,7 @@
                if($p['package_installable'] == 'no') {
                    $installed_txt .= $s['server_name'].": ".$app->lng("Package can not be installed.")."<br />";
                } else {
                    $installed_txt .= $s['server_name'].": <a href=\"#\" onclick=\"loadContent('admin/software_package_install.php?package=".$p["package_name"]."&server_id=".$s["server_id"]."');\">Install now</a><br />";
                    $installed_txt .= $s['server_name'].": <a href=\"#\" data-load-content=\"admin/software_package_install.php?package=".$p["package_name"]."&server_id=".$s["server_id"]."\">Install now</a><br />";
                }
            }
        }
interface/web/admin/software_update_list.php
@@ -176,37 +176,13 @@
            foreach($updates as $key => $u) {
                $version = $u['v1'].'.'.$u['v2'].'.'.$u['v3'].'.'.$u['v4'];
                $installed_txt = "<a href=\"#\" onclick=\"loadContent('admin/software_update_list.php?action=install&package=".$u["package_name"]."&id=".$u["software_update_id"]."&server_id=".$server_id."');\">Install Update</a><br />";
                $installed_txt = "<a href=\"#\" data-load-content=\"admin/software_update_list.php?action=install&package=".$u["package_name"]."&id=".$u["software_update_id"]."&server_id=".$server_id."\">Install Update</a><br />";
                $records_out[] = array('version' => $version, 'update_title' => $u["update_title"], 'installed' => $installed_txt);
            }
        }
    }
}
/*
$updates = $app->db->queryAllRecords('SELECT software_update.update_title, software_update.software_update_id, software_update.package_name, v1, v2, v3, v4, software_update_inst.status
        FROM software_update LEFT JOIN software_update_inst ON ( software_update.software_update_id = software_update_inst.software_update_id )
        WHERE server_id = '.$server_id.'
        GROUP BY software_update.package_name
        ORDER BY software_update.package_name ASC, v1 DESC , v2 DESC , v3 DESC , v4 DESC');
if(is_array($updates)) {
    foreach($updates as $key => $u) {
        $installed_txt = '';
        $version = $u['v1'].'.'.$u['v2'].'.'.$u['v3'].'.'.$u['v4'];
        $updates[$key]['version'] = $version;
        if($u['status'] == 'installed' || $u['status'] == 'installing' || $u['status'] == 'deleting') {
            $installed_txt .= "Installed version $version<br />";
        } else {
            $installed_txt .= "<a href=\"#\" onclick=\"loadContent('admin/software_update_list.php?action=install&package=".$u["package_name"]."&id=".$u["software_update_id"]."&server_id=".$server_id."');\">Install now</a><br />";
        }
        $updates[$key]['installed'] = $installed_txt;
    }
}
*/
interface/web/admin/templates/system_config_branding_edit.html
@@ -15,7 +15,7 @@
        <input type="hidden" name="id" value="{tmpl_var name='id'}">
        <div class="buttonHolder buttons">
            <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/server_list.php"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
        </div>
    </div>
    
interface/web/dns/templates/dns_dmarc_edit.htm
@@ -92,7 +92,7 @@
            
        <div class="buttonHolder buttons">
            <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="dns/dns_dmarc_edit.php"><span>{tmpl_var name='btn_save_txt'}</span></button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('dns/dns_soa_edit.php?id={tmpl_var name='zone'}');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="dns/dns_soa_edit.php?id={tmpl_var name='zone'}"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
        </div>
    </div>
  
interface/web/index.php
@@ -51,6 +51,14 @@
    $app->tpl->setVar('global_tabchange_discard_txt', $app->lng('global_tabchange_discard_txt'));
}
if($sys_config['use_loadindicator'] == 'y') {
    $app->tpl->setVar('use_loadindicator', 'y');
}
if($sys_config['use_combobox'] == 'y') {
    $app->tpl->setVar('use_combobox', 'y');
}
if(isset($_SESSION['show_info_msg'])) {
    $app->tpl->setVar('show_info_msg', $_SESSION['show_info_msg']);
    unset($_SESSION['show_info_msg']);
interface/web/js/scrigo.js.php
@@ -9,533 +9,6 @@
$server_config_array = $app->getconf->get_global_config();
?>
var ISPConfig = {
    pageFormChanged: false,
    tabChangeWarningTxt: '',
    tabChangeDiscardTxt: '',
    tabChangeWarning: false,
    tabChangeDiscard: false,
    requestsRunning: 0,
    indicatorPaddingH: -1,
    indicatorPaddingW: -1,
    indicatorCompleted: false,
    registeredHooks: new Array(),
    redirect: '',
    reportError: function(request) {
        /* Error reporting is disabled by default as some browsers like safari
           sometimes throw errors when a ajax request is delayed even if the
           ajax request worked. */
        /*alert(request);*/
    },
    registerHook: function(name, callback) {
        if(!registeredHooks[name]) registeredHooks[name] = new Array();
        var newindex = registeredHooks[name].length;
        registeredHooks[name][newindex] = callback;
    },
    callHook: function(name, params) {
        if(!registeredHooks[name]) return;
        for(var i = 0; i < registeredHooks[name].length; i++) {
            var callback = registeredHooks[name][i];
            callback(name, params);
        }
    },
    resetFormChanged: function() {
        pageFormChanged = false;
    },
    showLoadIndicator: function() {
        document.body.style.cursor = 'wait';
<?php
if($server_config_array['misc']['use_loadindicator'] == 'y'){
?>
    requestsRunning += 1;
    if(requestsRunning < 2) {
        var indicator = jQuery('#ajaxloader');
        if(indicator.length < 1) {
            indicator = jQuery('<div id="ajaxloader" style="display: none;"></div>');
            indicator.appendTo('body');
        }
        var parent = jQuery('#content');
        if(parent.length < 1) return;
        indicatorCompleted = false;
        var atx = parent.offset().left + 150; //((parent.outerWidth(true) - indicator.outerWidth(true)) / 2);
        var aty = parent.offset().top + 150;
        indicator.css( {'left': atx, 'top': aty } ).fadeIn('fast', function() {
            // check if loader should be hidden immediately
            indicatorCompleted = true;
            if(requestsRunning < 1) $(this).fadeOut('fast', function() { $(this).hide();});
        });
    }
<?php
}
?>
    },
    hideLoadIndicator: function() {
        document.body.style.cursor = '';
        requestsRunning -= 1;
        if(requestsRunning < 1) {
            requestsRunning = 0; // just for the case...
            if(indicatorCompleted == true) jQuery('#ajaxloader').fadeOut('fast', function() { jQuery('#ajaxloader').hide(); } );
        }
    }
    onAfterSideNavLoaded: function() {
    <?php
if($server_config_array['misc']['use_combobox'] == 'y'){
?>
        $('#sidebar').find("select:not(.chosen-select)").select2({
            placeholder: '',
            width: 'element',
            selectOnBlur: true,
            allowClear: true,
        });
<?php
}
?>
    },
    onAfterContentLoad: function(url, data) {
        if(!data) data = '';
        else data = '&' + data;
<?php
if($server_config_array['misc']['use_combobox'] == 'y'){
?>
        $('#pageContent').find("select:not(.chosen-select)").select2({
            placeholder: '',
            width: 'element',
            selectOnBlur: true,
            allowClear: true,
            formatResult: function(o) {
                if(o.id && $(o.element).parent().hasClass('flags')) return '<span class="flags flag-' + o.id.toLowerCase() + '">' + o.text + '</span>';
                else return o.text;
            },
            formatSelection: function(o) {
                if(o.id && $(o.element).parent().hasClass('flags')) return '<span class="flags flag-' + o.id.toLowerCase() + '">' + o.text + '</span>';
                else return o.text;
            }
        }).on('change', function(e) {
            if (jQuery("#pageForm .table #Filter").length > 0) {
                jQuery("#pageForm .table #Filter").trigger('click');
            }
        });
        /* TODO: find a better way! */
        //$('.chosen-select').chosen({no_results_text: "<?php echo $wb['globalsearch_noresults_text_txt']; ?>", width: '300px'});
<?php
}
?>
        callHook('onAfterContentLoad', {'url': url, 'data': data });
    },
    /* THIS ONE SHOULD BE REMOVED AFTER CREATING THE STATIC LOGIN PAGE!!! */
    submitLoginForm: function(formname) {
        //* Validate form. TODO: username and password with strip();
        var frm = document.getElementById(formname);
        var userNameObj = frm.username;
        if(userNameObj.value == ''){
            userNameObj.focus();
            return;
        }
        var passwordObj = frm.passwort;
        if(passwordObj.value == ''){
            passwordObj.focus();
            return;
        }
        $('#dummy_username').val(userNameObj.value);
        $('#dummy_passwort').val(passwordObj.value);
        $('#dummy_login_form').submit();
        var submitFormObj = jQuery.ajax({
            type: "POST",
            url: "content.php",
            data: jQuery('#'+formname).serialize(),
            dataType: "html",
            beforeSend: function() {
                showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                    var parts = jqXHR.responseText.split(':');
                    //alert(parts[1]);
                    loadContent(parts[1]);
                    //redirect = parts[1];
                    //window.setTimeout('loadContent(redirect)', 1000);
                } else if (jqXHR.responseText.indexOf('LOGIN_REDIRECT:') > -1) {
                    // Go to the login page
                    document.location.href = 'index.php';
                } else {
                    jQuery('#pageContent').html(jqXHR.responseText);
                    onAfterContentLoad('content.php', jQuery('#'+formname).serialize());
                    pageFormChanged = false;
                }
                loadMenus();
                hideLoadIndicator();
            },
            error: function() {
                hideLoadIndicator();
                reportError('Ajax Request was not successful.110');
            }
        });
    },
    submitForm: function(formname, target, confirmation) {
        var successMessage = arguments[3];
        if(!confirmation) confirmation = false;
        if(!confirmation || window.confirm(confirmation)) {
            var submitFormObj = jQuery.ajax({
                type: "POST",
                url: target,
                data: jQuery('#'+formname).serialize(),
                dataType: "html",
                beforeSend: function() {
                    showLoadIndicator();
                },
                success: function(data, textStatus, jqXHR) {
                    if(successMessage) alert(successMessage);
                    if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                        var parts = jqXHR.responseText.split(':');
                        //alert(parts[1]);
                        loadContent(parts[1]);
                        //redirect = parts[1];
                        //window.setTimeout('loadContent(redirect)', 1000);
                    } else {
                        jQuery('#pageContent').html(jqXHR.responseText);
                        onAfterContentLoad(target, jQuery('#'+formname).serialize());
                        pageFormChanged = false;
                    }
                    hideLoadIndicator();
                },
                error: function(jqXHR, textStatus, errorThrown) {
                    hideLoadIndicator();
                    var parts = jqXHR.responseText.split(':');
                    reportError('Ajax Request was not successful. 111');
                }
            });
        }
    },
    submitUploadForm: function(formname, target) {
        var handleResponse = function(loadedFrame) {
            var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML;
            try {
                response = JSON.parse(responseStr);
            } catch(e) {
                response = responseStr;
            }
            var msg = '';
            var okmsg = jQuery('#OKMsg',response).html();
            if(okmsg){
                msg = '<div id="OKMsg">'+okmsg+'</div>';
            }
            var errormsg = jQuery('#errorMsg',response).html();
            if(errormsg){
                msg = msg+'<div id="errorMsg">'+errormsg+'</div>';
            }
            return msg;
        };
        var frame_id = 'ajaxUploader-iframe-' + Math.round(new Date().getTime() / 1000);
        jQuery('body').after('<iframe width="0" height="0" style="display:none;" name="'+frame_id+'" id="'+frame_id+'"/>');
        jQuery('input[type="file"]').closest("form").attr({target: frame_id, action: target}).submit();
        jQuery('#'+frame_id).load(function() {
            var msg = handleResponse(this);
            jQuery('#errorMsg').remove();
            jQuery('#OKMsg').remove();
            jQuery('input[name="id"]').before(msg);
            jQuery(this).remove();
          });
    },
    function capp(module, redirect) {
        var submitFormObj = jQuery.ajax({
            type: "GET",
            url: "capp.php",
            data: "mod="+module+((redirect != undefined) ? '&redirect='+redirect : ''),
            dataType: "html",
            beforeSend: function() {
                showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText != '') {
                    if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                        var parts = jqXHR.responseText.split(':');
                        loadContent(parts[1]);
                    } else if (jqXHR.responseText.indexOf('URL_REDIRECT:') > -1) {
                        var newUrl= jqXHR.responseText.substr(jqXHR.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length);
                        document.location.href = newUrl;
                    } else {
                        //alert(jqXHR.responseText);
                    }
                }
                loadMenus();
                hideLoadIndicator();
            },
            error: function() {
                hideLoadIndicator();
                reportError('Ajax Request was not successful.'+module);
            }
        });
    },
    loadContent: function(pagename) {
        var params = arguments[1];
        var pageContentObject2 = jQuery.ajax({
            type: "GET",
            url: pagename,
            data: (params ? params : null),
            dataType: "html",
            beforeSend: function() {
                showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                    var parts = jqXHR.responseText.split(':');
                    loadContent(parts[1]);
                } else if (jqXHR.responseText.indexOf('URL_REDIRECT:') > -1) {
                    var newUrl= jqXHR.responseText.substr(jqXHR.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length);
                    document.location.href = newUrl;
                } else {
                    //document.getElementById('pageContent').innerHTML = jqXHR.responseText;
                    //var reponse = jQuery(jqXHR.responseText);
                    //var reponseScript = reponse.filter("script");
                    //jQuery.each(reponseScript, function(idx, val) { eval(val.text); } );
                    jQuery('#pageContent').html(jqXHR.responseText);
                    onAfterContentLoad(pagename, (params ? params : null));
                    pageFormChanged = false;
                }
                hideLoadIndicator();
            },
            error: function() {
                hideLoadIndicator();
                reportError('Ajax Request was not successful. 113');
            }
        });
    },
    loadContentRefresh: function(pagename) {
        if($('#refreshinterval').val() > 0) {
            var pageContentObject2 = jQuery.ajax({
                type: "GET",
                url: pagename,
                data: "refresh="+document.getElementById('refreshinterval').value,
                dataType: "html",
                beforeSend: function() {
                    showLoadIndicator();
                },
                success: function(data, textStatus, jqXHR) {
                    hideLoadIndicator();
                    jQuery('#pageContent').html(jqXHR.responseText);
                    onAfterContentLoad(pagename, "refresh="+document.getElementById('refreshinterval').value);
                    pageFormChanged = false;
                },
                error: function() {
                    hideLoadIndicator();
                    reportError('Ajax Request was not successful.'+pagename);
                }
            });
            setTimeout( "ISPConfig.loadContentRefresh('"+pagename+"&refresh="+document.getElementById('refreshinterval').value+"')", document.getElementById('refreshinterval').value*1000*60 );
        }
    },
    loadInitContent: function() {
        var pageContentObject = jQuery.ajax({
            type: "GET",
            url: "content.php",
            data: "s_mod=login&s_pg=index",
            dataType: "html",
            beforeSend: function() {
                showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                    var parts = jqXHR.responseText.split(":");
                    loadContent(parts[1]);
                } else {
                    jQuery('#pageContent').html(jqXHR.responseText);
                    onAfterContentLoad('content.php', "s_mod=login&s_pg=index");
                    pageFormChanged = false;
                }
                hideLoadIndicator();
            },
            error: function() {
                hideLoadIndicator();
                reportError('Ajax Request was not successful. 114');
            }
        });
        loadMenus();
        keepalive();
        setTimeout(function() {
            try {
                jQuery('form#pageForm').find('input[name="username"]').focus();
            } catch (e) {
            }
        }, 1000);
    },
    loadMenus: function() {
        var sideNavObject = jQuery.ajax({
            type: "GET",
            url: "nav.php",
            data: "nav=side",
            dataType: "html",
            beforeSend: function() {
                showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                hideLoadIndicator();
                jQuery('#sidebar').html(jqXHR.responseText);
                onAfterSideNavLoaded();
                loadPushyMenu();
            },
            error: function() {
                hideLoadIndicator();
                reportError('Ajax Request was not successful. 115');
            }
        });
        var topNavObject = jQuery.ajax({
            type: "GET",
            url: "nav.php",
            data: "nav=top",
            dataType: "html",
            beforeSend: function() {
                showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                hideLoadIndicator();
                jQuery('#topnav-container').html(jqXHR.responseText);
                loadPushyMenu();
            },
            error: function(o) {
                hideLoadIndicator();
                reportError('Ajax Request was not successful. 116');
            }
        });
    },
    changeTab: function(tab, target, force) {
        if(requestsRunning > 0) return false;
        document.pageForm.next_tab.value = tab;
        var idel = jQuery('form#pageForm').find('[name="id"]');
        var id = null;
        if(idel.length > 0) id = idel.val();
        if(tabChangeDiscard == 'y' && !force) {
            if((idel.length < 1 || id) && (pageFormChanged == false || window.confirm(tabChangeDiscardTxt))) {
                var next_tab = tab;
                if(id) loadContent(target, {'next_tab': next_tab, 'id': id});
                else loadContent(target, {'next_tab': next_tab});
            } else {
                return false;
            }
        } else {
            if(id && tabChangeWarning == 'y' && pageFormChanged == true) {
                if(window.confirm(tabChangeWarningTxt)) {
                    submitForm('pageForm', target);
                } else {
                    var next_tab = tab;
                    if(id) loadContent(target, {'next_tab': next_tab, 'id': id});
                    else loadContent(target, {'next_tab': next_tab});
                }
            } else {
                submitForm('pageForm',target);
            }
        }
    },
function del_record(link,confirmation) {
  if(window.confirm(confirmation)) {
          loadContent(link);
  }
}
function confirm_action(link,confirmation) {
  if(window.confirm(confirmation)) {
          loadContent(link);
  }
}
function loadContentInto(elementid,pagename) {
  var pageContentObject2 = jQuery.ajax({    type: "GET",
                                            url: pagename,
                                            dataType: "html",
                                            beforeSend: function() {
//                                                showLoadIndicator();
                                            },
                                            success: function(data, textStatus, jqXHR) {
//                                                hideLoadIndicator();
                                                jQuery('#'+elementid).html(jqXHR.responseText);
                                            },
                                            error: function() {
//                                                hideLoadIndicator();
                                                reportError('Ajax Request was not successful. 118');
                                            }
                                        });
}
function loadOptionInto(elementid,pagename) {
    var pageContentObject2 = jQuery.ajax({    type: "GET",
                                            url: pagename,
                                            dataType: "html",
                                            beforeSend: function() {
//                                                showLoadIndicator();
                                            },
                                            success: function(data, textStatus, jqXHR) {
//                                                hideLoadIndicator();
                                                var teste = jqXHR.responseText;
                                                var elemente = teste.split('#');
                                                el=document.getElementById(elementid);
                                                el.innerHTML='';
                                                for (var i = 0; i < elemente.length; ++i){
                                                    var foo2 = document.createElement("option");
                                                    foo2.appendChild(document.createTextNode(elemente[i]));
                                                    foo2.value=elemente[i];
                                                    el.appendChild(foo2);
                                                }
                                            },
                                            error: function() {
//                                                hideLoadIndicator();
                                                reportError('Ajax Request was not successful. 119');
                                            }
                                        });
}
function keepalive() {
    var pageContentObject3 = jQuery.ajax({    type: "GET",
                                            url: "keepalive.php",
                                            dataType: "html",
                                            success: function(data, textStatus, jqXHR) {
                                                setTimeout( keepalive, 1000000 );
                                            },
                                            error: function() {
                                                reportError('Session expired. Please login again.');
                                            }
                                        });
      //setTimeout( keepalive, 1000000 );
}
<?php
$min_password_length = 5;
if(isset($server_config_array['misc']['min_password_length'])) {
@@ -672,82 +145,7 @@
    return false;
}
var new_tpl_add_id = 0;
function addAdditionalTemplate(){
    var tpl_add = jQuery('#template_additional').val();
    var addTemplate = jQuery('#tpl_add_select').val().split('|',2);
    var addTplId = addTemplate[0];
    var addTplText = addTemplate[1];
    if(addTplId > 0) {
        var newVal = tpl_add.split('/');
        new_tpl_add_id += 1;
        var delbtn = jQuery('<a href="#"></a>').attr('class', 'button icons16 icoDelete').click(function(e) {
            e.preventDefault();
            delAdditionalTemplate($(this).parent().attr('rel'));
        });
        newVal[newVal.length] = 'n' + new_tpl_add_id + ':' + addTplId;
        jQuery('<li>' + addTplText + '</li>').attr('rel', 'n' + new_tpl_add_id).append(delbtn).appendTo('#template_additional_list ul');
        jQuery('#template_additional').val(newVal.join('/'));
        alert('additional template ' + addTplText + ' added to customer');
    } else {
        alert('no additional template selcted');
    }
}
function delAdditionalTemplate(tpl_id){
    var tpl_add = jQuery('#template_additional').val();
    if(tpl_id) {
        // new style
        var $el = jQuery('#template_additional_list ul').find('li[rel="' + tpl_id + '"]').eq(0); // only the first
        var addTplText = $el.text();
        $el.remove();
        var oldVal = tpl_add.split('/');
        var newVal = new Array();
        for(var i = 0; i < oldVal.length; i++) {
            var tmp = oldVal[i].split(':', 2);
            if(tmp.length == 2 && tmp[0] == tpl_id) continue;
            newVal[newVal.length] = oldVal[i];
        }
        jQuery('#template_additional').val(newVal.join('/'));
        alert('additional template ' + addTplText + ' deleted from customer');
    } else if(tpl_add != '') {
        // old style
        var addTemplate = document.getElementById('tpl_add_select').value.split('|',2);
        var addTplId = addTemplate[0];
        var addTplText = addTemplate[1];
        jQuery('#template_additional_list ul').find('li:not([rel])').each(function() {
            var text = jQuery(this).text();
            if(text == addTplText) {
                jQuery(this).remove();
                return false;
            }
            return this;
        });
        var newVal = tpl_add;
        var repl = new RegExp('(^|\/)' + addTplId + '(\/|$)');
        newVal = newVal.replace(repl, '');
        newVal = newVal.replace('//', '/');
        jQuery('#template_additional').val(newVal);
        alert('additional template ' + addTplText + ' deleted from customer');
  } else {
      alert('no additional template selcted');
  }
}
function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}
function password(minLength, special, num_special){
    minLength = minLength || 10;
@@ -839,42 +237,3 @@
function getRandomInt(min, max){
    return Math.floor(Math.random() * (max - min + 1)) + min;
}
jQuery(document).on("click", ".addPlaceholder", function(){
    var placeholderText = jQuery(this).text();
    var template = jQuery(this).siblings(':input');
    template.insertAtCaret(placeholderText);
});
jQuery(document).on("click", ".addPlaceholderContent", function(){
    var placeholderContentText = jQuery(this).find('.addPlaceholderContent').text();
    var template2 = jQuery(this).siblings(':input');
    template2.insertAtCaret(placeholderContentText);
});
jQuery.fn.extend({
    insertAtCaret: function(myValue){
        return this.each(function(i) {
            if (document.selection) {
                //For browsers like Internet Explorer
                this.focus();
                sel = document.selection.createRange();
                sel.text = myValue;
                this.focus();
            } else if (this.selectionStart || this.selectionStart == '0') {
                //For browsers like Firefox and Webkit based
                var startPos = this.selectionStart;
                var endPos = this.selectionEnd;
                var scrollTop = this.scrollTop;
                this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length);
                this.focus();
                this.selectionStart = startPos + myValue.length;
                this.selectionEnd = startPos + myValue.length;
                this.scrollTop = scrollTop;
            } else {
                this.value += myValue;
                this.focus();
            }
        })
    }
});
interface/web/login/login_as.php
@@ -98,7 +98,7 @@
    <input type="hidden" name="s_pg" value="index" />
    <div class="wf_actions buttons">
      <button class="positive iconstxt icoPositive" type="button" value="'.$wb['btn_yes_txt'].'" onclick="submitLoginForm(' . "'pageForm'" . ');"><span>'.$wb['btn_yes_txt'].'</span></button>
      <button class="negative iconstxt icoNegative" type="button" value="'.$wb['btn_back_txt'].'" onclick="loadContent('. "'$backlink'" . ');"><span>'.$wb['btn_back_txt'].'</span></button>
      <button class="negative iconstxt icoNegative" type="button" value="'.$wb['btn_back_txt'].'" data-load-content="'.$backlink.'"><span>'.$wb['btn_back_txt'].'</span></button>
    </div>
';
?>
interface/web/login/logout.php
@@ -54,7 +54,7 @@
        <input type="hidden" name="s_pg" value="index" />
        <div class="wf_actions buttons">
          <button class="positive iconstxt icoPositive" type="button" value="Yes, re-login as ' . $utype . '" onclick="submitLoginForm(' . "'pageForm'" . ');"><span>Yes, re-login as ' . $utype . '</span></button>
          <button class="negative iconstxt icoNegative" type="button" value="No, logout" onclick="loadContent('. "'login/logout.php?l=1'" . ');"><span>No, logout</span></button>
          <button class="negative iconstxt icoNegative" type="button" value="No, logout" data-load-content="login/logout.php?l=1"><span>No, logout</span></button>
        </div>
    ';
    exit;
interface/web/login/templates/password_reset.htm
@@ -27,7 +27,7 @@
        <div class="clear"><div class="right">
            <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='pw_button_txt'}" data-submit-form="pageForm" data-form-action="login/password_reset.php">{tmpl_var name='pw_button_txt'}</button>
            <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='back_txt'}" onclick="loadInitContent();">{tmpl_var name='back_txt'}</button>
            <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='back_txt'}" onclick="ISPConfig.loadInitContent();">{tmpl_var name='back_txt'}</button>
        </div></div>
    </div>
interface/web/monitor/lib/module.conf.php
@@ -37,7 +37,7 @@
$servers = $app->db->queryAllRecords("SELECT server_id, server_name FROM server order by server_name");
$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_sys_state.php?state=server&server=' + document.getElementById('server_id').value);\">";
$dropDown = "<select id='server_id' onchange=\"ISPConfig.loadContent('monitor/show_sys_state.php?state=server&server=' + document.getElementById('server_id').value);\">";
foreach ($servers as $server)
{
    $dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>";
interface/web/monitor/show_sys_state.php
@@ -287,8 +287,8 @@
    /*
     * The normal info also needs a link to the verbose info
    */
    $html_ve .= "<a href='#' onclick='loadContent(\"monitor/show_sys_state.php?state=server&server=" . $serverId . '|' . $serverName . "\");'>" . $app->lng("monitor_serverstate_moreinfo_txt") . "</a>";
    $html_server .= "<a href='#' onclick='loadContent(\"monitor/show_sys_state.php?state=server&server=" . $serverId . '|' . $serverName . "\");'>" . $app->lng("monitor_serverstate_moreinfo_txt") . "</a>";
    $html_ve .= "<a href='#' data-load-content='monitor/show_sys_state.php?state=server&server=" . $serverId . '|' . $serverName . "'>" . $app->lng("monitor_serverstate_moreinfo_txt") . "</a>";
    $html_server .= "<a href='#' data-load-content='monitor/show_sys_state.php?state=server&server=" . $serverId . '|' . $serverName . "'>" . $app->lng("monitor_serverstate_moreinfo_txt") . "</a>";
    /*
     * Finish all html's
@@ -341,28 +341,28 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_hdok_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=disk_usage'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'info':
            $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_hdgoingfull_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=disk_usage'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'warning':
            $messages[$app->lng("monitor_serverstate_listwarning_txt")][] = $app->lng("monitor_serverstate_hdnearlyfull_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=disk_usage'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'critical':
            $messages[$app->lng("monitor_serverstate_listcritical_txt")][] = $app->lng("monitor_serverstate_hdveryfull_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=disk_usage'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'error':
            $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_hdfull_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=disk_usage'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_hdunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=disk_usage\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=disk_usage'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
@@ -373,27 +373,27 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_loadok_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=server_load'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'info':
            $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_loadheavy_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=server_load'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'warning':
            $messages[$app->lng("monitor_serverstate_listwarning_txt")][] = $app->lng("monitor_serverstate_loadhigh_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=server_load'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'critical':
            $messages[$app->lng("monitor_serverstate_listcritical_txt")][] = $app->lng("monitor_serverstate_loadhigher_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=server_load'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'error':
            $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_loadhighest_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=server_load'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_loadunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=server_load\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=server_load'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
@@ -401,16 +401,16 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_servicesonline_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=services\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=services'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'error':
            $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_servicesoffline_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=services\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=services'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_servicesunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=services\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=services'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
@@ -418,12 +418,12 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_updatesok_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=system_update\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=system_update'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'info':
            $messages[$app->lng("monitor_serverstate_listwarning_txt")][] = $app->lng("monitor_serverstate_updatesneeded_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=system_update\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=system_update'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'no_state':
            /*
@@ -432,7 +432,7 @@
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_updatesunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=system_update\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=system_update'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
@@ -441,19 +441,19 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_raidok_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=raid_state\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=raid_state'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'info':
            $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_raidresync_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=raid_state\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=raid_state'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'critical':
            $messages[$app->lng("monitor_serverstate_listcritical_txt")][] = $app->lng("monitor_serverstate_raidfault_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=raid_state\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=raid_state'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'error':
            $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_raiderror_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=raid_state\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=raid_state'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'no_state':
            /*
@@ -462,7 +462,7 @@
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_raidunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=raid_state\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=raid_state'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
@@ -474,23 +474,23 @@
    //  switch ($record['state']) {
    //   case 'ok':
    //    $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_beancounterok_txt") . ' ' .
    //      "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //      "<a href='#' data-load-content='monitor/show_data.php?type=openvz_beancounter'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //    break;
    //   case 'info':
    //    $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_beancounterinfo_txt") . ' ' .
    //      "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //      "<a href='#' data-load-content='monitor/show_data.php?type=openvz_beancounter'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //    break;
    //   case 'warning':
    //    $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_beancounterwarning_txt") . ' ' .
    //      "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //      "<a href='#' data-load-content='monitor/show_data.php?type=openvz_beancounter'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //    break;
    //   case 'critical':
    //    $messages[$app->lng("monitor_serverstate_listcritical_txt")][] = $app->lng("monitor_serverstate_beancountercritical_txt") . ' ' .
    //      "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //      "<a href='#' data-load-content='monitor/show_data.php?type=openvz_beancounter'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //    break;
    //   case 'error':
    //    $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_beancountererror_txt") . ' ' .
    //      "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=openvz_beancounter\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //      "<a href='#' data-load-content='monitor/show_data.php?type=openvz_beancounter'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
    //    break;
    //   default:
    //    break;
@@ -502,27 +502,27 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_mailqok_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=mailq\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=mailq'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'info':
            $messages[$app->lng("monitor_serverstate_listinfo_txt")][] = $app->lng("monitor_serverstate_mailqheavy_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=mailq\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=mailq'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'warning':
            $messages[$app->lng("monitor_serverstate_listwarning_txt")][] = $app->lng("monitor_serverstate_mailqhigh_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=mailq\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=mailq'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'critical':
            $messages[$app->lng("monitor_serverstate_listcritical_txt")][] = $app->lng("monitor_serverstate_mailqhigher_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=mailq\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=mailq'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'error':
            $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_mailqhighest_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=mailq\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=mailq'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_mailqunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_data.php?type=mailq\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_data.php?type=mailq'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
@@ -531,19 +531,19 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_syslogok_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/log_list.php'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'warning':
            $messages[$app->lng("monitor_serverstate_listwarning_txt")][] = $app->lng("monitor_serverstate_syslogwarning_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/log_list.php'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'error':
            $messages[$app->lng("monitor_serverstate_listerror_txt")][] = $app->lng("monitor_serverstate_syslogerror_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/log_list.php'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_syslogunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/log_list.php'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
@@ -556,15 +556,15 @@
        switch ($record['state']) {
        case 'ok':
            $messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_fclamok_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_log.php?log=log_freshclam\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_log.php?log=log_freshclam'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        case 'info':
            $messages[$app->lng("monitor_serverstate_listwarning_txt")][] = $app->lng("monitor_serverstate_fclamoutdated_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_log.php?log=log_freshclam\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_log.php?log=log_freshclam'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        default:
            $messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_fclamunknown_txt") . ' ' .
                "<a href='#' onclick='loadContent(\"monitor/show_log.php?log=log_freshclam\");'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
                "<a href='#' data-load-content='monitor/show_log.php?log=log_freshclam'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
            break;
        }
    }
interface/web/monitor/templates/show_log.htm
@@ -8,7 +8,7 @@
            
                <div class="form-group">
                    <label for="refreshinterval" class="col-sm-3 control-label">{tmpl_var name='refreshinterval_txt'}</label>
                    <div class="col-sm-9"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="loadContentRefresh('monitor/show_log.php?log={tmpl_var name="log_id"}')">
                    <div class="col-sm-9"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="ISPConfig.loadContentRefresh('monitor/show_log.php?log={tmpl_var name="log_id"}')">
                        {tmpl_var name='refresh'}
                    </select></div>
                
interface/web/monitor/templates/show_sys_state.htm
@@ -8,7 +8,7 @@
            
                <div class="form-group">
                    <label for="refreshinterval" class="col-sm-3 control-label">&nbsp;</label>
                    <div class="col-sm-9"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="loadContentRefresh('monitor/show_sys_state.php?state={tmpl_var name="state_type"}')">
                    <div class="col-sm-9"><select name="refreshinterval" id="refreshinterval" class="form-control" onChange="ISPConfig.loadContentRefresh('monitor/show_sys_state.php?state={tmpl_var name="state_type"}')">
                        {tmpl_var name='refresh'}
                    </select></div>
                
interface/web/sites/templates/aps_update_packagelist.htm
@@ -7,6 +7,6 @@
        <legend>{tmpl_var name="legend_txt"}</legend>
            
            <div class="clear"><div class="right">
            <button class="btn btn-default formbutton-success" type="button" value="Update Packagelist" onClick="loadContent('sites/aps_cron_apscrawler_if.php')">{tmpl_var name="btn_start_txt"}</button>
            <button class="btn btn-default formbutton-success" type="button" value="Update Packagelist" data-load-content="sites/aps_cron_apscrawler_if.php">{tmpl_var name="btn_start_txt"}</button>
            <button class="btn btn-default formbutton-default" type="button" value="Cancel" data-load-content="sites/aps_availablepackages_list.php">{tmpl_var name="btn_cancel_txt"}</button>
        </div></div>
interface/web/sites/templates/backup_stats_list.htm
@@ -17,11 +17,11 @@
                <tbody>
                    <tmpl_loop name="records">
                    <tr class="tbl_row_{tmpl_if name='__EVEN__'}even{tmpl_else}uneven{/tmpl_if}">
                        <td class="tbl_col_active"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="active"}</a> </td>
                        <td class="tbl_col_domain"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="domain"}</a> </td>
                        <td class="tbl_col_server"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="server_id"}</a> </td>
                        <td class="tbl_col_interval"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="backup_interval"}</a> /  <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="backup_copies"}</a> </td>
                        <td class="tbl_col_backup_count"> <a href="#" onclick="loadContent('sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="backup_copies_exists"}</a> </td>
                        <td class="tbl_col_active"> <a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="active"}</a> </td>
                        <td class="tbl_col_domain"> <a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="domain"}</a> </td>
                        <td class="tbl_col_server"> <a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="server_id"}</a> </td>
                        <td class="tbl_col_interval"> <a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="backup_interval"}</a> /  <a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="backup_copies"}</a> </td>
                        <td class="tbl_col_backup_count"> <a href="#" data-load-content="sites/web_<tmpl_if name='type' op='==' value='vhostsubdomain'>vhost_sub</tmpl_if><tmpl_if name='type' op='==' value='vhostalias'>vhost_alias</tmpl_if>domain_edit.php?id={tmpl_var name='id'}">{tmpl_var name="backup_copies_exists"}</a> </td>
                    </tr>
                    </tmpl_loop>
                </tbody>
interface/web/themes/default/assets/javascripts/ispconfig.js
@@ -1,6 +1,707 @@
var ISPConfig = {
    pageFormChanged: false,
    tabChangeWarningTxt: '',
    tabChangeDiscardTxt: '',
    tabChangeWarning: false,
    tabChangeDiscard: false,
    requestsRunning: 0,
    indicatorCompleted: false,
    registeredHooks: new Array(),
    new_tpl_add_id: 0,
    options: {
        useLoadIndicator: false,
        useComboBox: false,
    },
    setOption: function(key, value) {
        ISPConfig.options[key] = value;
    },
    setOptions: function(opts) {
        $.extend(ISPConfig.options, opts);
    },
    reportError: function(request) {
        /* Error reporting is disabled by default as some browsers like safari
           sometimes throw errors when a ajax request is delayed even if the
           ajax request worked. */
        /*alert(request);*/
    },
    registerHook: function(name, callback) {
        if(!ISPConfig.registeredHooks[name]) ISPConfig.registeredHooks[name] = new Array();
        var newindex = ISPConfig.registeredHooks[name].length;
        ISPConfig.registeredHooks[name][newindex] = callback;
    },
    callHook: function(name, params) {
        if(!ISPConfig.registeredHooks[name]) return;
        for(var i = 0; i < ISPConfig.registeredHooks[name].length; i++) {
            var callback = ISPConfig.registeredHooks[name][i];
            callback(name, params);
        }
    },
    resetFormChanged: function() {
        ISPConfig.pageFormChanged = false;
    },
    showLoadIndicator: function() {
        document.body.style.cursor = 'wait';
        if(ISPConfig.options.useLoadIndicator == true) {
            ISPConfig.requestsRunning += 1;
            if(ISPConfig.requestsRunning < 2) {
                var indicator = $('#ajaxloader');
                if(indicator.length < 1) {
                    indicator = $('<div id="ajaxloader" style="display: none;"></div>');
                    indicator.appendTo('body');
                }
                var parent = $('#content');
                if(parent.length < 1) return;
                ISPConfig.indicatorCompleted = false;
                var atx = parent.offset().left + 150; //((parent.outerWidth(true) - indicator.outerWidth(true)) / 2);
                var aty = parent.offset().top + 150;
                indicator.css( {'left': atx, 'top': aty } ).fadeIn('fast', function() {
                    // check if loader should be hidden immediately
                    ISPConfig.indicatorCompleted = true;
                    if(ISPConfig.requestsRunning < 1) $(this).fadeOut('fast', function() { $(this).hide();});
                });
            }
        }
    },
    hideLoadIndicator: function() {
        document.body.style.cursor = '';
        ISPConfig.requestsRunning -= 1;
        if(ISPConfig.requestsRunning < 1) {
            ISPConfig.requestsRunning = 0; // just for the case...
            if(ISPConfig.indicatorCompleted == true) $('#ajaxloader').fadeOut('fast', function() { $('#ajaxloader').hide(); } );
        }
    },
    onAfterSideNavLoaded: function() {
        if(ISPConfig.options.useComboBox == true) {
            $('#sidebar').find("select:not(.chosen-select)").select2({
                placeholder: '',
                width: 'element',
                selectOnBlur: true,
                allowClear: true,
            });
        }
    },
    onAfterContentLoad: function(url, data) {
        if(!data) data = '';
        else data = '&' + data;
        if(ISPConfig.options.useComboBox == true) {
            $('#pageContent').find("select:not(.chosen-select)").select2({
                placeholder: '',
                width: 'element',
                selectOnBlur: true,
                allowClear: true,
                formatResult: function(o) {
                    if(o.id && $(o.element).parent().hasClass('flags')) return '<span class="flags flag-' + o.id.toLowerCase() + '">' + o.text + '</span>';
                    else return o.text;
                },
                formatSelection: function(o) {
                    if(o.id && $(o.element).parent().hasClass('flags')) return '<span class="flags flag-' + o.id.toLowerCase() + '">' + o.text + '</span>';
                    else return o.text;
                }
            }).on('change', function(e) {
                if ($("#pageForm .table #Filter").length > 0) {
                    $("#pageForm .table #Filter").trigger('click');
                }
            });
        }
        ISPConfig.callHook('onAfterContentLoad', {'url': url, 'data': data });
    },
    /* THIS ONE SHOULD BE REMOVED AFTER CREATING THE STATIC LOGIN PAGE!!! */
    submitLoginForm: function(formname) {
        //* Validate form. TODO: username and password with strip();
        var frm = document.getElementById(formname);
        var userNameObj = frm.username;
        if(userNameObj.value == ''){
            userNameObj.focus();
            return;
        }
        var passwordObj = frm.passwort;
        if(passwordObj.value == ''){
            passwordObj.focus();
            return;
        }
        $('#dummy_username').val(userNameObj.value);
        $('#dummy_passwort').val(passwordObj.value);
        $('#dummy_login_form').submit();
        var submitFormObj = $.ajax({
            type: "POST",
            url: "content.php",
            data: $('#'+formname).serialize(),
            dataType: "html",
            beforeSend: function() {
                ISPConfig.showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                    var parts = jqXHR.responseText.split(':');
                    ISPConfig.loadContent(parts[1]);
                } else if (jqXHR.responseText.indexOf('LOGIN_REDIRECT:') > -1) {
                    // Go to the login page
                    document.location.href = 'index.php';
                } else {
                    $('#pageContent').html(jqXHR.responseText);
                    ISPConfig.onAfterContentLoad('content.php', $('#'+formname).serialize());
                    ISPConfig.pageFormChanged = false;
                }
                ISPConfig.loadMenus();
                ISPConfig.hideLoadIndicator();
            },
            error: function() {
                ISPConfig.hideLoadIndicator();
                ISPConfig.reportError('Ajax Request was not successful.110');
            }
        });
    },
    submitForm: function(formname, target, confirmation) {
        var successMessage = arguments[3];
        if(!confirmation) confirmation = false;
        if(!confirmation || window.confirm(confirmation)) {
            var submitFormObj = $.ajax({
                type: "POST",
                url: target,
                data: $('#'+formname).serialize(),
                dataType: "html",
                beforeSend: function() {
                    ISPConfig.showLoadIndicator();
                },
                success: function(data, textStatus, jqXHR) {
                    if(successMessage) alert(successMessage);
                    if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                        var parts = jqXHR.responseText.split(':');
                        ISPConfig.loadContent(parts[1]);
                    } else {
                        $('#pageContent').html(jqXHR.responseText);
                        ISPConfig.onAfterContentLoad(target, $('#'+formname).serialize());
                        ISPConfig.pageFormChanged = false;
                    }
                    ISPConfig.hideLoadIndicator();
                },
                error: function(jqXHR, textStatus, errorThrown) {
                    ISPConfig.hideLoadIndicator();
                    var parts = jqXHR.responseText.split(':');
                    ISPConfig.reportError('Ajax Request was not successful. 111');
                }
            });
        }
    },
    submitUploadForm: function(formname, target) {
        var handleResponse = function(loadedFrame) {
            var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML;
            try {
                response = JSON.parse(responseStr);
            } catch(e) {
                response = responseStr;
            }
            var msg = '';
            var okmsg = $('#OKMsg',response).html();
            if(okmsg){
                msg = '<div id="OKMsg">'+okmsg+'</div>';
            }
            var errormsg = $('#errorMsg',response).html();
            if(errormsg){
                msg = msg+'<div id="errorMsg">'+errormsg+'</div>';
            }
            return msg;
        };
        var frame_id = 'ajaxUploader-iframe-' + Math.round(new Date().getTime() / 1000);
        $('body').after('<iframe width="0" height="0" style="display:none;" name="'+frame_id+'" id="'+frame_id+'"/>');
        $('input[type="file"]').closest("form").attr({target: frame_id, action: target}).submit();
        $('#'+frame_id).load(function() {
            var msg = handleResponse(this);
            $('#errorMsg').remove();
            $('#OKMsg').remove();
            $('input[name="id"]').before(msg);
            $(this).remove();
          });
    },
    capp: function(module, redirect) {
        var submitFormObj = $.ajax({
            type: "GET",
            url: "capp.php",
            data: "mod="+module+((redirect != undefined) ? '&redirect='+redirect : ''),
            dataType: "html",
            beforeSend: function() {
                ISPConfig.showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText != '') {
                    if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                        var parts = jqXHR.responseText.split(':');
                        ISPConfig.loadContent(parts[1]);
                    } else if (jqXHR.responseText.indexOf('URL_REDIRECT:') > -1) {
                        var newUrl= jqXHR.responseText.substr(jqXHR.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length);
                        document.location.href = newUrl;
                    } else {
                        //alert(jqXHR.responseText);
                    }
                }
                ISPConfig.loadMenus();
                ISPConfig.hideLoadIndicator();
            },
            error: function() {
                ISPConfig.hideLoadIndicator();
                ISPConfig.reportError('Ajax Request was not successful.'+module);
            }
        });
    },
    loadContent: function(pagename) {
        var params = arguments[1];
        var pageContentObject2 = $.ajax({
            type: "GET",
            url: pagename,
            data: (params ? params : null),
            dataType: "html",
            beforeSend: function() {
                ISPConfig.showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                    var parts = jqXHR.responseText.split(':');
                    ISPConfig.loadContent(parts[1]);
                } else if (jqXHR.responseText.indexOf('URL_REDIRECT:') > -1) {
                    var newUrl= jqXHR.responseText.substr(jqXHR.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length);
                    document.location.href = newUrl;
                } else {
                    //document.getElementById('pageContent').innerHTML = jqXHR.responseText;
                    //var reponse = $(jqXHR.responseText);
                    //var reponseScript = reponse.filter("script");
                    //$.each(reponseScript, function(idx, val) { eval(val.text); } );
                    $('#pageContent').html(jqXHR.responseText);
                    ISPConfig.onAfterContentLoad(pagename, (params ? params : null));
                    ISPConfig.pageFormChanged = false;
                }
                ISPConfig.hideLoadIndicator();
            },
            error: function() {
                ISPConfig.hideLoadIndicator();
                ISPConfig.reportError('Ajax Request was not successful. 113');
            }
        });
    },
    loadContentRefresh: function(pagename) {
        if($('#refreshinterval').val() > 0) {
            var pageContentObject2 = $.ajax({
                type: "GET",
                url: pagename,
                data: "refresh="+document.getElementById('refreshinterval').value,
                dataType: "html",
                beforeSend: function() {
                    ISPConfig.showLoadIndicator();
                },
                success: function(data, textStatus, jqXHR) {
                    ISPConfig.hideLoadIndicator();
                    $('#pageContent').html(jqXHR.responseText);
                    ISPConfig.onAfterContentLoad(pagename, "refresh="+document.getElementById('refreshinterval').value);
                    ISPConfig.pageFormChanged = false;
                },
                error: function() {
                    ISPConfig.hideLoadIndicator();
                    ISPConfig.reportError('Ajax Request was not successful.'+pagename);
                }
            });
            setTimeout( "ISPConfig.loadContentRefresh('"+pagename+"&refresh="+document.getElementById('refreshinterval').value+"')", document.getElementById('refreshinterval').value*1000*60 );
        }
    },
    loadInitContent: function() {
        var pageContentObject = $.ajax({
            type: "GET",
            url: "content.php",
            data: "s_mod=login&s_pg=index",
            dataType: "html",
            beforeSend: function() {
                ISPConfig.showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
                    var parts = jqXHR.responseText.split(":");
                    ISPConfig.loadContent(parts[1]);
                } else {
                    $('#pageContent').html(jqXHR.responseText);
                    ISPConfig.onAfterContentLoad('content.php', "s_mod=login&s_pg=index");
                    ISPConfig.pageFormChanged = false;
                }
                ISPConfig.hideLoadIndicator();
            },
            error: function() {
                ISPConfig.hideLoadIndicator();
                ISPConfig.reportError('Ajax Request was not successful. 114');
            }
        });
        ISPConfig.loadMenus();
        ISPConfig.keepalive();
        setTimeout(function() {
            try {
                $('form#pageForm').find('input[name="username"]').focus();
            } catch (e) {
            }
        }, 1000);
    },
    loadMenus: function() {
        var sideNavObject = $.ajax({
            type: "GET",
            url: "nav.php",
            data: "nav=side",
            dataType: "html",
            beforeSend: function() {
                ISPConfig.showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                ISPConfig.hideLoadIndicator();
                $('#sidebar').html(jqXHR.responseText);
                ISPConfig.onAfterSideNavLoaded();
                ISPConfig.loadPushyMenu();
            },
            error: function() {
                ISPConfig.hideLoadIndicator();
                ISPConfig.reportError('Ajax Request was not successful. 115');
            }
        });
        var topNavObject = $.ajax({
            type: "GET",
            url: "nav.php",
            data: "nav=top",
            dataType: "html",
            beforeSend: function() {
                ISPConfig.showLoadIndicator();
            },
            success: function(data, textStatus, jqXHR) {
                ISPConfig.hideLoadIndicator();
                $('#topnav-container').html(jqXHR.responseText);
                ISPConfig.loadPushyMenu();
            },
            error: function(o) {
                ISPConfig.hideLoadIndicator();
                ISPConfig.reportError('Ajax Request was not successful. 116');
            }
        });
    },
    changeTab: function(tab, target, force) {
        if(ISPConfig.requestsRunning > 0) return false;
        document.pageForm.next_tab.value = tab;
        var idel = $('form#pageForm').find('[name="id"]');
        var id = null;
        if(idel.length > 0) id = idel.val();
        if(ISPConfig.tabChangeDiscard == 'y' && !force) {
            if((idel.length < 1 || id) && (ISPConfig.pageFormChanged == false || window.confirm(ISPConfig.tabChangeDiscardTxt))) {
                var next_tab = tab;
                if(id) ISPConfig.loadContent(target, {'next_tab': next_tab, 'id': id});
                else ISPConfig.loadContent(target, {'next_tab': next_tab});
            } else {
                return false;
            }
        } else {
            if(id && ISPConfig.tabChangeWarning == 'y' && ISPConfig.pageFormChanged == true) {
                if(window.confirm(ISPConfig.tabChangeWarningTxt)) {
                    ISPConfig.submitForm('pageForm', target);
                } else {
                    var next_tab = tab;
                    if(id) ISPConfig.loadContent(target, {'next_tab': next_tab, 'id': id});
                    else ISPConfig.loadContent(target, {'next_tab': next_tab});
                }
            } else {
                ISPConfig.submitForm('pageForm',target);
            }
        }
    },
    confirm_action: function(link, confirmation) {
        if(window.confirm(confirmation)) {
            ISPConfig.loadContent(link);
        }
    },
    loadContentInto: function(elementid,pagename) {
        var pageContentObject2 = $.ajax({
            type: "GET",
            url: pagename,
            dataType: "html",
            beforeSend: function() {
            },
            success: function(data, textStatus, jqXHR) {
                $('#'+elementid).html(jqXHR.responseText);
            },
            error: function() {
                ISPConfig.reportError('Ajax Request was not successful. 118');
            }
        });
    },
    loadOptionInto: function(elementid,pagename) {
        var pageContentObject2 = $.ajax({
            type: "GET",
            url: pagename,
            dataType: "html",
            beforeSend: function() {
            },
            success: function(data, textStatus, jqXHR) {
                var teste = jqXHR.responseText;
                var elemente = teste.split('#');
                el=document.getElementById(elementid);
                el.innerHTML='';
                for (var i = 0; i < elemente.length; ++i){
                    var foo2 = document.createElement("option");
                    foo2.appendChild(document.createTextNode(elemente[i]));
                    foo2.value=elemente[i];
                    el.appendChild(foo2);
                }
            },
            error: function() {
                ISPConfig.reportError('Ajax Request was not successful. 119');
            }
        });
    },
    keepalive: function() {
        var pageContentObject3 = $.ajax({
            type: "GET",
            url: "keepalive.php",
            dataType: "html",
            success: function(data, textStatus, jqXHR) {
                setTimeout( keepalive, 1000000 );
            },
            error: function() {
                ISPConfig.reportError('Session expired. Please login again.');
            }
        });
    },
    addAdditionalTemplate: function(){
        var tpl_add = $('#template_additional').val();
        var addTemplate = $('#tpl_add_select').val().split('|',2);
        var addTplId = addTemplate[0];
        var addTplText = addTemplate[1];
        if(addTplId > 0) {
            var newVal = tpl_add.split('/');
            ISPConfig.new_tpl_add_id += 1;
            var delbtn = $('<a href="#"></a>').attr('class', 'button icons16 icoDelete').click(function(e) {
                e.preventDefault();
                ISPConfig.delAdditionalTemplate($(this).parent().attr('rel'));
            });
            newVal[newVal.length] = 'n' + ISPConfig.new_tpl_add_id + ':' + addTplId;
            $('<li>' + addTplText + '</li>').attr('rel', 'n' + new_tpl_add_id).append(delbtn).appendTo('#template_additional_list ul');
            $('#template_additional').val(newVal.join('/'));
            alert('additional template ' + addTplText + ' added to customer');
        } else {
            alert('no additional template selcted');
        }
    },
    delAdditionalTemplate: function(tpl_id) {
        var tpl_add = $('#template_additional').val();
        if(tpl_id) {
            // new style
            var $el = $('#template_additional_list ul').find('li[rel="' + tpl_id + '"]').eq(0); // only the first
            var addTplText = $el.text();
            $el.remove();
            var oldVal = tpl_add.split('/');
            var newVal = new Array();
            for(var i = 0; i < oldVal.length; i++) {
                var tmp = oldVal[i].split(':', 2);
                if(tmp.length == 2 && tmp[0] == tpl_id) continue;
                newVal[newVal.length] = oldVal[i];
            }
            $('#template_additional').val(newVal.join('/'));
            alert('additional template ' + addTplText + ' deleted from customer');
        } else if(tpl_add != '') {
            // old style
            var addTemplate = document.getElementById('tpl_add_select').value.split('|',2);
            var addTplId = addTemplate[0];
            var addTplText = addTemplate[1];
            $('#template_additional_list ul').find('li:not([rel])').each(function() {
                var text = $(this).text();
                if(text == addTplText) {
                    $(this).remove();
                    return false;
                }
                return this;
            });
            var newVal = tpl_add;
            var repl = new RegExp('(^|\/)' + addTplId + '(\/|$)');
            newVal = newVal.replace(repl, '');
            newVal = newVal.replace('//', '/');
            $('#template_additional').val(newVal);
            alert('additional template ' + addTplText + ' deleted from customer');
      } else {
        alert('no additional template selcted');
      }
    }
};
$(document).on("change", function(event) {
    var elName = event.target.localName;
    if ($("#pageForm .table #Filter").length > 0 && elName == 'select') {
        event.preventDefault();
        $("#pageForm .table #Filter").trigger('click');
    }
    if(elName == 'select' || elName == 'input' || elName == 'textarea') {
        if($(event.target).hasClass('no-page-form-change') == false) {
            // set marker that something was changed
            ISPConfig.pageFormChanged = true;
        }
    }
});
$(document).on('click', 'a[data-load-content],button[data-load-content]', function(e) {
    e.preventDefault();
    var content_to_load = $(this).attr('data-load-content');
    if(!content_to_load) return this;
    ISPConfig.loadContent(content_to_load);
});
$(document).on('click', 'a[data-capp],button[data-capp]', function(e) {
    e.preventDefault();
    var content_to_load = $(this).attr('data-capp');
    if(!content_to_load) return this;
    ISPConfig.capp(content_to_load);
});
$(document).on('click', 'a[data-submit-form],button[data-submit-form]', function(e) {
    e.preventDefault();
    var $el = $(this);
    var act = $el.attr('data-form-action');
    var form = $el.attr('data-submit-form');
    if($el.attr('data-form-upload') == 'true') ISPConfig.submitUploadForm(form, act);
    else ISPConfig.submitForm(form, act);
});
$(document).bind("keypress", function(event) {
    //Use $ submit with keypress Enter in panel filterbar
    if (event.which == '13' && $("#pageForm .table #Filter").length > 0 && $(event.target).hasClass('ui-autocomplete-input') == false ) {
        event.preventDefault();
        $("#pageForm .table #Filter").trigger('click');
    }
    //Use $ submit with keypress Enter in forms
    if (event.which == '13' && $(".pnl_formsarea button.positive").length > 0 && event.target.localName != 'textarea' && $(event.target).is(':input')) {
        event.preventDefault();
        $(".pnl_formsarea button.positive:first").not("[disabled='disabled']").trigger('click');
    }
});
$(document).on('click', 'th[data-column]', function(e) {
    var $self = $(this);
    var column = $self.attr('data-column');
    if(!column) return this;
    if($("#pageForm .table #Filter").length > 0 && $self.attr('data-sortable') != 'false') {
        var $el = $('#Filter');
        var act = $el.attr('data-form-action');
        var form = $el.attr('data-submit-form');
        act = act + '?orderby=' + column;
        ISPConfig.submitForm(form, act);
    }
});
$(document).on("click", ".addPlaceholder", function(){
    var placeholderText = $(this).text();
    var template = $(this).siblings(':input');
    template.insertAtCaret(placeholderText);
});
$(document).on("click", ".addPlaceholderContent", function(){
    var placeholderContentText = $(this).find('.addPlaceholderContent').text();
    var template2 = $(this).siblings(':input');
    template2.insertAtCaret(placeholderContentText);
});
$(document).on('ready', function () {
  // Animierter Ladefortschritt
  $('.progress .progress-bar').css('width', function () {
    return $(this).attr('aria-valuenow') + '%';
  });
    $.fn.extend({
        insertAtCaret: function(myValue){
            return this.each(function(i) {
                if (document.selection) {
                    //For browsers like Internet Explorer
                    this.focus();
                    sel = document.selection.createRange();
                    sel.text = myValue;
                    this.focus();
                } else if (this.selectionStart || this.selectionStart == '0') {
                    //For browsers like Firefox and Webkit based
                    var startPos = this.selectionStart;
                    var endPos = this.selectionEnd;
                    var scrollTop = this.scrollTop;
                    this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length);
                    this.focus();
                    this.selectionStart = startPos + myValue.length;
                    this.selectionEnd = startPos + myValue.length;
                    this.scrollTop = scrollTop;
                } else {
                    this.value += myValue;
                    this.focus();
                }
            })
        }
    });
    // Animierter Ladefortschritt
    $('.progress .progress-bar').css('width', function () {
        return $(this).attr('aria-valuenow') + '%';
    });
    ISPConfig.loadInitContent();
    $('#searchform').submit(function(e) {
        e.preventDefault();
    });
    $("#pageForm").submit(function(e){
        //Prevent form submit: e.preventDefault() in lists
        if ($("#pageForm .table #Filter").length > 0) {
            e.preventDefault();
        }
    });
    $('#globalsearch').ispconfigSearch({
        dataSrc: '/dashboard/ajax_get_json.php?type=globalsearch',
        resultsLimit: '$ <tmpl_var name="globalsearch_resultslimit_of_txt"> % <tmpl_var name="globalsearch_resultslimit_results_txt">',
        noResultsText: '<tmpl_var name="globalsearch_noresults_text_txt">',
        noResultsLimit: '<tmpl_var name="globalsearch_noresults_limit_txt">',
        searchFieldWatermark: '<tmpl_var name="globalsearch_searchfield_watermark_txt">',
        resultBoxPosition: ''
    });
});
interface/web/themes/default/assets/javascripts/ispconfig.min.js
@@ -1 +1 @@
$(document).on("ready",function(){$(".progress .progress-bar").css("width",function(){return $(this).attr("aria-valuenow")+"%"})});
var ISPConfig={pageFormChanged:false,tabChangeWarningTxt:"",tabChangeDiscardTxt:"",tabChangeWarning:false,tabChangeDiscard:false,requestsRunning:0,indicatorCompleted:false,registeredHooks:new Array(),new_tpl_add_id:0,options:{useLoadIndicator:false,useComboBox:false,},setOption:function(a,b){ISPConfig.options[a]=b},setOptions:function(a){$.extend(ISPConfig.options,a)},reportError:function(a){},registerHook:function(a,c){if(!ISPConfig.registeredHooks[a]){ISPConfig.registeredHooks[a]=new Array()}var b=ISPConfig.registeredHooks[a].length;ISPConfig.registeredHooks[a][b]=c},callHook:function(a,c){if(!ISPConfig.registeredHooks[a]){return}for(var b=0;b<ISPConfig.registeredHooks[a].length;b++){var d=ISPConfig.registeredHooks[a][b];d(a,c)}},resetFormChanged:function(){ISPConfig.pageFormChanged=false},showLoadIndicator:function(){document.body.style.cursor="wait";if(ISPConfig.options.useLoadIndicator==true){ISPConfig.requestsRunning+=1;if(ISPConfig.requestsRunning<2){var a=$("#ajaxloader");if(a.length<1){a=$('<div id="ajaxloader" style="display: none;"></div>');a.appendTo("body")}var b=$("#content");if(b.length<1){return}ISPConfig.indicatorCompleted=false;var d=b.offset().left+150;var c=b.offset().top+150;a.css({left:d,top:c}).fadeIn("fast",function(){ISPConfig.indicatorCompleted=true;if(ISPConfig.requestsRunning<1){$(this).fadeOut("fast",function(){$(this).hide()})}})}}},hideLoadIndicator:function(){document.body.style.cursor="";ISPConfig.requestsRunning-=1;if(ISPConfig.requestsRunning<1){ISPConfig.requestsRunning=0;if(ISPConfig.indicatorCompleted==true){$("#ajaxloader").fadeOut("fast",function(){$("#ajaxloader").hide()})}}},onAfterSideNavLoaded:function(){if(ISPConfig.options.useComboBox==true){$("#sidebar").find("select:not(.chosen-select)").select2({placeholder:"",width:"element",selectOnBlur:true,allowClear:true,})}},onAfterContentLoad:function(a,b){if(!b){b=""}else{b="&"+b}if(ISPConfig.options.useComboBox==true){$("#pageContent").find("select:not(.chosen-select)").select2({placeholder:"",width:"element",selectOnBlur:true,allowClear:true,formatResult:function(c){if(c.id&&$(c.element).parent().hasClass("flags")){return'<span class="flags flag-'+c.id.toLowerCase()+'">'+c.text+"</span>"}else{return c.text}},formatSelection:function(c){if(c.id&&$(c.element).parent().hasClass("flags")){return'<span class="flags flag-'+c.id.toLowerCase()+'">'+c.text+"</span>"}else{return c.text}}}).on("change",function(c){if($("#pageForm .table #Filter").length>0){$("#pageForm .table #Filter").trigger("click")}})}ISPConfig.callHook("onAfterContentLoad",{url:a,data:b})},submitLoginForm:function(d){var c=document.getElementById(d);var b=c.username;if(b.value==""){b.focus();return}var e=c.passwort;if(e.value==""){e.focus();return}$("#dummy_username").val(b.value);$("#dummy_passwort").val(e.value);$("#dummy_login_form").submit();var a=$.ajax({type:"POST",url:"content.php",data:$("#"+d).serialize(),dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(g,i,f){if(f.responseText.indexOf("HEADER_REDIRECT:")>-1){var h=f.responseText.split(":");ISPConfig.loadContent(h[1])}else{if(f.responseText.indexOf("LOGIN_REDIRECT:")>-1){document.location.href="index.php"}else{$("#pageContent").html(f.responseText);ISPConfig.onAfterContentLoad("content.php",$("#"+d).serialize());ISPConfig.pageFormChanged=false}}ISPConfig.loadMenus();ISPConfig.hideLoadIndicator()},error:function(){ISPConfig.hideLoadIndicator();ISPConfig.reportError("Ajax Request was not successful.110")}})},submitForm:function(d,e,c){var b=arguments[3];if(!c){c=false}if(!c||window.confirm(c)){var a=$.ajax({type:"POST",url:e,data:$("#"+d).serialize(),dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(g,i,f){if(b){alert(b)}if(f.responseText.indexOf("HEADER_REDIRECT:")>-1){var h=f.responseText.split(":");ISPConfig.loadContent(h[1])}else{$("#pageContent").html(f.responseText);ISPConfig.onAfterContentLoad(e,$("#"+d).serialize());ISPConfig.pageFormChanged=false}ISPConfig.hideLoadIndicator()},error:function(f,i,h){ISPConfig.hideLoadIndicator();var g=f.responseText.split(":");ISPConfig.reportError("Ajax Request was not successful. 111")}})}},submitUploadForm:function(c,d){var b=function(l){var g,h=l.contentWindow.document.body.innerHTML;try{g=JSON.parse(h)}catch(i){g=h}var j="";var f=$("#OKMsg",g).html();if(f){j='<div id="OKMsg">'+f+"</div>"}var k=$("#errorMsg",g).html();if(k){j=j+'<div id="errorMsg">'+k+"</div>"}return j};var a="ajaxUploader-iframe-"+Math.round(new Date().getTime()/1000);$("body").after('<iframe width="0" height="0" style="display:none;" name="'+a+'" id="'+a+'"/>');$('input[type="file"]').closest("form").attr({target:a,action:d}).submit();$("#"+a).load(function(){var e=b(this);$("#errorMsg").remove();$("#OKMsg").remove();$('input[name="id"]').before(e);$(this).remove()})},capp:function(b,c){var a=$.ajax({type:"GET",url:"capp.php",data:"mod="+b+((c!=undefined)?"&redirect="+c:""),dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(e,h,d){if(d.responseText!=""){if(d.responseText.indexOf("HEADER_REDIRECT:")>-1){var g=d.responseText.split(":");ISPConfig.loadContent(g[1])}else{if(d.responseText.indexOf("URL_REDIRECT:")>-1){var f=d.responseText.substr(d.responseText.indexOf("URL_REDIRECT:")+"URL_REDIRECT:".length);document.location.href=f}else{}}}ISPConfig.loadMenus();ISPConfig.hideLoadIndicator()},error:function(){ISPConfig.hideLoadIndicator();ISPConfig.reportError("Ajax Request was not successful."+b)}})},loadContent:function(b){var c=arguments[1];var a=$.ajax({type:"GET",url:b,data:(c?c:null),dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(e,h,d){if(d.responseText.indexOf("HEADER_REDIRECT:")>-1){var g=d.responseText.split(":");ISPConfig.loadContent(g[1])}else{if(d.responseText.indexOf("URL_REDIRECT:")>-1){var f=d.responseText.substr(d.responseText.indexOf("URL_REDIRECT:")+"URL_REDIRECT:".length);document.location.href=f}else{$("#pageContent").html(d.responseText);ISPConfig.onAfterContentLoad(b,(c?c:null));ISPConfig.pageFormChanged=false}}ISPConfig.hideLoadIndicator()},error:function(){ISPConfig.hideLoadIndicator();ISPConfig.reportError("Ajax Request was not successful. 113")}})},loadContentRefresh:function(b){if($("#refreshinterval").val()>0){var a=$.ajax({type:"GET",url:b,data:"refresh="+document.getElementById("refreshinterval").value,dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(d,e,c){ISPConfig.hideLoadIndicator();$("#pageContent").html(c.responseText);ISPConfig.onAfterContentLoad(b,"refresh="+document.getElementById("refreshinterval").value);ISPConfig.pageFormChanged=false},error:function(){ISPConfig.hideLoadIndicator();ISPConfig.reportError("Ajax Request was not successful."+b)}});setTimeout("ISPConfig.loadContentRefresh('"+b+"&refresh="+document.getElementById("refreshinterval").value+"')",document.getElementById("refreshinterval").value*1000*60)}},loadInitContent:function(){var a=$.ajax({type:"GET",url:"content.php",data:"s_mod=login&s_pg=index",dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(c,e,b){if(b.responseText.indexOf("HEADER_REDIRECT:")>-1){var d=b.responseText.split(":");ISPConfig.loadContent(d[1])}else{$("#pageContent").html(b.responseText);ISPConfig.onAfterContentLoad("content.php","s_mod=login&s_pg=index");ISPConfig.pageFormChanged=false}ISPConfig.hideLoadIndicator()},error:function(){ISPConfig.hideLoadIndicator();ISPConfig.reportError("Ajax Request was not successful. 114")}});ISPConfig.loadMenus();ISPConfig.keepalive();setTimeout(function(){try{$("form#pageForm").find('input[name="username"]').focus()}catch(b){}},1000)},loadMenus:function(){var b=$.ajax({type:"GET",url:"nav.php",data:"nav=side",dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(d,e,c){ISPConfig.hideLoadIndicator();$("#sidebar").html(c.responseText);ISPConfig.onAfterSideNavLoaded();ISPConfig.loadPushyMenu()},error:function(){ISPConfig.hideLoadIndicator();ISPConfig.reportError("Ajax Request was not successful. 115")}});var a=$.ajax({type:"GET",url:"nav.php",data:"nav=top",dataType:"html",beforeSend:function(){ISPConfig.showLoadIndicator()},success:function(d,e,c){ISPConfig.hideLoadIndicator();$("#topnav-container").html(c.responseText);ISPConfig.loadPushyMenu()},error:function(c){ISPConfig.hideLoadIndicator();ISPConfig.reportError("Ajax Request was not successful. 116")}})},changeTab:function(c,e,d){if(ISPConfig.requestsRunning>0){return false}document.pageForm.next_tab.value=c;var b=$("form#pageForm").find('[name="id"]');var f=null;if(b.length>0){f=b.val()}if(ISPConfig.tabChangeDiscard=="y"&&!d){if((b.length<1||f)&&(ISPConfig.pageFormChanged==false||window.confirm(ISPConfig.tabChangeDiscardTxt))){var a=c;if(f){ISPConfig.loadContent(e,{next_tab:a,id:f})}else{ISPConfig.loadContent(e,{next_tab:a})}}else{return false}}else{if(f&&ISPConfig.tabChangeWarning=="y"&&ISPConfig.pageFormChanged==true){if(window.confirm(ISPConfig.tabChangeWarningTxt)){ISPConfig.submitForm("pageForm",e)}else{var a=c;if(f){ISPConfig.loadContent(e,{next_tab:a,id:f})}else{ISPConfig.loadContent(e,{next_tab:a})}}}else{ISPConfig.submitForm("pageForm",e)}}},confirm_action:function(b,a){if(window.confirm(a)){ISPConfig.loadContent(b)}},loadContentInto:function(b,c){var a=$.ajax({type:"GET",url:c,dataType:"html",beforeSend:function(){},success:function(e,f,d){$("#"+b).html(d.responseText)},error:function(){ISPConfig.reportError("Ajax Request was not successful. 118")}})},loadOptionInto:function(b,c){var a=$.ajax({type:"GET",url:c,dataType:"html",beforeSend:function(){},success:function(g,k,f){var h=f.responseText;var j=h.split("#");el=document.getElementById(b);el.innerHTML="";for(var e=0;e<j.length;++e){var d=document.createElement("option");d.appendChild(document.createTextNode(j[e]));d.value=j[e];el.appendChild(d)}},error:function(){ISPConfig.reportError("Ajax Request was not successful. 119")}})},keepalive:function(){var a=$.ajax({type:"GET",url:"keepalive.php",dataType:"html",success:function(c,d,b){setTimeout(keepalive,1000000)},error:function(){ISPConfig.reportError("Session expired. Please login again.")}})},addAdditionalTemplate:function(){var e=$("#template_additional").val();var a=$("#tpl_add_select").val().split("|",2);var d=a[0];var f=a[1];if(d>0){var c=e.split("/");ISPConfig.new_tpl_add_id+=1;var b=$('<a href="#"></a>').attr("class","button icons16 icoDelete").click(function(g){g.preventDefault();ISPConfig.delAdditionalTemplate($(this).parent().attr("rel"))});c[c.length]="n"+ISPConfig.new_tpl_add_id+":"+d;$("<li>"+f+"</li>").attr("rel","n"+new_tpl_add_id).append(b).appendTo("#template_additional_list ul");$("#template_additional").val(c.join("/"));alert("additional template "+f+" added to customer")}else{alert("no additional template selcted")}},delAdditionalTemplate:function(d){var a=$("#template_additional").val();if(d){var l=$("#template_additional_list ul").find('li[rel="'+d+'"]').eq(0);var k=l.text();l.remove();var j=a.split("/");var b=new Array();for(var e=0;e<j.length;e++){var f=j[e].split(":",2);if(f.length==2&&f[0]==d){continue}b[b.length]=j[e]}$("#template_additional").val(b.join("/"));alert("additional template "+k+" deleted from customer")}else{if(a!=""){var c=document.getElementById("tpl_add_select").value.split("|",2);var h=c[0];var k=c[1];$("#template_additional_list ul").find("li:not([rel])").each(function(){var i=$(this).text();if(i==k){$(this).remove();return false}return this});var b=a;var g=new RegExp("(^|/)"+h+"(/|$)");b=b.replace(g,"");b=b.replace("//","/");$("#template_additional").val(b);alert("additional template "+k+" deleted from customer")}else{alert("no additional template selcted")}}}};$(document).on("change",function(a){var b=a.target.localName;if($("#pageForm .table #Filter").length>0&&b=="select"){a.preventDefault();$("#pageForm .table #Filter").trigger("click")}if(b=="select"||b=="input"||b=="textarea"){if($(a.target).hasClass("no-page-form-change")==false){ISPConfig.pageFormChanged=true}}});$(document).on("click","a[data-load-content],button[data-load-content]",function(b){b.preventDefault();var a=$(this).attr("data-load-content");if(!a){return this}ISPConfig.loadContent(a)});$(document).on("click","a[data-capp],button[data-capp]",function(b){b.preventDefault();var a=$(this).attr("data-capp");if(!a){return this}ISPConfig.capp(a)});$(document).bind("keypress",function(a){if(a.which=="13"&&$("#pageForm .table #Filter").length>0&&$(a.target).hasClass("ui-autocomplete-input")==false){a.preventDefault();$("#pageForm .table #Filter").trigger("click")}if(a.which=="13"&&$(".pnl_formsarea button.positive").length>0&&a.target.localName!="textarea"&&$(a.target).is(":input")){a.preventDefault();$(".pnl_formsarea button.positive:first").not("[disabled='disabled']").trigger("click")}});$(document).on("click","th[data-column]",function(f){var g=$(this);var c=g.attr("data-column");if(!c){return this}if($("#pageForm .table #Filter").length>0&&g.attr("data-sortable")!="false"){var b=$("#Filter");var a=b.attr("data-form-action");var d=b.attr("data-submit-form");a=a+"?orderby="+c;ISPConfig.submitForm(d,a)}});$(document).on("click",".addPlaceholder",function(){var a=$(this).text();var b=$(this).siblings(":input");b.insertAtCaret(a)});$(document).on("click",".addPlaceholderContent",function(){var b=$(this).find(".addPlaceholderContent").text();var a=$(this).siblings(":input");a.insertAtCaret(b)});$(document).on("ready",function(){$.fn.extend({insertAtCaret:function(a){return this.each(function(d){if(document.selection){this.focus();sel=document.selection.createRange();sel.text=a;this.focus()}else{if(this.selectionStart||this.selectionStart=="0"){var c=this.selectionStart;var b=this.selectionEnd;var e=this.scrollTop;this.value=this.value.substring(0,c)+a+this.value.substring(b,this.value.length);this.focus();this.selectionStart=c+a.length;this.selectionEnd=c+a.length;this.scrollTop=e}else{this.value+=a;this.focus()}}})}});$(".progress .progress-bar").css("width",function(){return $(this).attr("aria-valuenow")+"%"});ISPConfig.loadInitContent();$("#searchform").submit(function(a){a.preventDefault()});$("#pageForm").submit(function(a){if($("#pageForm .table #Filter").length>0){a.preventDefault()}});$("#globalsearch").ispconfigSearch({dataSrc:"/dashboard/ajax_get_json.php?type=globalsearch",resultsLimit:'$ <tmpl_var name="globalsearch_resultslimit_of_txt"> % <tmpl_var name="globalsearch_resultslimit_results_txt">',noResultsText:'<tmpl_var name="globalsearch_noresults_text_txt">',noResultsLimit:'<tmpl_var name="globalsearch_noresults_limit_txt">',searchFieldWatermark:'<tmpl_var name="globalsearch_searchfield_watermark_txt">',resultBoxPosition:""})});
interface/web/themes/default/assets/javascripts/responsive.js
@@ -1,4 +1,4 @@
function loadPushyMenu() {
ISPConfig.loadPushyMenu = function() {
  // Off-Canvas Menü
  var $mainNavigation = $('#main-navigation');
  var $subNavigation = $('#sidebar');
interface/web/themes/default/assets/javascripts/responsive.min.js
@@ -1 +1 @@
function loadPushyMenu(){var a=$("#main-navigation");var d=$("#sidebar");var b=$("nav.pushy");b.html("");$("<ul />").appendTo(b);var c=false;$(a).find("a").each(function(){var e=$(this);var i=e.hasClass("active")?' class="active"':"";var g=i!=""?true:false;var h=e.attr("data-capp");if(h){i+=' data-capp="'+h+'"'}h=e.attr("data-load-content");if(h){i+=' data-load-content="'+h+'"'}var f=$('<li><a href="'+e.attr("href")+'"'+i+'><i class="icon '+e.data("icon-class")+'"></i>'+e.text()+"</a></li>");if(g!=""){c=f}b.find("ul").append(f)});if(!c){c=b}$('<ul class="subnavi" />').appendTo(c);$(d).find("a").each(function(){var e=$(this);var f="";var g=e.attr("data-capp");if(g){f+=' data-capp="'+g+'"'}g=e.attr("data-load-content");if(g){f+=' data-load-content="'+g+'"'}g=e.hasClass("subnav-header");if(g){f+=' class="subnav-header"'}b.find("ul.subnavi").append($('<li><a href="'+e.attr("href")+'"'+f+">"+e.text()+"</a></li>"))})};
ISPConfig.loadPushyMenu=function(){var a=$("#main-navigation");var d=$("#sidebar");var b=$("nav.pushy");b.html("");$("<ul />").appendTo(b);var c=false;$(a).find("a").each(function(){var e=$(this);var i=e.hasClass("active")?' class="active"':"";var g=i!=""?true:false;var h=e.attr("data-capp");if(h){i+=' data-capp="'+h+'"'}h=e.attr("data-load-content");if(h){i+=' data-load-content="'+h+'"'}var f=$('<li><a href="'+e.attr("href")+'"'+i+'><i class="icon '+e.data("icon-class")+'"></i>'+e.text()+"</a></li>");if(g!=""){c=f}b.find("ul").append(f)});if(!c){c=b}$('<ul class="subnavi" />').appendTo(c);$(d).find("a").each(function(){var e=$(this);var f="";var g=e.attr("data-capp");if(g){f+=' data-capp="'+g+'"'}g=e.attr("data-load-content");if(g){f+=' data-load-content="'+g+'"'}g=e.hasClass("subnav-header");if(g){f+=' class="subnav-header"'}b.find("ul.subnavi").append($('<li><a href="'+e.attr("href")+'"'+f+">"+e.text()+"</a></li>"))})};
interface/web/themes/default/templates/main.tpl.htm
@@ -94,94 +94,15 @@
  </tmpl_loop>
  <script>
  <!--
    $(document).ready(function() {
        loadInitContent();
    });
    $('#searchform').submit(function(e) {
        e.preventDefault();
    });
    $("#pageForm").submit(function(e){
        //Prevent form submit: e.preventDefault() in lists
        if ($("#pageForm .table #Filter").length > 0) {
            e.preventDefault();
        }
    });
    $('#globalsearch').ispconfigSearch({
        dataSrc: '/dashboard/ajax_get_json.php?type=globalsearch',
        resultsLimit: '$ <tmpl_var name="globalsearch_resultslimit_of_txt"> % <tmpl_var name="globalsearch_resultslimit_results_txt">',
        noResultsText: '<tmpl_var name="globalsearch_noresults_text_txt">',
        noResultsLimit: '<tmpl_var name="globalsearch_noresults_limit_txt">',
        searchFieldWatermark: '<tmpl_var name="globalsearch_searchfield_watermark_txt">',
        resultBoxPosition: ''
    });
    //$('.ttip').tipsy({live: true, gravity: 'ne', html: true});
    
    tabChangeDiscard = '<tmpl_var name="tabchange_discard_enabled">';
    tabChangeWarning = '<tmpl_var name="tabchange_warning_enabled">';
    tabChangeWarningTxt = '<tmpl_var name="global_tabchange_warning_txt">';
    tabChangeDiscardTxt = '<tmpl_var name="global_tabchange_discard_txt">';
    ISPConfig.tabChangeDiscard = '<tmpl_var name="tabchange_discard_enabled">';
    ISPConfig.tabChangeWarning = '<tmpl_var name="tabchange_warning_enabled">';
    ISPConfig.tabChangeWarningTxt = '<tmpl_var name="global_tabchange_warning_txt">';
    ISPConfig.tabChangeDiscardTxt = '<tmpl_var name="global_tabchange_discard_txt">';
    
    $(document).on("change", function(event) {
        var elName = event.target.localName;
        if ($("#pageForm .table #Filter").length > 0 && elName == 'select') {
            event.preventDefault();
            $("#pageForm .table #Filter").trigger('click');
        }
        if(elName == 'select' || elName == 'input' || elName == 'textarea') {
            if($(event.target).hasClass('no-page-form-change') == false) {
                // set marker that something was changed
                pageFormChanged = true;
            }
        }
    });
    $(document).on('click', 'a[data-load-content],button[data-load-content]', function(e) {
        e.preventDefault();
        var content_to_load = $(this).attr('data-load-content');
        if(!content_to_load) return this;
        loadContent(content_to_load);
    });
    $(document).on('click', 'a[data-capp],button[data-capp]', function(e) {
        e.preventDefault();
        var content_to_load = $(this).attr('data-capp');
        if(!content_to_load) return this;
        capp(content_to_load);
    });
    $(document).bind("keypress", function(event) {
        //Use $ submit with keypress Enter in panel filterbar
        if (event.which == '13' && $("#pageForm .table #Filter").length > 0 && $(event.target).hasClass('ui-autocomplete-input') == false ) {
            event.preventDefault();
            $("#pageForm .table #Filter").trigger('click');
        }
        //Use $ submit with keypress Enter in forms
        if (event.which == '13' && $(".pnl_formsarea button.positive").length > 0 && event.target.localName != 'textarea' && $(event.target).is(':input')) {
            event.preventDefault();
            $(".pnl_formsarea button.positive:first").not("[disabled='disabled']").trigger('click');
        }
    });
    $(document).on('click', 'th[data-column]', function(e) {
        var $self = $(this);
        var column = $self.attr('data-column');
        if(!column) return this;
        if($("#pageForm .table #Filter").length > 0 && $self.attr('data-sortable') != 'false') {
            var $el = $('#Filter');
            var act = $el.attr('data-form-action');
            var form = $el.attr('data-submit-form');
            act = act + '?orderby=' + column;
            submitForm(form, act);
        }
    });
    <tmpl_if name="use_loadindicator" value="y">ISPConfig.setOption('useLoadIndicator', true);</tmpl_if>
    <tmpl_if name="use_combobox" value="y">ISPConfig.setOption('useComboBox', true);</tmpl_if>
  //-->
  </script>
</body>