[pLog-svn] r4817 - in plugins/branches/lifetype-1.2: . tagcloud unported

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Thu Feb 22 05:27:03 EST 2007


Author: pwestbro
Date: 2007-02-22 05:27:02 -0500 (Thu, 22 Feb 2007)
New Revision: 4817

Added:
   plugins/branches/lifetype-1.2/tagcloud/
Removed:
   plugins/branches/lifetype-1.2/unported/tagcloud/
Modified:
   plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php
Log:
Ported the tagcloud plugin (Nothing really had to be changed here.)


Copied: plugins/branches/lifetype-1.2/tagcloud (from rev 4812, plugins/branches/lifetype-1.2/unported/tagcloud)

Modified: plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php
===================================================================
--- plugins/branches/lifetype-1.2/unported/tagcloud/plugintagcloud.class.php	2007-02-21 23:12:54 UTC (rev 4812)
+++ plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php	2007-02-22 10:27:02 UTC (rev 4817)
@@ -12,63 +12,66 @@
         var $pluginEnabled;
         var $cacheFolder;
 
-	/*
-	* Constructor
-	*/
-	function PluginTagCloud(){
-	
-		$this->author = "Ben Yacoub Hatem";
-		$this->desc = "This plugin generate TagCloud for a specific Blog, usage
-			    :<br/>
-			    <b>{ \$tagcloud->getTagCloud()}</b><br/><br/>
-			   getTagCloud return html of the Tag Cloud ready to use.<br/>
-			   See Readme for example usage.";
-		    
-		$this->PluginBase();
-		include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
-		$this->db =& Db::getDb();
-		$this->id = "tagcloud";
-		
-	    $this->locales = Array("en_UK");
-	    
-	                
-        $this->init();            
-    }
-  
-  
-    function init()
-    {
-        // register the events we want
-        $this->registerNotification( EVENT_POST_POST_ADD );
-        $this->registerNotification( EVENT_POST_POST_UPDATE );
-        $this->registerNotification( EVENT_POST_POST_DELETE );
+        /*
+        * Constructor
+        */
+        function PluginTagCloud( $source = "" ){
         
-
+            $this->author = "Ben Yacoub Hatem";
+            $this->desc = "This plugin generate TagCloud for a specific Blog, usage
+                    :<br/>
+                    <b>{ \$tagcloud->getTagCloud()}</b><br/><br/>
+                   getTagCloud return html of the Tag Cloud ready to use.<br/>
+                   See Readme for example usage.";
+                
+            $this->PluginBase($source);
+            include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
+            $this->db =& Db::getDb();
+            $this->id = "tagcloud";
+            
+            $this->locales = Array("en_UK");
+                                
+            if( $source == "admin" )
+                $this->initAdmin();
+            else
+                $this->init();
+        }
+      
+        function init()
+        {
+            // register the events we want
+            $this->registerNotification( EVENT_POST_POST_ADD );
+            $this->registerNotification( EVENT_POST_POST_UPDATE );
+            $this->registerNotification( EVENT_POST_POST_DELETE );    
+        }
     
-        $this->registerAdminAction( "tagcloud", "PluginTagCloudConfigAction" );
-        $this->registerAdminAction( "updateTagCloudConfig", "PluginTagCloudUpdateConfigAction" );
-        include_once( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
-        $menu =& Menu::getMenu();
-        if( !$menu->entryExists( "/menu/controlCenter/manageAppearancePlugins" ))                       
-            $this->addMenuEntry( "/menu/controlCenter", "manageAppearancePlugins", "", "", true, false );           
-        $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "TagCloud", "?op=tagcloud", "" );            
-    }
+      
+        function initAdmin()
+        {
+            $this->registerAdminAction( "tagcloud", "PluginTagCloudConfigAction" );
+            $this->registerAdminAction( "updateTagCloudConfig", "PluginTagCloudUpdateConfigAction" );
+            include_once( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
+            $menu =& Menu::getMenu();
+            if( !$menu->entryExists( "/menu/controlCenter/manageAppearancePlugins" ))                       
+                $this->addMenuEntry( "/menu/controlCenter", "manageAppearancePlugins", "", "", true, false );           
+            $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "TagCloud", "?op=tagcloud", "" );            
+        }
+        
+        function register()
+        {
+            $config =& Config::getConfig();
+            $this->cacheFolder = $config->getValue('temp_folder');
+            $this->cacheFolder = $this->cacheFolder.'/tagcloud/'.$this->blogInfo->getId();
+            if( !File::exists( $this->cacheFolder )) {
+                File::createDir( $this->cacheFolder, 0755 );
+            }
+            
+           $blogSettings = $this->blogInfo->getSettings();
+           $this->pluginEnabled = $blogSettings->getValue( "plugin_tagcloud_enabled" );
     
-    function register()
-    {
-        $config =& Config::getConfig();
-        $this->cacheFolder = $config->getValue('temp_folder');
-        $this->cacheFolder = $this->cacheFolder.'/tagcloud/'.$this->blogInfo->getId();
-        if( !File::exists( $this->cacheFolder )) {
-            File::createDir( $this->cacheFolder, 0755 );
         }
         
-       $blogSettings = $this->blogInfo->getSettings();
-       $this->pluginEnabled = $blogSettings->getValue( "plugin_tagcloud_enabled" );
 
-    }
-    
-
         function isEnabled()
         {
             return $this->pluginEnabled;



More information about the pLog-svn mailing list