Changeset 843768
- Timestamp:
- 01/23/2014 12:49:24 PM (12 years ago)
- Location:
- media-file-manager/trunk
- Files:
-
- 5 edited
-
media-relocator.js (modified) (4 diffs)
-
media-relocator.php (modified) (7 diffs)
-
media-selector.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
style.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
media-file-manager/trunk/media-relocator.js
r843757 r843768 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 jQuery(window).resize(function() { 62 //jQuery('#debug').html(jQuery('#wpbody').height()); 63 adjust_layout(); 64 }); 65 66 67 adjust_layout(); 61 68 62 }); 69 63 … … 203 197 if (dir[i].isthumb) continue; 204 198 this.dir_disp_list[disp_num] = i; 205 html = html+'<div style="vertical-align:middle;display:block;height:55px;clear:both; position:relative;">';199 html = html+'<div style="vertical-align:middle;display:block;height:55px;clear:both; background-color:#fff;position:relative;">'; 206 200 if (this.flg_chkbox) { 207 201 html = html + '<div style="float:left;"><input type="checkbox" id="'+this.get_chkid(disp_num)+'"></div>'; … … 617 611 var height_mrl_box = jQuery('.mrl_box1').height(); 618 612 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; 613 var pane_w = (width_all - width_center)/2-1; 625 614 jQuery('.mrl_wrapper_pane').width(pane_w); 626 615 jQuery('.mrl_path').width(pane_w); 627 616 jQuery('.mrl_pane').width(pane_w); 628 617 jQuery('.mrl_pane').height(height_all - height_mrl_box); 629 jQuery('.mrl_filename').width(pane_w- 32);618 jQuery('.mrl_filename').width(pane_w-200); 630 619 } 631 620 -
media-file-manager/trunk/media-relocator.php
r843757 r843768 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. 3.0_test_1401236 Version: 1.2.1 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 579 580 $wp_content_dir = str_replace("\\","/", $wu['basedir']); 580 581 $wp_content_dir = str_replace("//","/", $wp_content_dir); … … 675 676 } 676 677 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);686 678 } 687 679 … … 694 686 wp_nonce_field('update-options'); 695 687 $accepted_roles = get_option("mediafilemanager_accepted_roles", "administrator"); 696 $accepted_roles_selector = get_option("mediafilemanager_accepted_roles_selector", "administrator,editor,author,contributor,subscriber");697 688 ?> 698 689 <table class="form-table"> 699 690 <tr> 700 <th> File Managercan be used by </th>691 <th>This plugin can be used by </th> 701 692 <td style="text-align: left;"> 702 693 <?php … … 713 704 } 714 705 715 echo '<input type="checkbox" name="roles_'.$key.'" id="roles_'.$key.'" '.$ck.'>'.$key.'</input><br>' ."\n";706 echo '<input type="checkbox" name="roles_'.$key.'" id="roles_'.$key.'" '.$ck.'>'.$key.'</input><br>'; 716 707 } 717 708 ?> … … 719 710 </td> 720 711 </tr> 721 <th>File Selector can bu used by </th>722 <td style="text-align: left;">723 <?php724 $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>745 712 746 713 </table> -
media-file-manager/trunk/media-selector.php
r843757 r843768 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 344 340 global $post_ID, $temp_ID; 345 341 … … 393 389 } 394 390 395 396 397 391 // create an instance of plugin 398 if (1)392 if( 1 ) 399 393 { 400 394 $MrlMediaSelector = new MrlMediaSelector(); … … 430 424 } 431 425 } 432 add_action( 'admin_init', 'MrlMediaButtonInit' );433 434 function check_user_role($roles,$user_id=NULL) {435 // Get user by ID, else get current user436 if ($user_id)437 $user = get_userdata($user_id);438 else439 $user = wp_get_current_user();440 441 // No user found, return442 if (empty($user))443 return FALSE;444 445 // Append administrator to roles, if necessary446 if (!in_array('administrator',$roles))447 $roles[] = 'administrator';448 449 // Loop through user roles450 //echo "<pre>";print_r($roles);echo "</pre>";451 foreach ($user->roles as $role) {452 //echo $role;453 // Does user have role454 if (in_array($role,$roles)) {455 return TRUE;456 }457 }458 //echo "<br>false<br>";459 // User not in roles460 return FALSE;461 }462 426 ?> -
media-file-manager/trunk/readme.txt
r843757 r843768 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. 8.07 Stable tag: 1. 3.0_test_1401236 Tested up to: 3.7.1 7 Stable tag: 1.2.1 8 8 9 9 You can make sub-directories in the upload directory, and move files into them. -
media-file-manager/trunk/style.css
r843757 r843768 8 8 #mrl_wrapper_all { 9 9 position:relative; 10 //width:800px; 11 width:auto; 10 width:800px; 12 11 height:655px; 13 12 bborder: solid 1px #0ff; … … 20 19 background-color:#ddd; 21 20 border: 1px solid #888; 22 font-size: 14px;23 padding: 0px;24 21 } 25 22
Note: See TracChangeset
for help on using the changeset viewer.