[xoops-cvslog 3037] CVS update: xoops2jp/html/modules/base/class

Back to archive index

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


Index: xoops2jp/html/modules/base/class/image.php
diff -u xoops2jp/html/modules/base/class/image.php:1.1.2.2 xoops2jp/html/modules/base/class/image.php:1.1.2.3
--- xoops2jp/html/modules/base/class/image.php:1.1.2.2	Wed May 10 19:23:50 2006
+++ xoops2jp/html/modules/base/class/image.php	Mon May 15 17:34:25 2006
@@ -6,6 +6,8 @@
 {
 	var $mImageCategory = null;
 	var $_mImageCategoryLoadedFlag = false;
+	var $mImageBody = null;
+	var $_mImageBodyLoadedFlag = false;
 
 	function BaseImageObject()
 	{
@@ -27,6 +29,23 @@
 			$this->_mImageCategoryLoadedFlag = true;
 		}
 	}
+
+	function loadImagebody()
+	{
+		if ($this->_mImageBodyLoadedFlag == false) {
+			$handler =& xoops_getmodulehandler('imagebody');
+			$this->mImageBody =& $handler->get($this->get('image_id'));
+			$this->_mImageBodyLoadedFlag = true;
+		}
+	}
+
+	function &createImagebody()
+	{
+		$handler =& xoops_getmodulehandler('imagebody');
+		$obj =& $handler->create();
+		$obj->set('image_id', $this->get('image_id'));
+		return $obj;
+	}
 }
 
 class BaseImageHandler extends XoopsObjectGenericHandler
@@ -35,6 +54,21 @@
 	var $mPrimary = "image_id";
 	var $mClass = "BaseImageObject";
 
+	function insert(&$obj, $force = false)
+	{
+		if (parent::insert($obj, $force)) {
+			if (is_object($obj->mImageBody)) {
+				$obj->mImageBody->set('image_id', $obj->get('image_id'));
+				$handler =& xoops_getmodulehandler('imagebody', 'base');
+				return $handler->insert($obj->mImageBody, $force);
+			}
+			
+			return true;
+		}
+		
+		return false;
+	}
+	
 	/**
 	 *
 	 * Delete object and image file.
@@ -51,6 +85,9 @@
 				@unlink($filepath);
 			}
 			
+			$handler =& xoops_gethandler('imagebody', 'base');
+			$handler->delete($this->get('image_id'));
+			
 			return true;
 		}
 		


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