[xoops-cvslog 3036] CVS update: xoops2jp/html/modules/base/admin/forms

Back to archive index

Minahito minah****@users*****
2006年 5月 15日 (月) 17:34:09 JST


Index: xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php
diff -u xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php:1.1.2.3 xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php:1.1.2.4
--- xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php:1.1.2.3	Mon May 15 14:33:30 2006
+++ xoops2jp/html/modules/base/admin/forms/ImageAdminEditForm.class.php	Mon May 15 17:34:09 2006
@@ -112,11 +112,34 @@
 		$obj->set('image_weight', $this->get('image_weight'));
 		$obj->set('imgcat_id', $this->get('imgcat_id'));
 		
+		$handler =& xoops_getmodulehandler('imagecategory', 'base');
+		$category =& $handler->get($this->get('imgcat_id'));
+
 		$this->mFormFile = $this->get('image_name');
+		
 		if ($this->mFormFile != null) {
 			$this->mFormFile->setRandomToBodyName('img');
+			
+			$filename = $this->mFormFile->getBodyName();
+			$this->mFormFile->setBodyName(substr($filename, 0, 24));
+	
 			$obj->set('image_name', $this->mFormFile->getFileName());
 			$obj->set('image_mimetype', $this->mFormFile->getContentType());
+			
+			//
+			// To store db
+			//
+			if ($category->get('imgcat_storetype') == 'db') {
+				$obj->loadImageBody();
+				if (!is_object($obj->mImageBody)) {
+					$obj->mImageBody =& $obj->createImageBody();
+				}
+					
+				//
+				// Access to private member property.
+				//
+				$obj->mImageBody->set('image_body', file_get_contents($this->mFormFile->_mTmpFileName));
+			}
 		}
 	}
 }


xoops-cvslog メーリングリストの案内
Back to archive index