Location: PHPKode > projects > phlyMail Lite > phlymail/frontend/templates/topbuttonbar.core.tpl
<script type="text/javascript">
//<![CDATA[
core_view = {'favourites':0, 'folderlist':0, 'namepane':0};<!-- START has_new_email -->
pm_menu_additem
        ('new'
        ,'{theme_path}/icons/email_men.gif'
        ,'{msg_newemail}'
        ,'{PHP_SELF}?load=compose_email&handler={handler}&{passthrough}'
        ,'100%'
        ,'100%'
        );<!-- END has_new_email --><!-- START smsactive -->
pm_menu_additem
        ('new'
        ,'{theme_path}/icons/sms_men.gif'
        ,'{msg_newsms}'
        ,'{PHP_SELF}?load=compose_sms&handler={handler}&{passthrough}'
        ,700
        ,500
        );<!-- END smsactive --><!-- START faxactive -->
pm_menu_additem
        ('new'
        ,'{theme_path}/icons/fax_men.png'
        ,'{msg_newfax}'
        ,'{PHP_SELF}?load=compose_fax&handler={handler}&{passthrough}'
        ,700
        ,500
        );<!-- END faxactive -->
pm_menu_additem
        ('system'
        ,'{theme_path}/icons/about_men.gif'
        ,'{msg_about} ...'
        ,'{PHP_SELF}?load=about&handler=core&{passthrough}'
        ,320
        ,256
        );
pm_menu_additem
        ('system'
        ,'{theme_path}/icons/logout_men.gif'
        ,'{msg_logout}'
        ,'{PHP_SELF}?action=logout&{passthrough}'
        ,0
        ,0
        ,'href'
        );<!-- START showlinkconfig -->
pm_menu_additem
        ('system'
        ,'{theme_path}/icons/men_gotoconfig.png'
        ,'{msg_gotoconfig}'
        ,'{PHP_SELF}?action=logout&{passthrough}&redir=config'
        ,0
        ,0
        ,'href'
        );<!-- END showlinkconfig --><!-- START usersetup -->
pm_menu_additem
        ('settings'
        ,'{theme_path}/icons/setup_men.gif'
        ,'{msg_setup_programme}'
        ,'{PHP_SELF}?load=setup&mode=general&handler={handler}&{passthrough}'
        ,610
        ,400
        );<!-- END usersetup --><!-- START profiles -->
pm_menu_additem
        ('settings'
        ,'{theme_path}/icons/email_men.gif'
        ,'{msg_setup_pop3_accounts}'
        ,'{PHP_SELF}?load=setup&mode=profiles&handler={handler}&{passthrough}'
        ,770
        ,410
        );<!-- END profiles -->

pm_menu['view'] = [];
pm_menu['view'][0] = [];
pm_menu['view'][0]['name'] = '{msg_showfavfolderss}';
pm_menu['view'][0]['link'] = 'core_switchview("favourites", -1)';
pm_menu['view'][0]['linktype'] = 'js';
pm_menu['view'][0]['selected'] = 0;
pm_menu['view'][1] = [];
pm_menu['view'][1]['name'] = '{msg_showfolderlist}';
pm_menu['view'][1]['link'] = 'core_switchview("folderlist", -1)';
pm_menu['view'][1]['linktype'] = 'js';
pm_menu['view'][1]['selected'] = 0;
pm_menu['view'][2] = [];
pm_menu['view'][2]['name'] = '{msg_shownamepane}';
pm_menu['view'][2]['link'] = 'core_switchview("namepane", -1)';
pm_menu['view'][2]['linktype'] = 'js';
pm_menu['view'][2]['selected'] = 0;

coreChkIntvl = window.setTimeout('core_check_quotas()', 5000);
core_quota = 'okay';
// Since this is a quite central place for handling requests, multiple parallel requests must be traced
coreRq = new Array();
function core_AJAX(url)
{
    if (window.XMLHttpRequest) {
        var req = new XMLHttpRequest();
        text = null;
    } else if (window.ActiveXObject) {
        var req = new ActiveXObject("Microsoft.XMLHTTP");
        text = false;
    }
    if (req) {
        req.onreadystatechange = core_AJAX_ORS;
        req.open("GET", url, true);
        req.send(text);
        coreRq.push(req);
    }
}

