Changeset 1694 for sandbox/filemanager/inc
- Timestamp:
- 11/23/09 10:58:52 (15 years ago)
- Location:
- sandbox/filemanager/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.uifilemanager.inc.php
r1693 r1694 54 54 var $current_config; 55 55 var $goto_x; 56 var $to dir;56 var $to; 57 57 var $changedir; // for switching dir. 58 58 var $cdtodir; // for switching dir. … … 79 79 var $file; // FIXME WHERE IS THIS FILLED? 80 80 var $sortby; 81 var $messages = array();81 var $messages; 82 82 var $show_upload_boxes; 83 83 … … 86 86 function uifilemanager() 87 87 { 88 // error_reporting(8); 88 $this->messages = &$_SESSION['phpgw_info']['filemanager']['user']['messages']; 89 89 90 $GLOBALS['phpgw']->browser = CreateObject('phpgwapi.browser'); 90 91 … … 124 125 'sortby' => array('sortby' => ''), 125 126 'messages' => array('messages' => ''), 126 'show_upload_boxes' => array('show_upload_boxes' => '') 127 'show_upload_boxes' => array('show_upload_boxes' => ''), 128 'to' => array('to' => '') 129 127 130 ); 128 131 … … 591 594 foreach($this->messages as $msg) 592 595 { 593 $messages.='<p>'.$msg.'</p>'; 594 } 595 } 596 596 $messages.='<span>'.$msg.'</span>'; 597 } 598 } 599 $this->messages = NULL; 600 597 601 $vars[messages]=$messages; 598 602 … … 696 700 } 697 701 $link=$this->encode_href('/index.php','menuaction=filemanager.vfs_functions.setRestricted','file='.$files['name'].'&path='.$this->path); 698 $minibar_data = '<img id="restrict_'.$files['name'].'" onClick=" cExecute(\''.$link.'\',setRestricted)" alt="'.lang("mark as restricted").'" title="'.lang("mark as restricted").'" src="'.$image.'">';702 $minibar_data = '<img id="restrict_'.$files['name'].'" onClick="setRestricted(\''.$link.'\')" alt="'.lang("mark as restricted").'" title="'.lang("mark as restricted").'" src="'.$image.'">'; 699 703 } 700 704 … … 1102 1106 function moveTo() 1103 1107 { 1104 if(!$this->to dir)1108 if(!$this->to) 1105 1109 { 1106 1110 $this->messages[] = lang('Error:').lang('Could not move file because no destination directory is given ', $this->disppath.'/'.$file); … … 1114 1118 if($this->bo->vfs->mv(array( 1115 1119 'from' => $file, 1116 'to' => $this->to dir. '/' . $file,1120 'to' => $this->to . '/' . $file, 1117 1121 'relatives' => array(RELATIVE_ALL, RELATIVE_NONE) 1118 1122 ))) 1119 1123 { 1120 1124 $moved++; 1121 $this->messages[]=lang('Moved %1 to %2', $this->disppath.'/'.$file, $this->to dir.'/'.$file);1125 $this->messages[]=lang('Moved %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 1122 1126 } 1123 1127 else 1124 1128 { 1125 $this->messages[] = lang('Error:').lang('Could not move %1 to %2', $this->disppath.'/'.$file, $this->to dir.'/'.$file);1129 $this->messages[] = lang('Error:').lang('Could not move %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 1126 1130 } 1127 1131 } … … 1140 1144 function copyTo() 1141 1145 { 1142 if(!$this->to dir)1146 if(!$this->to) 1143 1147 { 1144 1148 $this->messages[] = lang('Error:').lang('Could not copy file because no destination directory is given ', $this->disppath.'/'.$file); … … 1151 1155 if($this->bo->vfs->cp(array( 1152 1156 'from' => $file, 1153 'to' => $this->to dir. '/' . $file,1157 'to' => $this->to . '/' . $file, 1154 1158 'relatives' => array(RELATIVE_ALL, RELATIVE_NONE) 1155 1159 ))) 1156 1160 { 1157 1161 $copied++; 1158 $this->messages[] = lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->to dir.'/'.$file);1162 $this->messages[] = lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 1159 1163 } 1160 1164 else 1161 1165 { 1162 $this->messages[] = lang('Error:').lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->to dir.'/'.$file);1166 $this->messages[] = lang('Error:').lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 1163 1167 } 1164 1168 } … … 1531 1535 return; 1532 1536 } 1533 $_SESSION['debug'][] = $ls_array;1534 1537 if($ls_array[0]['mime_type']) 1535 1538 { -
sandbox/filemanager/inc/upload.php
r1693 r1694 26 26 if($badchar = $bo->bad_chars($_FILES['upload_file']['name'][$i], True, True)) 27 27 { 28 $_SESSION[' response'] = lang('Error:').lang('File names cannot contain "%1"', $badchar);29 return;28 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('File names cannot contain "%1"', $badchar); 29 continue; 30 30 } 31 31 … … 44 44 if($fileinfo['mime_type'] == 'Directory') 45 45 { 46 $_SESSION[' response'] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']);47 return;46 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']); 47 continue; 48 48 } 49 49 } … … 51 51 if ($_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024)) 52 52 { 53 $_SESSION[' response'] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size);54 return;53 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size); 54 continue; 55 55 } 56 56 else if(strlen($current_config['filemanager_antivirus_command']) > 0) … … 60 60 if ($return == 1) 61 61 { 62 $_SESSION['response'] = lang('Error:').lang('The file %1 sent was considered infected',$_FILES['upload_file']['name'][$i]);63 return;62 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('The file %1 sent was considered infected',$_FILES['upload_file']['name'][$i]); 63 continue; 64 64 } 65 65 } … … 90 90 $bo->vfs->cp($tmp_arr); 91 91 92 $_SESSION['response'] .= lang('Created new %1', $_FILES['upload_file']['name'][$i])."\n";92 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created new %1', $_FILES['upload_file']['name'][$i])."\n"; 93 93 } 94 94 else … … 110 110 )); 111 111 112 $_SESSION[' response'] .= lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $_FILES['upload_file']['size'][$i])."\n";112 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $_FILES['upload_file']['size'][$i])."\n"; 113 113 } 114 114 } … … 129 129 )); 130 130 131 $_SESSION['response'] .= lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $file_size[$i])."\n"; 131 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $file_size[$i])."\n"; 132 132 133 } 133 134 }
Note: See TracChangeset
for help on using the changeset viewer.