![]() |
|---|
| [ Index ] |
Source Code Reference for V1.00 |
[Summary view] [Print] [Text view]
1 <?php /* $Id: do_files_bulk_aed.php 40 2008-02-11 12:11:44Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/files/do_files_bulk_aed.php $ */ 2 if (!defined('W2P_BASE_DIR')) { 3 die('You should not access this file directly.'); 4 } 5 6 global $AppUI; 7 $selected = w2PgetParam($_POST, 'bulk_selected_file', 0); 8 $redirect = w2PgetParam($_POST, 'redirect', ''); 9 $bulk_file_project = w2PgetParam($_POST, 'bulk_file_project', 'O'); 10 $bulk_file_folder = w2PgetParam($_POST, 'bulk_file_folder', 'O'); 11 //print_r($_POST);die; 12 13 $perms = &$AppUI->acl(); 14 15 if (is_array($selected) && count($selected)) { 16 $upd_file = new CFile(); 17 foreach ($selected as $key => $val) { 18 if ($key) { 19 //If user is not permitted to edit then fail silently 20 if (!$perms->checkModuleItem('files', 'edit', $key)) { 21 continue; 22 } 23 $upd_file->load($key); 24 } 25 26 if (isset($_POST['bulk_file_project']) && $bulk_file_project != '' && $bulk_file_project != 'O') { 27 if ($upd_file->file_id) { 28 // move the file on filesystem if the affiliated project was changed 29 if ($upd_file->file_project != $bulk_file_project) { 30 $oldProject = $upd_file->file_project; 31 $upd_file->file_project = $bulk_file_project; 32 $res = $upd_file->moveFile($oldProject, $upd_file->file_real_filename); 33 if (!$res) { 34 $AppUI->setMsg('At least one File could not be moved', UI_MSG_ERROR); 35 } 36 } 37 $upd_file->store(); 38 } 39 } 40 if (isset($_POST['bulk_file_folder']) && $bulk_file_folder != '' && $bulk_file_folder != 'O') { 41 if ($upd_file->file_id) { 42 $upd_file->file_folder = $bulk_file_folder; 43 $upd_file->store(); 44 } 45 } 46 echo db_error(); 47 } 48 } 49 $AppUI->redirect($redirect); 50 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 7 03:00:01 2009 | Cross-referenced by PHPXref 0.7 |