function core_AJAX_ORS()
{
    if (coreRq.length == 0) {
        return;
    }
    for (i = 0; i < coreRq.length; ++i) {
        if (coreRq[i].readyState == 4) {
            var myRq = coreRq[i];
            coreRq.splice(i, 1);
            if (typeof(myRq.status) != 'undefined' && (myRq.status == 304 || myRq.status == 200)) {
                core_AJAX_process(myRq.responseText);
            }
            break;
        }
    }
}

function core_AJAX_process(response)
{
    var regx = /\{.+\}/;
    var nresponse = regx.exec(response);
    if (!nresponse.length) {
    	core_log_error(response);
    } else {
    	response = nresponse[0];
    }
    eval('next = ' + response);
    if (next['error']) {
        core_log_error(next['error']);
    }
    if (next['get_servertime']) {
        core_draw_quota(next['get_quota_state']);
        core_adjustclock(next['get_servertime']);
    }
}

function core_check_quotas()
{
    window.clearTimeout(coreChkIntvl);
    coreChkIntvl = window.setTimeout('core_check_quotas()', 600000); // Once every 10 minutes, that's enough
    core_AJAX('{checkquota_url}');
}

function core_draw_quota(quota)
{
    $('#quotaicon_' + core_quota).hide();
    quota = quota * 1;
    if (quota < 0.34) {
        core_quota = 'okay';
    } else if (quota < 0.67) {
        core_quota = 'medium';
    } else {
        core_quota = 'bad';
    }
    $('#quotaicon_' + core_quota).show().attr('title', Math.round(quota * 100) + '%');
}

function core_adjustclock(servertime)
{
    var jetzt = new Date();
    var server = new Date(servertime);
    core_clockoffset = server.getTime() - jetzt.getTime();
}

function core_switchview(field, value)
{
    field = field.replace(/[^a-zA-Z0-9_]/, '');
    if (value == -1) {
        core_view[field] = 1-core_view[field];
        save_custom_size('core_vieww_' + field, core_view[field]);
    } else {
        core_view[field] = (value == 1) ? 1 : 0;
    }
    if (field == 'favourites') {
        $('#favfolderpane').css('display', core_view['favourites'] == 1 ? 'block' : 'none');
        window.setTimeout('adjust_height();', 250);
        pm_menu['view'][0]['selected'] = core_view['favourites'];
    }
    if (field == 'namepane') {
        $('#namepane').css('display', core_view['namepane'] == 1 ? 'block' : 'none');
        window.setTimeout('adjust_height();', 250);
        pm_menu['view'][2]['selected'] = core_view['namepane'];
    }
    if (field == 'folderlist') {
        FolderListWidthEffective = core_view['folderlist'] == 1 ? FolderListWidth : 0;
        $('#PHM_tl').css('display', core_view['folderlist'] == 1 ? 'block' : 'none');
        $('#middleresizer').css('display', core_view['folderlist'] == 1 ? 'block' : 'none');
        window.setTimeout('adjust_height();', 250);
        pm_menu['view'][1]['selected'] = core_view['folderlist'];
    }
}<!-- START logincheckupdates -->

$(document).ready(function () {
    $.ajax({url: '{url_logincheckupdates}', dataType: 'text', success: show_hasupdates });
});

function show_hasupdates(next)
{
    // No updates or sth. else went wrong
    if (typeof next == 'undefined' || !next || next == 'no') return;

    next = next.split('|');
    var aboutText = '{about_update}'.replace('$build$', next[0]);
    aboutText = aboutText.replace('$relstatus$', next[1]);
    $('<div id="updatesavailablepopup"><h4>{head_update}</h4> ' + aboutText + '</div>').appendTo('body');
    core_icontray_add('updatesavailableicon', '{theme_path}/icons/notify_newupdate.png', '{title_update}', show_updates_popup);
    show_updates_popup();
}

function show_updates_popup()
{
    $('#updatesavailablepopup').fadeIn(1000).delay(5000).fadeOut(3000);
}<!-- END logincheckupdates -->
//]]>
</script>
Return current item: phlyMail Lite