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

Back to archive index

Minahito minah****@users*****
2006年 4月 6日 (木) 16:55:08 JST


Index: xoops2jp/html/modules/base/class/blockctype.php
diff -u /dev/null xoops2jp/html/modules/base/class/blockctype.php:1.1.2.1
--- /dev/null	Thu Apr  6 16:55:08 2006
+++ xoops2jp/html/modules/base/class/blockctype.php	Thu Apr  6 16:55:08 2006
@@ -0,0 +1,77 @@
+<?php
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+class BaseBlockctypeObject extends XoopsSimpleObject
+{
+	function BaseBlockctypeObject()
+	{
+		$this->initVar('type', XOBJ_DTYPE_STRING, '', true);
+		$this->initVar('label', XOBJ_DTYPE_STRING, '', true, 255);
+	}
+}
+
+class BaseBlockctypeHandler extends XoopsObjectHandler
+{
+	var $_mResults = array();
+	
+	function BaseBlockctypeHandler(&$db)
+	{
+		$t_arr = array (
+				'H' => _AM_HTML,
+				'P' => _AM_PHP,
+				'S' => _AM_AFWSMILE,
+				'T' => _AM_AFNOSMILE
+			);
+			
+		foreach ($t_arr as $id => $name) {
+			$this->_mResults[$id] =& $this->create();
+			$this->_mResults[$id]->setVar('type', $id);
+			$this->_mResults[$id]->setVar('label', $name);
+		}
+	}
+	
+	function &create()
+	{
+		$ret =& new BaseBlockctypeObject();
+		return $ret;
+	}
+	
+	function get($id)
+	{
+		if (isset($this->_mResults[$id])) {
+			return $this->_mResults[$id];
+		}
+		
+		$ret = null;
+		return $ret;
+	}
+	
+	function &getObjects($criteria = null, $id_as_key = false)
+	{
+		if ($id_as_key) {
+			return $this->_mResults;
+		}
+		else {
+			$ret = array();
+		
+			foreach (array_keys($this->_mResults) as $key) {
+				$ret[] =& $this->_mResults[$key];
+			}
+			
+			return $ret;
+		}
+	}
+	
+	function insert(&$obj)
+	{
+		return false;
+	}
+
+	function delete(&$obj)
+	{
+		return false;
+	}
+}
+
+?>


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