![]() |
|---|
| [ Index ] |
Source Code Reference for V1.00 |
[Summary view] [Print] [Text view]
1 <?php /* $Id: do_folder_aed.php 40 2008-02-11 12:11:44Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/files/do_folder_aed.php $ */ 2 if (!defined('W2P_BASE_DIR')) { 3 die('You should not access this file directly.'); 4 } 5 6 $file_folder_id = intval(w2PgetParam($_POST, 'file_folder_id', 0)); 7 $del = intval(w2PgetParam($_POST, 'del', 0)); 8 $redirect = w2PgetParam($_POST, 'redirect', ''); 9 10 $isNotNew = $_POST['file_folder_id']; 11 $perms = &$AppUI->acl(); 12 if ($del) { 13 if (!$perms->checkModule('files', 'delete')) { 14 $AppUI->redirect('m=public&a=access_denied'); 15 } 16 } elseif ($isNotNew) { 17 if (!$perms->checkModule('files', 'edit')) { 18 $AppUI->redirect('m=public&a=access_denied'); 19 } 20 } else { 21 if (!$perms->checkModule('files', 'add')) { 22 $AppUI->redirect('m=public&a=access_denied'); 23 } 24 } 25 26 $obj = new CFileFolder(); 27 if ($file_folder_id) { 28 $obj->_message = 'updated'; 29 $oldObj = new CFileFolder(); 30 $oldObj->load($file_folder_id); 31 32 } else { 33 $obj->_message = 'added'; 34 } 35 36 if (!$obj->bind($_POST)) { 37 $AppUI->setMsg($obj->getError(), UI_MSG_ERROR); 38 $AppUI->redirect($redirect); 39 } 40 41 // prepare (and translate) the module name ready for the suffix 42 $AppUI->setMsg('File Folder'); 43 // delete the file folder 44 if ($del) { 45 $obj->load($file_folder_id); 46 if (($msg = $obj->delete())) { 47 $AppUI->setMsg($msg, UI_MSG_ERROR); 48 $AppUI->redirect(); 49 } else { 50 $AppUI->setMsg('deleted', UI_MSG_ALERT, true); 51 $AppUI->redirect($redirect); 52 } 53 } 54 55 if (($msg = $obj->store())) { 56 $AppUI->setMsg($msg, UI_MSG_ERROR); 57 } else { 58 $obj->load($obj->file_folder_id); 59 $AppUI->setMsg($file_folder_id ? 'updated' : 'added', UI_MSG_OK, true); 60 } 61 $AppUI->redirect($redirect); 62 ?>
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 |