[pLog-svn] r4840 - plugins/branches/lifetype-1.2/nofollow

oscar at devel.lifetype.net oscar at devel.lifetype.net
Thu Feb 22 17:02:07 EST 2007


Author: oscar
Date: 2007-02-22 17:02:07 -0500 (Thu, 22 Feb 2007)
New Revision: 4840

Modified:
   plugins/branches/lifetype-1.2/nofollow/pluginnofollow.class.php
Log:
added support for the $source parameter


Modified: plugins/branches/lifetype-1.2/nofollow/pluginnofollow.class.php
===================================================================
--- plugins/branches/lifetype-1.2/nofollow/pluginnofollow.class.php	2007-02-22 22:00:07 UTC (rev 4839)
+++ plugins/branches/lifetype-1.2/nofollow/pluginnofollow.class.php	2007-02-22 22:02:07 UTC (rev 4840)
@@ -5,9 +5,9 @@
 	{
 		var $pluginEnabled;
 		
-		function PluginNoFollow()
+		function PluginNoFollow( $source = "" )
 		{
-			$this->PluginBase();
+			$this->PluginBase( $source );
 
 			$this->id      = "nofollow";
 			$this->author  = "Original by Minstrel Chiu, Modified by Mark Wu";
@@ -20,14 +20,16 @@
 
 		function init()
 		{
-			lt_include( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
-            $this->registerAdminAction( "nofollow", "PluginNoFollowConfigAction" );
-			$this->registerAdminAction( "updateNoFollowConfig", "PluginNoFollowUpdateConfigAction" );
+            if( $this->getSource() == "admin" ) {
+                lt_include( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
+                $this->registerAdminAction( "nofollow", "PluginNoFollowConfigAction" );
+                $this->registerAdminAction( "updateNoFollowConfig", "PluginNoFollowUpdateConfigAction" );
 			
-			$menu =& Menu::getMenu();
-			if( !$menu->entryExists( "/menu/controlCenter/manageAntiSpamPlugins" ))						
-				$this->addMenuEntry( "/menu/controlCenter", "manageAntiSpamPlugins", "", "" );
-            $this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "NoFollow", "?op=nofollow", "" );            
+                $menu =& Menu::getMenu();
+                if( !$menu->entryExists( "/menu/controlCenter/manageAntiSpamPlugins" ))						
+                    $this->addMenuEntry( "/menu/controlCenter", "manageAntiSpamPlugins", "", "" );
+                $this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "NoFollow", "?op=nofollow", "" );
+            }
 
 			$this->registerNotification( EVENT_PRE_COMMENT_ADD );
 		}



More information about the pLog-svn mailing list