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

Back to archive index

Minahito minah****@users*****
2006年 4月 11日 (火) 11:05:59 JST


Index: xoops2jp/html/modules/base/class/newblocks.php
diff -u xoops2jp/html/modules/base/class/newblocks.php:1.1.2.4 xoops2jp/html/modules/base/class/newblocks.php:1.1.2.5
--- xoops2jp/html/modules/base/class/newblocks.php:1.1.2.4	Fri Apr  7 18:03:01 2006
+++ xoops2jp/html/modules/base/class/newblocks.php	Tue Apr 11 11:05:59 2006
@@ -95,6 +95,34 @@
 	var $mTable = "newblocks";
 	var $mPrimary = "bid";
 	var $mClass = "BaseNewblocksObject";
+	
+	function delete(&$obj, $force = false)
+	{
+		if (parent::delete($obj, $force)) {
+			//
+			// Delete related data from block_module_link.
+			//
+			$handler =& xoops_getmodulehandler('block_module_link', 'base');
+			$handler->deleteAll(new Criteria('block_id'), $obj->get('bid'));
+			
+			//
+			// Delete related permissions from groupperm.
+			//
+			$handler =& xoops_gethandler('groupperm');
+
+			$criteria =& new CriteriaCompo();
+			$criteria->add(new Criteria('gperm_modid', 1));
+			$criteria->add(new Criteria('gperm_itemid', $obj->get('bid')));
+			$criteria->add(new Criteria('gperm_name', 'block_read'));
+			
+			$handler->deleteAll($criteria);
+			
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
 }
 
 ?>


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