Esempio n. 1
0
function qtranxf_admin_loadConfig()
{
    global $q_config, $qtranslate_options;
    qtranxf_admin_set_default_options($qtranslate_options);
    foreach ($qtranslate_options['admin']['int'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['bool'] as $nm => $def) {
        qtranxf_load_option_bool($nm, $def);
    }
    foreach ($qtranslate_options['admin']['str'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['text'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['array'] as $nm => $def) {
        qtranxf_load_option_array($nm, $def);
    }
    if (empty($q_config['admin_config'])) {
        require_once QTRANSLATE_DIR . '/admin/qtx_admin_options_update.php';
        qtranxf_update_i18n_config();
    }
    /**
     * Opportunity to load additional admin features.
     */
    do_action('qtranslate_admin_loadConfig');
    qtranxf_add_conf_filters();
}
Esempio n. 2
0
function qtranxf_admin_loadConfig()
{
    global $q_config, $qtranslate_options;
    qtranxf_admin_set_default_options($qtranslate_options);
    foreach ($qtranslate_options['admin']['int'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['bool'] as $nm => $def) {
        qtranxf_load_option_bool($nm, $def);
    }
    foreach ($qtranslate_options['admin']['str'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['text'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['array'] as $nm => $def) {
        qtranxf_load_option_array($nm, $def);
    }
    qtranxf_add_admin_filters();
    do_action('qtranslate_admin_loadConfig');
}
function qtranxf_admin_loadConfig()
{
    global $q_config, $qtranslate_options;
    qtranxf_admin_set_default_options($qtranslate_options);
    foreach ($qtranslate_options['admin']['int'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['bool'] as $nm => $def) {
        qtranxf_load_option_bool($nm, $def);
    }
    foreach ($qtranslate_options['admin']['str'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['text'] as $nm => $def) {
        qtranxf_load_option($nm, $def);
    }
    foreach ($qtranslate_options['admin']['array'] as $nm => $def) {
        qtranxf_load_option_array($nm, $def);
    }
    if (empty($q_config['admin_config'])) {
        require_once QTRANSLATE_DIR . '/admin/qtx_admin_options_update.php';
        qtranxf_update_i18n_config();
    }
    // Set Admin Sections Names
    $q_config['admin_sections'] = array();
    $admin_sections =& $q_config['admin_sections'];
    $admin_sections['general'] = __('General', 'qtranslate');
    //General Settings
    $admin_sections['advanced'] = __('Advanced', 'qtranslate');
    //Advanced Settings
    do_action('qtranslate_admin_loadConfig');
    $admin_sections['integration'] = __('Integration', 'qtranslate');
    //Custom Integration
    $admin_sections['import'] = __('Import', 'qtranslate') . '/' . __('Export', 'qtranslate');
    $admin_sections['languages'] = __('Languages', 'qtranslate');
    //always last section
    qtranxf_add_admin_filters();
}
/**
 * Updates 'admin_config' and 'front_config' from *.json files listed in option 'config_files', and option 'custom_i18n_config'.
 * @since 3.3.1
 */
function qtranxf_update_i18n_config()
{
    global $q_config;
    if (!isset($q_config['config_files'])) {
        global $qtranslate_options;
        qtranxf_admin_set_default_options($qtranslate_options);
        qtranxf_load_option_array('config_files', $qtranslate_options['admin']['array']['config_files']);
        qtranxf_load_option_array('custom_i18n_config', $qtranslate_options['admin']['array']['custom_i18n_config']);
    }
    $json_files = $q_config['config_files'];
    $custom_i18n_config = $q_config['custom_i18n_config'];
    $cfg = qtranxf_load_config_all($json_files, $custom_i18n_config);
    if ($q_config['admin_config'] !== $cfg['admin-config']) {
        $q_config['admin_config'] = $cfg['admin-config'];
        qtranxf_update_option('admin_config');
    }
    if ($q_config['front_config'] !== $cfg['front-config']) {
        $q_config['front_config'] = $cfg['front-config'];
        qtranxf_update_option('front_config');
    }
}