public function renderUploadform()
 {
     $user_can_upload = false;
     if ($this->checkUserRole($this->options['upload_role'])) {
         $user_can_upload = true;
     }
     $directupload = $this->options['upload_simple'];
     /* Direct upload (remove cancel and start button) */
     if ($this->options['upload'] === '1' && $user_can_upload) {
         $post_max_size_bytes = min(UseyourDrive_return_bytes(ini_get('post_max_size')), UseyourDrive_return_bytes(ini_get('upload_max_filesize')));
         $post_max_size_str = UseyourDrive_bytesToSize1024($post_max_size_bytes);
         $acceptfiletypes = '.(' . $this->options['upload_ext'] . ')$';
         $this->loadScripts('upload');
         include sprintf("%s/templates/uploadform.php", USEYOURDRIVE_ROOTDIR);
     }
 }
Ejemplo n.º 2
0
 public function LoadScripts()
 {
     wp_register_script('jquery.requestAnimationFrame', plugins_url('includes/iLightBox/js/jquery.requestAnimationFrame.js', __FILE__), array('jquery'), filemtime(plugin_dir_path(__FILE__) . 'includes/iLightBox/js/jquery.requestAnimationFrame.js'));
     wp_register_script('jquery.mousewheel', plugins_url('includes/iLightBox/js/jquery.mousewheel.js', __FILE__), array('jquery'), filemtime(plugin_dir_path(__FILE__) . 'includes/iLightBox/js/jquery.mousewheel.js'));
     wp_register_script('ilightbox', plugins_url('includes/iLightBox/js/ilightbox.packed.js', __FILE__), array('jquery', 'jquery.requestAnimationFrame', 'jquery.mousewheel'), filemtime(plugin_dir_path(__FILE__) . 'includes/iLightBox/js/ilightbox.packed.js'));
     wp_register_script('collagePlus', plugins_url('includes/collagePlus/jquery.collagePlus.min.js', __FILE__), array('jquery'), filemtime(plugin_dir_path(__FILE__) . 'includes/collagePlus/jquery.collagePlus.min.js'));
     wp_register_script('removeWhitespace', plugins_url('includes/collagePlus/extras/jquery.removeWhitespace.min.js', __FILE__), array('jquery'), filemtime(plugin_dir_path(__FILE__) . 'includes/collagePlus/extras/jquery.removeWhitespace.min.js'));
     wp_register_script('unveil', plugins_url('includes/jquery-unveil/jquery.unveil.min.js', __FILE__), array('jquery'), false, true);
     $skin = $this->settings['mediaplayer_skin'];
     if (!file_exists(USEYOURDRIVE_ROOTDIR . "/skins/{$skin}/UseyourDrive_Media.js") || !file_exists(USEYOURDRIVE_ROOTDIR . "/skins/{$skin}/css/style.css") || !file_exists(USEYOURDRIVE_ROOTDIR . "/skins/{$skin}/player.php")) {
         $skin = 'default';
     }
     wp_register_style('UseyourDrive.Media', plugins_url("/skins/{$skin}/css/style.css", __FILE__), false, filemtime(USEYOURDRIVE_ROOTDIR . "/skins/{$skin}/css/style.css"));
     wp_register_script('jQuery.jplayer', plugins_url("/skins/{$skin}/jquery.jplayer/jplayer.playlist.min.js", __FILE__), array('jquery'));
     wp_register_script('jQuery.jplayer.playlist', plugins_url("/skins/{$skin}/jquery.jplayer/jquery.jplayer.min.js", __FILE__), array('jquery'));
     wp_register_script('UseyourDrive.Media', plugins_url("/skins/{$skin}/UseyourDrive_Media.js", __FILE__), array('jquery'), false, true);
     /* load in footer */
     wp_register_script('jQuery.iframe-transport', plugins_url('includes/jquery-file-upload/js/jquery.iframe-transport.js', __FILE__), array('jquery'), false, true);
     wp_register_script('jQuery.fileupload', plugins_url('includes/jquery-file-upload/js/jquery.fileupload.js', __FILE__), array('jquery'), false, true);
     wp_register_script('jQuery.fileupload-process', plugins_url('includes/jquery-file-upload/js/jquery.fileupload-process.js', __FILE__), array('jquery'), false, true);
     wp_register_script('jQuery.fileupload-validate', plugins_url('includes/jquery-file-upload/js/jquery.fileupload-validate.js', __FILE__), array('jquery'), false, true);
     wp_register_script('jQuery.fileupload-ui', plugins_url('includes/jquery-file-upload/js/jquery.fileupload-ui.js', __FILE__), array('jquery'), false, true);
     wp_register_script('jQuery.fileupload-jquery-ui', plugins_url('includes/jquery-file-upload/js/jquery.fileupload-jquery-ui.js', __FILE__), array('jquery'), false, true);
     wp_register_script('UseyourDrive', plugins_url('includes/UseyourDrive.js', __FILE__), array('jquery'), filemtime(plugin_dir_path(__FILE__) . 'includes/UseyourDrive.js'), true);
     wp_enqueue_script('unveil');
     $post_max_size_bytes = min(UseyourDrive_return_bytes(ini_get('post_max_size')), UseyourDrive_return_bytes(ini_get('upload_max_filesize')));
     $localize = array('plugin_ver' => USEYOURDRIVE_VERSION, 'plugin_url' => plugins_url('', __FILE__), 'ajax_url' => admin_url('admin-ajax.php'), 'js_url' => plugins_url('/skins/' . $this->settings['mediaplayer_skin'] . '/jquery.jplayer', __FILE__), 'is_mobile' => wp_is_mobile(), 'lightbox_skin' => $this->settings['lightbox_skin'], 'lightbox_path' => $this->settings['lightbox_path'], 'post_max_size' => $post_max_size_bytes, 'google_analytics' => $this->settings['google_analytics'] === 'Yes' ? 1 : 0, 'refresh_nonce' => wp_create_nonce("useyourdrive-get-filelist"), 'gallery_nonce' => wp_create_nonce("useyourdrive-get-gallery"), 'upload_nonce' => wp_create_nonce("useyourdrive-upload-file"), 'delete_nonce' => wp_create_nonce("useyourdrive-delete-entry"), 'rename_nonce' => wp_create_nonce("useyourdrive-rename-entry"), 'move_nonce' => wp_create_nonce("useyourdrive-move-entry"), 'description_nonce' => wp_create_nonce("useyourdrive-edit-description-entry"), 'addfolder_nonce' => wp_create_nonce("useyourdrive-add-folder"), 'getplaylist_nonce' => wp_create_nonce("useyourdrive-get-playlist"), 'createzip_nonce' => wp_create_nonce("useyourdrive-create-zip"), 'createlink_nonce' => wp_create_nonce("useyourdrive-create-link"), 'str_success' => __('Success', 'useyourdrive'), 'str_error' => __('Error', 'useyourdrive'), 'str_inqueue' => __('In queue', 'useyourdrive'), 'str_uploading' => __('Uploading', 'useyourdrive'), 'str_error_title' => __('Error', 'useyourdrive'), 'str_close_title' => __('Close', 'useyourdrive'), 'str_start_title' => __('Start', 'useyourdrive'), 'str_cancel_title' => __('Cancel', 'useyourdrive'), 'str_delete_title' => __('Delete', 'useyourdrive'), 'str_save_title' => __('Save', 'useyourdrive'), 'str_zip_title' => __('Create zip file', 'useyourdrive'), 'str_delete' => __('Do you really want to delete:', 'useyourdrive'), 'str_delete_multiple' => __('Do you really want to delete these files?', 'useyourdrive'), 'str_rename_title' => __('Rename', 'useyourdrive'), 'str_rename' => __('Rename to:', 'useyourdrive'), 'str_no_filelist' => __("Oops! This shouldn't happen... Try again!", 'useyourdrive'), 'str_addfolder_title' => __('Add folder', 'useyourdrive'), 'str_addfolder' => __('New folder', 'useyourdrive'), 'str_zip_nofiles' => __('No files found or selected', 'useyourdrive'), 'str_zip_createzip' => __('Creating zip file', 'useyourdrive'), 'str_share_link' => __('Share file', 'useyourdrive'), 'str_create_shared_link' => __('Creating shared link...', 'useyourdrive'), 'str_previous_title' => __('Previous', 'useyourdrive'), 'str_next_title' => __('Next', 'useyourdrive'), 'str_xhrError_title' => __('This content failed to load', 'useyourdrive'), 'str_imgError_title' => __('This image failed to load', 'useyourdrive'), 'str_startslideshow' => __('Start slideshow', 'useyourdrive'), 'str_stopslideshow' => __('Stop slideshow', 'useyourdrive'), 'str_nolink' => __('Not yet linked to a folder', 'useyourdrive'), 'maxNumberOfFiles' => __('Maximum number of files exceeded', 'useyourdrive'), 'acceptFileTypes' => __('File type not allowed', 'useyourdrive'), 'maxFileSize' => __('File is too large', 'useyourdrive'), 'minFileSize' => __('File is too small', 'useyourdrive'), 'str_iframe_loggedin' => "<div class='empty_iframe'><h1>" . __('Still Waiting?', 'useyourdrive') . "</h1><span>" . __("If the document doesn't open, you are probably trying to access a protected file which requires you to be logged in on Google.", 'useyourdrive') . " <strong>" . __('Try to open the file in a new window.', 'useyourdrive') . "</strong></span></div>");
     wp_localize_script('UseyourDrive', 'UseyourDrive_vars', $localize);
 }
