[xoops-cvslog 2708] CVS update: xoops2jp/html/modules/base/admin/actions

Back to archive index

Minahito minah****@users*****
2006年 4月 11日 (火) 10:49:57 JST


Index: xoops2jp/html/modules/base/admin/actions/BlockEditAction.class.php
diff -u xoops2jp/html/modules/base/admin/actions/BlockEditAction.class.php:1.1.2.4 xoops2jp/html/modules/base/admin/actions/BlockEditAction.class.php:1.1.2.5
--- xoops2jp/html/modules/base/admin/actions/BlockEditAction.class.php:1.1.2.4	Fri Apr  7 18:02:36 2006
+++ xoops2jp/html/modules/base/admin/actions/BlockEditAction.class.php	Tue Apr 11 10:49:57 2006
@@ -16,7 +16,12 @@
 	{
 		return isset($_REQUEST['bid']) ? $_REQUEST['bid'] : 0;
 	}
-
+	
+	function isEnableCreate()
+	{
+		return false;
+	}
+	
 	function &_getHandler()
 	{
 		$handler =& xoops_getmodulehandler('newblocks');
@@ -36,8 +41,37 @@
 		$this->mActionForm->prepare();
 	}
 	
+	/**
+	 * Return true if the target object can be edited. This private method exists 
+	 * to control subclass actions.
+	 * 
+	 * @return bool
+	 */
+	function _isEditable()
+	{
+		if (is_object($this->mObject)) {
+			return ($this->mObject->get('visible') == 1);
+		}
+		else {
+			return false;
+		}
+	}
+	
+	function getDefaultView(&$controller, &$xoopsUser)
+	{
+		if (!$this->_isEditable()) {
+			return LEGACY_FRAME_VIEW_ERROR;
+		}
+		
+		return parent::getDefaultView($controller, $xoopsUser);
+	}
+
 	function execute(&$controller, &$xoopsUser)
 	{
+		if (!$this->_isEditable()) {
+			LEGACY_FRAME_VIEW_ERROR;
+		}
+
 		$ret = parent::execute($controller, $xoopsUser);
 		
 		if ($ret == LEGACY_FRAME_VIEW_SUCCESS) {


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