| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * Limb PHP Framework 4 * 5 * @link http://limb-project.com 6 * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com) 7 * @license LGPL http://www.gnu.org/copyleft/lesser.html 8 */ 9 lmb_require('limb/cms/src/controller/AdminNodeWithObjectController.class.php'); 10 lmb_require('limb/cms/src/model/lmbCmsFileObject.class.php'); 11 12 /** 13 * class AdminFileObjectController. 14 * 15 * @package cms 16 * @version $Id: AdminFileObjectController.class.php 5945 2007-06-06 08:31:43Z pachanga $ 17 */ 18 class AdminFileObjectController extends AdminNodeWithObjectController 19 { 20 protected $_object_class_name = 'lmbCmsFileObject'; 21 protected $_controller_name = 'file_object'; 22 protected $_form_name = 'file_object_form'; 23 protected $_generate_identifier = true; 24 25 protected function _onBeforeSave() 26 { 27 $this->_uploadFile('new_file'); 28 } 29 30 function _uploadFile($field) 31 { 32 if (isset($_FILES[$field]) && 33 !is_null($_FILES[$field]['tmp_name']) && 34 is_uploaded_file($_FILES[$field]['tmp_name'])) 35 { 36 $file = $_FILES[$field]; 37 $file_name = $file['name']; 38 39 $this->item->setFileName($file_name); 40 $this->item->setMimeType($file['type']); 41 42 try 43 { 44 $this->item->loadFile($file['tmp_name']); 45 } 46 catch(lmbFsException $e) 47 { 48 $this->toolkit->flashError('File upload error!'); 49 } 50 } 51 } 52 } 53 54 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Sep 8 04:35:41 2008 | Cross-referenced by PHPXref 0.7 |