Plugin Directory

Changeset 834867


Ignore:
Timestamp:
01/08/2014 11:10:37 AM (12 years ago)
Author:
Potsky
Message:

Version 0.4.11 in trunk

Location:
s2member-secure-file-browser/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • s2member-secure-file-browser/trunk/class/psk_s2msfb.class.php

    r728335 r834867  
    279279
    280280
    281     /*
     281    /**
    282282     * Load javascript and css for Public and Admin part
    283      * Called from the shortcode only !
    284283     *
    285284     * @return          void
    286285     */
    287     /**
    288      *
    289      */
    290286    public static function init_assets() {
    291         wp_deregister_script( 'jquery' );
    292         wp_register_script( 'jquery' , PSK_S2MSFB_JS_URL . 'jquery-1.8.3.min.js' , false );
    293287        wp_enqueue_script( 'jquery' );
    294     }
    295 
    296 
    297     /*
    298      * WP wp_enqueue_scripts
    299      * Load javascript and css for Public and Admin part
    300      *
    301      * @param  array $atts        the arguments from the editor
    302      *
    303      * @return void
    304      */
    305     public static function init_shortcode_assets( $atts ) {
    306 
    307         if ( isset( $atts[ 'previewext' ] ) ) {
    308             foreach ( explode( ',' , $atts[ 'previewext' ] ) as $ext ) {
    309                 switch ( trim( strtolower( $ext ) ) ) {
    310                     case 'mp3':
    311                         wp_register_script( 'jquery.jplayer' , PSK_S2MSFB_JS_URL . 'jquery.jplayer.min.js' , array( 'jquery' ) , '2.2.0' , true );
    312                         wp_enqueue_script( 'jquery.jplayer' );
    313                         break;
    314                     case 'jpg':
    315                     case 'jpeg':
    316                     case 'gif':
    317                     case 'png':
    318                         wp_register_script( 'jquery.prettyPhoto' , PSK_S2MSFB_JS_URL . 'jquery.prettyPhoto.js' , array( 'jquery' ) , '3.1.5' , true );
    319                         wp_enqueue_script( 'jquery.prettyPhoto' );
    320                         wp_register_style( 'jquery.prettyPhoto' , PSK_S2MSFB_CSS_URL . 'prettyPhoto.css' );
    321                         wp_enqueue_style( 'jquery.prettyPhoto' );
    322                         break;
    323                     default:
    324                         break;
    325                 }
    326             }
    327         }
    328 
    329         wp_enqueue_script( PSK_S2MSFB_ID , PSK_S2MSFB_JS_URL . 'jqueryFileTree.' . PSK_S2MSFB_EXT_JS , array( 'jquery' ) , false , true );
    330         wp_register_style( PSK_S2MSFB_ID , PSK_S2MSFB_CSS_URL . 'jqueryFileTree.' . PSK_S2MSFB_EXT_CSS );
    331         wp_enqueue_style( PSK_S2MSFB_ID );
     288        wp_enqueue_script( PSK_S2MSFB_ID , PSK_S2MSFB_JS_URL . 'jqueryFileTree.' . PSK_S2MSFB_EXT_JS , array( 'jquery' ) , false , false );
     289        wp_enqueue_style( PSK_S2MSFB_ID , PSK_S2MSFB_CSS_URL . 'jqueryFileTree.' . PSK_S2MSFB_EXT_CSS );
    332290
    333291        // Set localize javascript
    334292        $prefix = ( is_admin() ) ? 'admin_' : '';
    335293        wp_localize_script( PSK_S2MSFB_ID , __CLASS__ , array(
    336                                                              'imgurl'         => PSK_S2MSFB_IMG_URL ,
    337                                                              'ajaxurl'        => admin_url( 'admin-ajax.php' ) ,
    338                                                              'nonce'          => wp_create_nonce( PSK_S2MSFB_ID . '-nonce' ) ,
    339                                                              'errorsearch'    => __( 'Please type some words!' , PSK_S2MSFB_ID ) ,
    340                                                              'action_get_dir' => $prefix . PSK_S2MSFB_ID . '_get_dir' ,
    341                                                              'action_df'      => $prefix . PSK_S2MSFB_ID . '_df' ,
    342                                                              'action_cf'      => $prefix . PSK_S2MSFB_ID . '_cf' ,
    343                                                              'action_rf'      => $prefix . PSK_S2MSFB_ID . '_rf' ,
    344                                                              'action_nf'      => $prefix . PSK_S2MSFB_ID . '_nf' ,
    345                                                         ) );
    346 
     294             'imgurl'         => PSK_S2MSFB_IMG_URL ,
     295             'ajaxurl'        => admin_url( 'admin-ajax.php' ) ,
     296             'nonce'          => wp_create_nonce( PSK_S2MSFB_ID . '-nonce' ) ,
     297             'errorsearch'    => __( 'Please type some words!' , PSK_S2MSFB_ID ) ,
     298             'action_get_dir' => $prefix . PSK_S2MSFB_ID . '_get_dir' ,
     299             'action_df'      => $prefix . PSK_S2MSFB_ID . '_df' ,
     300             'action_cf'      => $prefix . PSK_S2MSFB_ID . '_cf' ,
     301             'action_rf'      => $prefix . PSK_S2MSFB_ID . '_rf' ,
     302             'action_nf'      => $prefix . PSK_S2MSFB_ID . '_nf' ,
     303        ) );
     304
     305        /*
     306         * Load these assets here and not on demand when the shortcode is used because some themes load the content in ajax requests !
     307         */
     308        wp_register_script( 'jquery.jplayer' , PSK_S2MSFB_JS_URL . 'jquery.jplayer.min.js' , array( 'jquery' ) , '2.2.0' , true );
     309        wp_enqueue_script( 'jquery.jplayer' );
     310        wp_register_script( 'jquery.prettyPhoto' , PSK_S2MSFB_JS_URL . 'jquery.prettyPhoto.js' , array( 'jquery' ) , '3.1.5' , true );
     311        wp_enqueue_script( 'jquery.prettyPhoto' );
     312        wp_register_style( 'jquery.prettyPhoto' , PSK_S2MSFB_CSS_URL . 'prettyPhoto.css' );
     313        wp_enqueue_style( 'jquery.prettyPhoto' );
    347314    }
    348315
     
    12991266    public
    13001267    static function shortcode_s2member_secure_files_browser( $atts ) {
    1301         self::init_shortcode_assets( $atts );
    1302 
    13031268        $i = self::$shortcode_instance;
    13041269        self::$shortcode_instance ++;
  • s2member-secure-file-browser/trunk/inc/tools.class.php

    r704612 r834867  
    2626 */
    2727class PSK_Tools {
     28
     29    public static function log( $message ) {
     30        file_put_contents( dirname( __FILE__ ) . '/../log.txt' , date('Y/m/d H:i:s') . ' | ' . $_SERVER['REMOTE_ADDR'] . ' | ' . $message . "\n" , FILE_APPEND );
     31    }
    2832
    2933    /**
  • s2member-secure-file-browser/trunk/readme.txt

    r824919 r834867  
    55Requires at least: 3.3
    66Tested up to: 3.8
    7 Stable tag: 0.4.10
     7Stable tag: 0.4.11
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    193193== Changelog ==
    194194
     195= 0.4.11 =
     196* Enhancement : plugin now always loads assets at the beginning even if the shortcode is not used on a page. It handles by this way some themes which load page content next to the assets.
     197
    195198= 0.4.10 =
    196199* Enhancement : plugin now checks by itself the wordpress upgrade include (problem with some customers)
  • s2member-secure-file-browser/trunk/s2member-secure-file-browser.php

    r824919 r834867  
    66                You can display the file browser via the shortcode [s2member_secure_files_browser /].
    77                You can manage files and get statistics in the Dashboard > s2Member > Secure File Browser
    8 Version: 0.4.10
    9 Date: 2013-12-16
     8Version: 0.4.11
     9Date: 2014-01-08
    1010Author: Potsky
    1111Author URI: http://www.potsky.com/about/
    1212Licence:
    13     Copyright © 2013 Raphael Barbate (potsky) <potsky@me.com> [http://www.potsky.com]
     13    Copyright © 2014 Raphael Barbate (potsky) <potsky@me.com> [http://www.potsky.com]
    1414    This file is part of s2member Secure File Browser.
    1515
Note: See TracChangeset for help on using the changeset viewer.