Plugin Directory

Changeset 1372623


Ignore:
Timestamp:
03/16/2016 08:45:26 PM (10 years ago)
Author:
webilop
Message:

1.6.6

Location:
user-language-switch
Files:
83 added
4 edited

Legend:

Unmodified
Added
Removed
  • user-language-switch/trunk/js/event_select.js

    r1308654 r1372623  
    1 jQuery(document).ready(function($) { 
    2   var actual_value = jQuery("select#uls_language").val(); 
     1jQuery(document).ready(function($) {
     2  var actual_value = jQuery("select#uls_language").val();
    33  jQuery("select#uls_language").change(
    44    function() {
  • user-language-switch/trunk/readme.txt

    r1368705 r1372623  
    88Requires at least: 4.0
    99Tested up to: 4.4
    10 Stable tag: 1.6.4
     10Stable tag: 1.6.6
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    167167= 1.6.5 =
    168168* Fix post-type issue
     169= 1.6.6 =
     170* Include survey for professional translators
    169171
    170172== Upgrade Notice ==
  • user-language-switch/trunk/uls-options.php

    r1351035 r1372623  
    66   static private $default_options = array(
    77      'uls_plugin_version' => '1.5',
     8      'uls_plugin_question' => false,
    89      'user_backend_configuration' => true,
    910      'user_frontend_configuration' => true,
     
    4647    //get options
    4748    $options = get_option('uls_settings');
     49    $option_question = get_option('uls_settings_question');
     50    if (empty($option_question)) {
     51      add_action('admin_notices', 'ULS_Options::uls_admin_notice_question');
     52    }
    4853
    4954    //create about section
     
    279284      'ULS_Options::create_settings_page' );
    280285
    281     //if users can configurate their languages
    282     /*$options = get_option('uls_settings');
    283     if($options['user_backend_configuration'] || $options['user_frontend_configuration'])
    284       add_menu_page( __('User Language Preferences','user-language-switch'),
    285         __('User Language','user-language-switch'),
    286         'read',
    287         'uls-user-language-page',
    288         'ULS_Options::create_user_language_page' );*/
    289   }
     286  }
     287  /**
     288   * function uls_admin_notice_question
     289   * this function is to show the message in the admin panel
     290   */
     291  static function uls_admin_notice_question() {
     292  ?>
     293    <div class="notice notice-success is-dismissible">
     294        <div id="content_question_display">
     295          <p><?php _e( 'Would you like to help you to contact a professional translator for your site.', 'user-language-switch' ); ?></p>
     296          <button id="uls_answere_traductor_yes" type="button" name="answere_yes" class="button button-primary uls_answere_button">YES</button>
     297          <button id="uls_answere_traductor_not" type="button" name="answere_not" class="button button-primary uls_answere_button">NO</button>
     298        </div>
     299    </div>
     300  <?php
     301  }
     302  /**
     303   * function: uls_answere_question_contact
     304   * this is an ajax function to change value of the uls_plugin_question to not show
     305   * the question again and send the information to this url:
     306   * http://dev.webilop.com/webilop-3.0/wp-admin/admin-ajax.php?action=store_answer&answer=yes&domain=awesome-site.com&email=aritoma@gmail.com
     307  */
     308  static function uls_answere_question_contact() {
     309    $answere_question = isset($_POST['button_answere_value']) ? $_POST['button_answere_value'] : '';
     310    if (!empty($answere_question)) {
     311
     312      if ($answere_question == 'answere_yes' )
     313        $answere = "yes";
     314      else
     315        $answere = "no";
     316
     317      $user = wp_get_current_user();
     318      $user_email = $user->user_email;
     319      $site_url = get_site_url();
     320      $site_url = preg_replace('#^https?://#', '', $site_url);
     321      $url = "http://webilop.com/wp-admin/admin-ajax.php?action=store_answer&answer=$answere&domain=$site_url&email=$user_email";
     322
     323      $ch = curl_init();
     324      curl_setopt($ch, CURLOPT_URL, $url);
     325      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     326      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     327      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
     328      $response = curl_exec($ch);
     329      curl_close($ch);
     330
     331      $uls_options = add_option('uls_settings_question',  $answere);
     332
     333      $message = " <br/> The information was save <br/>";
     334      echo $message ; exit;
     335    }
     336    echo "0"; exit;
     337  }
     338
    290339
    291340   /**
     
    854903 */
    855904add_action('wp_ajax_uls_download_language', 'ULS_Options::download_language');
     905/**
     906 * Add ajax action to answere the question
     907 */
     908add_action('wp_ajax_uls_answere_question_contact', 'ULS_Options::uls_answere_question_contact');
    856909
    857910?>
  • user-language-switch/trunk/user-language-switch.php

    r1368705 r1372623  
    33Plugin Name: User Language Switch
    44Description: Build a multilingual and SEO friendly website. Linking translations of content and allow visitors to browse your website in different languages.
    5 Version: 1.6.5
     5Version: 1.6.6
    66Author: webilop
    77Author URI: http://www.webilop.com
     
    10431043  wp_enqueue_style( 'html-style' );
    10441044  wp_enqueue_style( 'webilop-flags_16x11-style', plugins_url('css/flags/flags_16x11.css', __FILE__) );
     1045  wp_enqueue_script( 'add_admin_questions_js',   WP_CONTENT_URL . '/plugins/user-language-switch/js/admin_questions.js', array('jquery') );
    10451046}
    10461047add_action( 'admin_enqueue_scripts', 'uls_add_styles' );
Note: See TracChangeset for help on using the changeset viewer.