Changeset 844441
- Timestamp:
- 01/24/2014 11:08:44 AM (12 years ago)
- Location:
- media-file-manager
- Files:
-
- 68 added
- 6 edited
-
branches/1.0.2 (added)
-
branches/1.0.2/images (added)
-
branches/1.0.2/images/MRL_Icons.svg (added)
-
branches/1.0.2/images/audio.png (added)
-
branches/1.0.2/images/dir.png (added)
-
branches/1.0.2/images/dir_new.png (added)
-
branches/1.0.2/images/dir_up.png (added)
-
branches/1.0.2/images/file.png (added)
-
branches/1.0.2/images/left.png (added)
-
branches/1.0.2/images/media_folder.png (added)
-
branches/1.0.2/images/no_thumb.png (added)
-
branches/1.0.2/images/right.png (added)
-
branches/1.0.2/images/video.png (added)
-
branches/1.0.2/jquery.appear-1.1.1.min.js (added)
-
branches/1.0.2/media-relocator.js (added)
-
branches/1.0.2/media-relocator.php (added)
-
branches/1.0.2/media-selector.js (added)
-
branches/1.0.2/media-selector.php (added)
-
branches/1.0.2/readme.txt (added)
-
branches/1.0.2/screenshot-1.jpg (added)
-
branches/1.0.2/set_document_root.php (added)
-
branches/1.0.2/style.css (added)
-
branches/1.1.1 (added)
-
branches/1.1.1/images (added)
-
branches/1.1.1/images/MRL_Icons.svg (added)
-
branches/1.1.1/images/audio.png (added)
-
branches/1.1.1/images/dir.png (added)
-
branches/1.1.1/images/dir_new.png (added)
-
branches/1.1.1/images/dir_up.png (added)
-
branches/1.1.1/images/file.png (added)
-
branches/1.1.1/images/left.png (added)
-
branches/1.1.1/images/media_folder.png (added)
-
branches/1.1.1/images/no_thumb.png (added)
-
branches/1.1.1/images/right.png (added)
-
branches/1.1.1/images/video.png (added)
-
branches/1.1.1/jquery.appear-1.1.1.min.js (added)
-
branches/1.1.1/media-relocator.js (added)
-
branches/1.1.1/media-relocator.php (added)
-
branches/1.1.1/media-selector.js (added)
-
branches/1.1.1/media-selector.php (added)
-
branches/1.1.1/readme.txt (added)
-
branches/1.1.1/screenshot-1.jpg (added)
-
branches/1.1.1/set_document_root.php (added)
-
branches/1.1.1/style.css (added)
-
branches/1.2.1 (added)
-
branches/1.2.1/images (added)
-
branches/1.2.1/images/MRL_Icons.svg (added)
-
branches/1.2.1/images/audio.png (added)
-
branches/1.2.1/images/dir.png (added)
-
branches/1.2.1/images/dir_new.png (added)
-
branches/1.2.1/images/dir_up.png (added)
-
branches/1.2.1/images/file.png (added)
-
branches/1.2.1/images/left.png (added)
-
branches/1.2.1/images/media_folder.png (added)
-
branches/1.2.1/images/no_thumb.png (added)
-
branches/1.2.1/images/right.png (added)
-
branches/1.2.1/images/video.png (added)
-
branches/1.2.1/jquery.appear-1.1.1.min.js (added)
-
branches/1.2.1/jquery.appear.js (added)
-
branches/1.2.1/media-relocator.js (added)
-
branches/1.2.1/media-relocator.php (added)
-
branches/1.2.1/media-selector.js (added)
-
branches/1.2.1/media-selector.php (added)
-
branches/1.2.1/output_log.php (added)
-
branches/1.2.1/readme.txt (added)
-
branches/1.2.1/screenshot-1.jpg (added)
-
branches/1.2.1/set_document_root.php (added)
-
branches/1.2.1/style.css (added)
-
trunk/media-relocator.js (modified) (4 diffs)
-
trunk/media-relocator.php (modified) (7 diffs)
-
trunk/media-selector.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/screenshot-1.jpg (modified) (previous)
-
trunk/style.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
media-file-manager/trunk/media-relocator.js
r843768 r844441 22 22 pane_right.opposite = pane_left; 23 23 24 adjust_layout();24 //adjust_layout(); 25 25 26 26 pane_left.setdir("/"); … … 59 59 }); 60 60 61 61 jQuery(window).resize(function() { 62 //jQuery('#debug').html(jQuery('#wpbody').height()); 63 adjust_layout(); 64 }); 65 66 67 adjust_layout(); 62 68 }); 63 69 … … 197 203 if (dir[i].isthumb) continue; 198 204 this.dir_disp_list[disp_num] = i; 199 html = html+'<div style="vertical-align:middle;display:block;height:55px;clear:both; background-color:#fff;position:relative;">';205 html = html+'<div style="vertical-align:middle;display:block;height:55px;clear:both; position:relative;">'; 200 206 if (this.flg_chkbox) { 201 207 html = html + '<div style="float:left;"><input type="checkbox" id="'+this.get_chkid(disp_num)+'"></div>'; … … 611 617 var height_mrl_box = jQuery('.mrl_box1').height(); 612 618 613 var pane_w = (width_all - width_center)/2-1; 619 var position = jQuery('#wpbody').offset(); 620 height_all = jQuery(window).height() - position.top - 100; 621 622 623 624 var pane_w = (width_all - width_center)/2-16; 614 625 jQuery('.mrl_wrapper_pane').width(pane_w); 615 626 jQuery('.mrl_path').width(pane_w); 616 627 jQuery('.mrl_pane').width(pane_w); 617 628 jQuery('.mrl_pane').height(height_all - height_mrl_box); 618 jQuery('.mrl_filename').width(pane_w- 200);629 jQuery('.mrl_filename').width(pane_w-32); 619 630 } 620 631 -
media-file-manager/trunk/media-relocator.php
r843768 r844441 4 4 Plugin URI: http://tempspace.net/plugins/?page_id=111 5 5 Description: You can make sub-directories in the upload directory, and move files into them. At the same time, this plugin modifies the URLs/path names in the database. Also an alternative file-selector is added in the editing post/page screen, so you can pick up media files from the subfolders easily. 6 Version: 1. 2.16 Version: 1.3.0_test_140123 7 7 Author: Atsushi Ueda 8 8 Author URI: http://tempspace.net/plugins/ … … 16 16 define("MLOC_DEBUG", 0); 17 17 18 //function dbg2($str){$fp=fopen("log.txt","a");fwrite($fp,$str . "\n");fclose($fp);}18 function dbg2($str){}//$fp=fopen("log.txt","a");fwrite($fp,$str . "\n");fclose($fp);} 19 19 20 20 include 'set_document_root.php'; … … 577 577 { 578 578 $wu = wp_upload_dir(); 579 580 579 $wp_content_dir = str_replace("\\","/", $wu['basedir']); 581 580 $wp_content_dir = str_replace("//","/", $wp_content_dir); … … 676 675 } 677 676 update_option('mediafilemanager_accepted_roles', $roles_val); 677 678 $roles_val = ""; 679 for ($i=0; $i<count($roles); $i++) { 680 if (!empty($_POST['roles_sel_'.$roles[$i]])) { 681 if ($roles_val != "") $roles_val .= ","; 682 $roles_val .= $roles[$i]; 683 } 684 } 685 update_option('mediafilemanager_accepted_roles_selector', $roles_val); 678 686 } 679 687 … … 686 694 wp_nonce_field('update-options'); 687 695 $accepted_roles = get_option("mediafilemanager_accepted_roles", "administrator"); 696 $accepted_roles_selector = get_option("mediafilemanager_accepted_roles_selector", "administrator,editor,author,contributor,subscriber"); 688 697 ?> 689 698 <table class="form-table"> 690 699 <tr> 691 <th> This plugincan be used by </th>700 <th>File Manager can be used by </th> 692 701 <td style="text-align: left;"> 693 702 <?php … … 704 713 } 705 714 706 echo '<input type="checkbox" name="roles_'.$key.'" id="roles_'.$key.'" '.$ck.'>'.$key.'</input><br>' ;715 echo '<input type="checkbox" name="roles_'.$key.'" id="roles_'.$key.'" '.$ck.'>'.$key.'</input><br>'."\n"; 707 716 } 708 717 ?> … … 710 719 </td> 711 720 </tr> 721 <th>File Selector can bu used by </th> 722 <td style="text-align: left;"> 723 <?php 724 $accepted = explode(",", $accepted_roles_selector); 725 for($i=0; $i<count($roles); $i++) { 726 $key = $roles[$i]; 727 728 $ck = ""; 729 for ($j=0; $j<count($accepted); $j++) { 730 if ($key == $accepted[$j]) { 731 $ck = "checked"; 732 break; 733 } 734 } 735 736 echo '<input type="checkbox" name="roles_sel_'.$key.'" id="roles_sel_'.$key.'" '.$ck.'>'.$key.'</input><br>'."\n"; 737 } 738 ?> 739 740 </td> 741 </tr> 742 743 <tr> 744 <td> 712 745 713 746 </table> -
media-file-manager/trunk/media-selector.php
r843768 r844441 338 338 public function onMediaButtons() 339 339 { 340 $cur_roles0 = get_option('mediafilemanager_accepted_roles_selector', 'administrator,editor,author,contributor,subscriber'); 341 $cur_roles = explode(',', $cur_roles0); 342 if (!check_user_role($cur_roles)) return; 343 340 344 global $post_ID, $temp_ID; 341 345 … … 389 393 } 390 394 395 396 391 397 // create an instance of plugin 392 if ( 1 )398 if (1) 393 399 { 394 400 $MrlMediaSelector = new MrlMediaSelector(); … … 424 430 } 425 431 } 432 //add_action( 'admin_init', 'MrlMediaButtonInit' ); 433 434 function check_user_role($roles,$user_id=NULL) { 435 // Get user by ID, else get current user 436 if ($user_id) 437 $user = get_userdata($user_id); 438 else 439 $user = wp_get_current_user(); 440 441 // No user found, return 442 if (empty($user)) 443 return FALSE; 444 445 // Append administrator to roles, if necessary 446 if (!in_array('administrator',$roles)) 447 $roles[] = 'administrator'; 448 449 // Loop through user roles 450 //echo "<pre>";print_r($roles);echo "</pre>"; 451 foreach ($user->roles as $role) { 452 //echo $role; 453 // Does user have role 454 if (in_array($role,$roles)) { 455 return TRUE; 456 } 457 } 458 //echo "<br>false<br>"; 459 // User not in roles 460 return FALSE; 461 } 426 462 ?> -
media-file-manager/trunk/readme.txt
r843768 r844441 4 4 Tags: media,file,manager,explorer,relocate,folder,folders,files,rename,make directory,directories,organize,organizer,select,selector,database 5 5 Requires at least: 3.6.0 6 Tested up to: 3. 7.16 Tested up to: 3.8.1 7 7 Stable tag: 1.2.1 8 8 … … 56 56 == Changelog == 57 57 58 = 1.3.0 = 59 * Added a permission setting for file selector feature. 60 * Improved behaviour when windows is resized. 61 * Corrected background color for WP3.8. 62 58 63 = 1.2.1 = 59 64 * Fixed some errors. -
media-file-manager/trunk/style.css
r843768 r844441 8 8 #mrl_wrapper_all { 9 9 position:relative; 10 width:800px; 10 //width:800px; 11 width:auto; 11 12 height:655px; 12 13 bborder: solid 1px #0ff; … … 19 20 background-color:#ddd; 20 21 border: 1px solid #888; 22 font-size: 14px; 23 padding: 0px; 21 24 } 22 25
Note: See TracChangeset
for help on using the changeset viewer.