Plugin Directory

Changeset 1039904


Ignore:
Timestamp:
12/07/2014 05:21:58 PM (11 years ago)
Author:
chsxf
Message:

Version 2.9

  • Support for WordPress 4.1
  • Fixed mislocation of inserted media in the wrong languages when using

the text editor

  • Added option for secure cookies
Location:
mqtranslate/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • mqtranslate/trunk/mqtranslate.php

    r1039903 r1039904  
    44Plugin URI: http://wordpress.org/plugins/mqtranslate/
    55Description: Adds userfriendly multilingual content support into Wordpress. mqTranslate is a fork of the well-known <a href="http://www.qianqin.de/mqtranslate/">qTranslate</a> plugin by <a href="http://www.qianqin.de/">Qian Qin</a>, extending the original software with collaborative and team-oriented features.
    6 Version: 2.8
     6Version: 2.9
    77Author: xhaleera
    88Author URI: http://www.xhaleera.com
     
    9595// Can be changed to use with other versions but might cause problems and/or data loss!
    9696define('QT_MIN_SUPPORTED_WP_MINOR_VERSION', '3.9');
    97 define('QT_MAX_SUPPORTED_WP_MAJOR_VERSION', '4.0');
     97define('QT_MAX_SUPPORTED_WP_MAJOR_VERSION', '4.1');
    9898define('QT_STRING',     1);
    9999define('QT_BOOLEAN',    2);
     
    471471$q_config['disable_header_css'] = 0;
    472472
     473// Use secure cookie
     474$q_config['use_secure_cookie'] = 0;
     475
    473476// Load mqTranslate
    474477require_once(dirname(__FILE__)."/mqtranslate_javascript.php");
  • mqtranslate/trunk/mqtranslate_configuration.php

    r989059 r1039904  
    232232        qtrans_checkSetting('hide_default_language',    true, QT_BOOLEAN);
    233233        qtrans_checkSetting('disable_header_css',       true, QT_BOOLEAN);
     234        qtrans_checkSetting('use_secure_cookie',        true, QT_BOOLEAN);
    234235       
    235236        if (isset($_POST['allowed_custom_post_types']))
     
    541542                <th scope="row"><?php _e('Remove plugin CSS from head', 'mqtranslate'); ?></th>
    542543                <td>
    543                     <label for="disable_header_css"><input type="checkbox" name="disable_header_css" id="disable_header_css" value="1"<?php echo empty($q_config['disable_header_css']) ? '' : ' checked="checked"' ?>" /> <?php _e('Remove inline CSS code added by plugin from the head', 'mqtranslate'); ?></label>
     544                    <label for="disable_header_css"><input type="checkbox" name="disable_header_css" id="disable_header_css" value="1"<?php echo empty($q_config['disable_header_css']) ? '' : ' checked="checked"' ?> /> <?php _e('Remove inline CSS code added by plugin from the head', 'mqtranslate'); ?></label>
    544545                    <br />
    545546                    <small><?php _e('This will remove default styles applyied to mqTranslate Language Chooser', 'mqtranslate') ?></small>
     547                </td>
     548            </tr>
     549            <tr valign="top">
     550                <th scope="row"><?php _e('Use Secure Cookie', 'mqtranslate'); ?></th>
     551                <td>
     552                    <label for="use_secure_cookie"><input type="checkbox" name="use_secure_cookie" id="use_secure_cookie" value="1"<?php echo empty($q_config['use_secure_cookie']) ? '' : ' checked="checked"' ?> /> <?php _e('Make mqTranslate cookie available only through HTTPS connections', 'mqtranslate'); ?> </label>
     553                    <br />
     554                    <small><?php _e("Don't check this if you don't know what you're doing!", 'mqtranslate') ?></small>
    546555                </td>
    547556            </tr>
  • mqtranslate/trunk/mqtranslate_core.php

    r1014363 r1039904  
    4949        delete_option('mqtranslate_allowed_custom_post_types');
    5050        delete_option('mqtranslate_disable_header_css');
     51        delete_option('mqtranslate_use_secure_cookie');
    5152        if(isset($_POST['mqtranslate_reset3'])) {
    5253            delete_option('mqtranslate_term_name');
     
    8384   
    8485    // set test cookie
    85     setcookie('qtrans_cookie_test', 'mqTranslate Cookie Test', 0, $q_config['url_info']['home'], $q_config['url_info']['host']);
     86    setcookie('qtrans_cookie_test', 'mqTranslate Cookie Test', 0, $q_config['url_info']['home'], $q_config['url_info']['host'], !empty($q_config['use_secure_cookie']));
    8687    // check cookies for admin
    8788    if(defined('WP_ADMIN')) {
    8889        if(isset($_GET['lang']) && qtrans_isEnabled($_GET['lang'])) {
    8990            $q_config['language'] = $q_config['url_info']['language'];
    90             setcookie('qtrans_admin_language', $q_config['language'], time()+60*60*24*30);
     91            setcookie('qtrans_admin_language', $q_config['language'], time()+60*60*24*30, !empty($q_config['use_secure_cookie']));
    9192        } elseif(isset($_COOKIE['qtrans_admin_language']) && qtrans_isEnabled($_COOKIE['qtrans_admin_language'])) {
    9293            $q_config['language'] = $_COOKIE['qtrans_admin_language'];
     
    287288    $allowed_custom_post_types = get_option('mqtranslate_allowed_custom_post_types');
    288289    $disable_header_css = get_option('mqtranslate_disable_header_css');
     290    $use_secure_cookie = get_option('mqtranslate_use_secure_cookie');
    289291   
    290292    // default if not set
     
    317319    $hide_default_language = qtrans_validateBool($hide_default_language, $q_config['hide_default_language']);
    318320    $disable_header_css = qtrans_validateBool($disable_header_css, $q_config['disable_header_css']);
     321    $use_secure_cookie = qtrans_validateBool($use_secure_cookie, $q_config['use_secure_cookie']);
    319322   
    320323    // url fix for upgrading users
     
    346349    $q_config['allowed_custom_post_types'] = $allowed_custom_post_types;
    347350    $q_config['disable_header_css'] = $disable_header_css;
     351    $q_config['use_secure_cookie'] = $use_secure_cookie;
    348352   
    349353    do_action('mqtranslate_loadConfig');
     
    391395    update_option('mqtranslate_allowed_custom_post_types', implode(',', $q_config['allowed_custom_post_types']));
    392396    update_option('mqtranslate_disable_header_css', $q_config['disable_header_css'] ? '1' : '0');
     397    update_option('mqtranslate_use_secure_cookie', $q_config['use_secure_cookie'] ? '1' : '0');
    393398       
    394399    do_action('mqtranslate_saveConfig');
  • mqtranslate/trunk/mqtranslate_javascript.php

    r1014364 r1039904  
    236236        jQuery('.wp-editor-wrap').mousedown(function(e){
    237237            wpActiveEditor = 'qtrans_textarea_'+this.id.slice(3, -5);
     238            jQuery('#insert-media-button').data('editor', 'qtrans_textarea_' + this.id.slice(3, -5));
    238239        });
    239240        ";
  • mqtranslate/trunk/mqtranslate_wphacks.php

    r989060 r1039904  
    398398
    399399function qtrans_createEditorToolbarButton($language, $id, $js_function = 'switchEditors.go', $label = ''){
    400     global $q_config;
     400    global $q_config, $wp_version;
    401401   
    402402    $cu = wp_get_current_user();
     
    407407        $title .= ' - ' . __('Read only', 'mqtranslate');
    408408   
    409     $html = "
    410         var bc = document.getElementById('wp-".$id."-editor-tools');
    411         var mb = document.getElementById('wp-".$id."-media-buttons');
    412         var ls = document.createElement('a');
    413         var l = document.createTextNode('{$title}');
    414         ls.id = 'qtrans_select_".$language."';
    415         ls.className = 'wp-switch-editor';
    416         ls.onclick = function() { ".$js_function."('".$id."','".$language."'); };
    417         ls.appendChild(l);
    418         bc.insertBefore(ls,mb);
    419         ";
     409    if (version_compare($wp_version, '4.1-beta', '<'))
     410    {
     411        $html = "
     412            var bc = document.getElementById('wp-".$id."-editor-tools');
     413            var mb = document.getElementById('wp-".$id."-media-buttons');
     414            var ls = document.createElement('a');
     415            var l = document.createTextNode('{$title}');
     416            ls.id = 'qtrans_select_".$language."';
     417            ls.className = 'wp-switch-editor';
     418            ls.onclick = function() { ".$js_function."('".$id."','".$language."'); };
     419            ls.appendChild(l);
     420            bc.insertBefore(ls,mb);
     421            ";
     422    }
     423    else {
     424        $html = "
     425            var before = jQuery('#{$id}-html');
     426            var html = '<button id=\"qtrans_select_{$language}\" class=\"wp-switch-editor\" onclick=\"{$js_function}(\'{$id}\', \'{$language}\');\" type=\"button\">{$title}</button>';
     427            jQuery(html).insertAfter(before);
     428            ";
     429    }
    420430    return $html;
    421431}
  • mqtranslate/trunk/readme.txt

    r1039903 r1039904  
    33Tags: multilingual, language, admin, tinymce, bilingual, widget, switcher, i18n, l10n, multilanguage, professional, translation, service, human
    44Requires at least: 3.9
    5 Tested up to: 4.0
    6 Stable tag: 2.8
     5Tested up to: 4.1
     6Stable tag: 2.9
    77Donate Link: http://www.xhaleera.com/
    88License: GPLv2
     
    7171== Changelog ==
    7272
     732.9:
     74
     75- Support for WordPress 4.1
     76- Fixed mislocation of inserted media in the wrong languages when using the text editor
     77- Added option for secure cookies
     78
    73792.8:
    7480
Note: See TracChangeset for help on using the changeset viewer.