Ejemplo n.º 3
0
</p>">?</span>
                </h4>
                <div class="section largeinput">
                  <input type="text" name="UseyourDrive_upload_ext" id="UseyourDrive_upload_ext" value="<?php 
    echo isset($_REQUEST['uploadext']) ? $_REQUEST['uploadext'] : '';
    ?>
"/>
                </div>
              </div>

              <div class="option upload-options forfilebrowser forgallery <?php 
    echo isset($_REQUEST['upload']) && $_REQUEST['upload'] === '1' && in_array($mode, array('files', 'gallery')) ? '' : 'hidden';
    ?>
">
                <?php 
    $max_size_bytes = min(UseyourDrive_return_bytes(ini_get('post_max_size')), UseyourDrive_return_bytes(ini_get('upload_max_filesize')));
    ?>
                <h4><?php 
    _e('Max. upload size', 'useyourdrive');
    ?>
                  <span class="help" title="<p><?php 
    _e('Max filesize for uploading in bytes', 'useyourdrive');
    ?>
. <?php 
    echo __('Leave empty for server maximum ', 'useyourdrive');
    ?>
 (<?php 
    echo $max_size_bytes;
    ?>
 bytes). <a href='http://www.google.nl/#q=1mb+in+bytes' target='_blank'><?php 
    echo __('How to calculate?', 'useyourdrive');