|
From: <rgr...@us...> - 2013-08-16 02:55:56
|
Revision: 11926
http://sourceforge.net/p/xoops/svn/11926
Author: rgriffith
Date: 2013-08-16 02:55:51 +0000 (Fri, 16 Aug 2013)
Log Message:
-----------
Expose debug and log in Dummy module helper
This matches XMF behavior and will be helpful to developers since Dummy is used for modules that do not have a custom helper yet.
Modified Paths:
--------------
XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Abstract.php
XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Dummy.php
Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Abstract.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Abstract.php 2013-08-16 02:44:27 UTC (rev 11925)
+++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Abstract.php 2013-08-16 02:55:51 UTC (rev 11926)
@@ -122,6 +122,8 @@
}
/**
+ * Is this the currently active module?
+ *
* @return bool
*/
public function isCurrentModule()
@@ -133,7 +135,9 @@
}
/**
- * @return bool
+ * Does user have admin rights to this module?
+ *
+ * @return bool true is user has admin right, else false
*/
public function isUserAdmin()
{
@@ -143,12 +147,19 @@
return false;
}
+ /**
+ * TODO - reevaluate this even existing here - this is not module
+ * related and we should have easy access to this (and similar)
+ * elsewhere (maybe a user helper?)
+ */
public function getUserGroups()
{
return $this->xoops()->isUser() ? $this->xoops()->user->getGroups() : XOOPS_GROUP_ANONYMOUS;
}
/**
+ * Return absolute URL for a module relative URL
+ *
* @param string $url
*
* @return string
@@ -159,6 +170,8 @@
}
/**
+ * Return absolute filesystem path for a module relative path
+ *
* @param string $path
*
* @return string
@@ -169,8 +182,11 @@
}
/**
- * Function to redirect a user to certain pages
+ * Redirect the user to a page within this module
*
+ * TODO remove addredirect and allowExternalLink paramaters since
+ * they are pointless in this context.
+ *
* @param $url
* @param int $time
* @param string $message
@@ -233,7 +249,7 @@
/**
* @param string $log
*/
- private function _addLog($log)
+ protected function _addLog($log)
{
if ($this->_debug) {
$this->xoops()->preload()->triggerEvent('core.module.addlog', array(
@@ -242,4 +258,4 @@
));
}
}
-}
\ No newline at end of file
+}
Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Dummy.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Dummy.php 2013-08-16 02:44:27 UTC (rev 11925)
+++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/Xoops/Module/Helper/Dummy.php 2013-08-16 02:55:51 UTC (rev 11926)
@@ -36,7 +36,37 @@
return parent::getInstance();
}
+ /**
+ * @param string $dirname dirname of the module
+ */
public function setDirname($dirname) {
parent::setDirname($dirname);
}
+
+ /**
+ * Set debug option on or off
+ *
+ * Made public to match Xmf module helper. Since this class is used
+ * when a module doesn't have its own helper (yet) this is useful.
+ *
+ * @param bool $debug
+ */
+ public function setDebug($debug)
+ {
+ parent::setDebug($debug);
+ }
+
+ /**
+ * Add a message to the module log
+ *
+ * Made public to match Xmf module helper. Since this class is used
+ * when a module doesn't have its own helper (yet) this is useful.
+ *
+ * @param string $log
+ */
+ public function addLog($log)
+ {
+ $this->_addLog($log);
+ }
+
}
|