[pLog-svn] r4835 - plog/branches/lifetype-1.2/class/plugin
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Thu Feb 22 16:43:58 EST 2007
Author: oscar
Date: 2007-02-22 16:43:58 -0500 (Thu, 22 Feb 2007)
New Revision: 4835
Modified:
plog/branches/lifetype-1.2/class/plugin/pluginbase.class.php
Log:
Now PluginBase will store the original value of the $source parameter, which can be accessed via direct access to the attribute or via PluginBase::getSource().
Modified: plog/branches/lifetype-1.2/class/plugin/pluginbase.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/plugin/pluginbase.class.php 2007-02-22 21:40:33 UTC (rev 4834)
+++ plog/branches/lifetype-1.2/class/plugin/pluginbase.class.php 2007-02-22 21:43:58 UTC (rev 4835)
@@ -77,6 +77,15 @@
* plugin manager when the plugin loads
*/
var $pluginFolder;
+
+ /**
+ * This attribute will store the original value of the $source parameter,
+ * which was passed to the plugin in the constructor. The $source identifies
+ * the code that initialized the plugin, and it should mainly be used to identify
+ * whether the plugin is being called from admin.php ("admin") or index.php ("index")
+ */
+ var $source;
+
/**
* Constructor. Feel free to do here whatever you need to.
@@ -89,7 +98,7 @@
*/
function PluginBase( $source = "" )
{
-
+ $this->source = $source;
}
/**
@@ -405,5 +414,15 @@
return( $this->version );
}
+
+ /**
+ * Returns the value of the source parameter
+ *
+ * @param return Source
+ */
+ function getSource()
+ {
+ return( $this->source );
+ }
}
?>
More information about the pLog-svn
mailing list