Beispiel #1
0
function qtranxf_init_admin()
{
    global $q_config;
    qtranxf_admin_loadConfig();
    $next_thanks = get_option('qtranslate_next_thanks');
    if ($next_thanks !== false && $next_thanks < time()) {
        $messages = get_option('qtranslate_admin_notices');
        if (isset($messages['next_thanks'])) {
            unset($messages['next_thanks']);
            update_option('qtranslate_admin_notices', $messages);
        }
        $next_thanks = false;
    }
    if ($next_thanks === false) {
        $next_thanks = time() + rand(100, 300) * 24 * 60 * 60;
        update_option('qtranslate_next_thanks', $next_thanks);
    }
    // update Gettext Databases if on back-end
    if ($q_config['auto_update_mo']) {
        require_once dirname(__FILE__) . '/qtx_update_gettext_db.php';
        qtranxf_updateGettextDatabases();
    }
    // update definitions if necessary
    if (current_user_can('manage_categories')) {
        //qtranxf_updateTermLibrary();
        qtranxf_updateTermLibraryJoin();
    }
}
function qtranxf_admin_load()
{
    //qtranxf_dbg_log('qtranxf_admin_load:');
    qtranxf_admin_loadConfig();
    $bnm = qtranxf_plugin_basename();
    add_filter('plugin_action_links_' . $bnm, 'qtranxf_links', 10, 4);
    add_action('qtranslate_init_language', 'qtranxf_load_admin_page_config', 20);
    //should be excuted after all plugins loaded their *-admin.php
    qtranxf_add_admin_filters();
}
Beispiel #3
0
function qtranxf_admin_init()
{
    global $q_config, $pagenow;
    //qtranxf_dbg_log('"admin_init": qtranxf_admin_init: REQUEST_TIME_FLOAT: ', $_SERVER['REQUEST_TIME_FLOAT']);
    qtranxf_admin_loadConfig();
    add_action('admin_notices', 'qtranxf_admin_notices_config');
    if (current_user_can('manage_options') && $pagenow == 'options-general.php' && isset($q_config['url_info']['query']) && strpos($q_config['url_info']['query'], 'page=qtranslate-x') !== false) {
        $q_config['url_info']['qtranslate-settings-url'] = admin_url('options-general.php?page=qtranslate-x');
        require_once QTRANSLATE_DIR . '/admin/qtx_admin_options_update.php';
        //call_user_func('qtranxf_editConfig');
        qtranxf_editConfig();
    }
    $next_thanks = get_option('qtranslate_next_thanks');
    if ($next_thanks !== false && $next_thanks < time()) {
        $messages = get_option('qtranslate_admin_notices');
        if (isset($messages['next_thanks'])) {
            unset($messages['next_thanks']);
            update_option('qtranslate_admin_notices', $messages);
        }
        $next_thanks = false;
    }
    if ($next_thanks === false) {
        $next_thanks = time() + rand(100, 300) * 24 * 60 * 60;
        update_option('qtranslate_next_thanks', $next_thanks);
    }
    if ($q_config['auto_update_mo']) {
        qtranxf_updateGettextDatabases();
    }
    // update definitions if necessary
    if (current_user_can('manage_categories')) {
        //qtranxf_updateTermLibrary();
        qtranxf_updateTermLibraryJoin();
        //qtranxf_updateSlug();
    }
    $page_configs = qtranxf_get_admin_page_config();
    if (!empty($page_configs['']['filters'])) {
        qtranxf_add_filters($page_configs['']['filters']);
    }
}
function qtranxf_reloadConfig()
{
    global $q_config;
    $url_info = isset($q_config['url_info']) ? $q_config['url_info'] : null;
    //qtranxf_dbg_log('qtranxf_reloadConfig: $url_info: ',$url_info);
    qtranxf_del_conf_filters();
    qtranxf_loadConfig();
    qtranxf_admin_loadConfig();
    if ($url_info) {
        $q_config['url_info'] = $url_info;
        if (isset($q_config['url_info']['language'])) {
            $q_config['language'] = $q_config['url_info']['language'];
        }
        if (!qtranxf_isEnabled($q_config['language'])) {
            $q_config['language'] = $q_config['default_language'];
        }
        //qtranxf_dbg_log('qtranxf_reloadConfig: $q_config[language]: ',$q_config['language']);
    }
    qtranxf_load_option_qtrans_compatibility();
}
Beispiel #5
0
function qtranxf_admin_load()
{
    //qtranxf_dbg_log('qtranxf_admin_load:');
    qtranxf_admin_loadConfig();
    $page_configs = qtranxf_get_admin_page_config();
    if (!empty($page_configs['']['filters'])) {
        qtranxf_add_filters($page_configs['']['filters']);
    }
    $bnm = qtranxf_plugin_basename();
    add_filter('plugin_action_links_' . $bnm, 'qtranxf_links', 10, 4);
    qtranxf_add_admin_filters();
}