[pLog-svn] r5385 - plugins/branches/lifetype-1.2/categorycloud

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Thu May 10 21:28:34 EDT 2007


Author: jondaley
Date: 2007-05-10 21:28:34 -0400 (Thu, 10 May 2007)
New Revision: 5385

Modified:
   plugins/branches/lifetype-1.2/categorycloud/plugincategorycloud.class.php
Log:
crazy.  I didn't seem to have really 'ported' this to 1.2 after all.

Modified: plugins/branches/lifetype-1.2/categorycloud/plugincategorycloud.class.php
===================================================================
--- plugins/branches/lifetype-1.2/categorycloud/plugincategorycloud.class.php	2007-05-11 01:27:43 UTC (rev 5384)
+++ plugins/branches/lifetype-1.2/categorycloud/plugincategorycloud.class.php	2007-05-11 01:28:34 UTC (rev 5385)
@@ -6,60 +6,67 @@
     /*
      * This plugin generates a CategoryCloud for a specific Blog
      */
-     class PluginCategoryCloud extends PluginBase
-     {
-	
+    class PluginCategoryCloud extends PluginBase
+    {
+        
         var $pluginEnabled;
         var $cacheFolder;
-
-	/*
-	* Constructor
-	*/
-	function PluginCategoryCloud() {
-
-		$this->PluginBase();
-	
-        $this->id        = "categorycloud";
-        $this->author    = "Mariano Draghi (cHagHi)";
-		$this->desc      = "This plugin offers a CategoryCloud for a specific Blog";
-
-        $this->version   = '20070502';
-		$this->locales   = Array( "en_UK", "es_ES" );
-
-        $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( "categorycloud", "PluginCategoryCloudConfigAction" );
-        $this->registerAdminAction( "updateCategoryCloudConfig", "PluginCategoryCloudUpdateConfigAction" );
-        $menu =& Menu::getMenu();
-        if( !$menu->entryExists( "/menu/controlCenter/manageAppearancePlugins" ))                       
-            $this->addMenuEntry( "/menu/controlCenter", "manageAppearancePlugins", "", "", true, false );           
-        $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "CategoryCloud", "?op=categorycloud", "" );
-    }
-    
-    function register()
-    {
-        $config =& Config::getConfig();
-        $this->cacheFolder = $config->getValue('temp_folder');
-        $this->cacheFolder = $this->cacheFolder.'/categorycloud/'.$this->blogInfo->getId();
-        if( !File::exists( $this->cacheFolder )) {
-            File::createDir( $this->cacheFolder, 0755 );
+        
+            /*
+             * Constructor
+             */
+        function PluginCategoryCloud($source = "") {
+            
+            $this->PluginBase($source);
+            
+            $this->id        = "categorycloud";
+            $this->author    = "Mariano Draghi (cHagHi)";
+            $this->desc      = "This plugin offers a CategoryCloud for a specific Blog";
+            
+            $this->version   = '20070510';
+            $this->locales   = Array( "en_UK", "es_ES" );
+            
+            if( $source == "admin" )
+                $this->initAdmin();
+            else
+                $this->init();
         }
         
-       $blogSettings = $this->blogInfo->getSettings();
-       $this->pluginEnabled = $blogSettings->getValue( "plugin_categorycloud_enabled" );
-
-    }
-    
-
+        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 );
+        }
+        
+        function initAdmin()
+        {
+            $this->init();
+            
+            $this->registerAdminAction( "categorycloud", "PluginCategoryCloudConfigAction" );
+            $this->registerAdminAction( "updateCategoryCloudConfig", "PluginCategoryCloudUpdateConfigAction" );
+            $menu =& Menu::getMenu();
+            if( !$menu->entryExists( "/menu/controlCenter/manageAppearancePlugins" ))                       
+                $this->addMenuEntry( "/menu/controlCenter", "manageAppearancePlugins", "", "", true, false );           
+            $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "CategoryCloud", "?op=categorycloud", "" );
+        }
+        
+        function register()
+        {
+            $config =& Config::getConfig();
+            $this->cacheFolder = $config->getValue('temp_folder');
+            $this->cacheFolder = $this->cacheFolder.'/categorycloud/'.$this->blogInfo->getId();
+            if( !File::exists( $this->cacheFolder )) {
+                File::createDir( $this->cacheFolder, 0755 );
+            }
+            
+            $blogSettings = $this->blogInfo->getSettings();
+            $this->pluginEnabled = $blogSettings->getValue( "plugin_categorycloud_enabled" );
+            
+        }
+        
+        
         function isEnabled()
         {
             return $this->pluginEnabled;
@@ -81,9 +88,6 @@
                 return true;
             }
             
-            // Load all of the settings for this blog
-            $this->register();
-            
             // make sure that the plugin is enabled
 			if( !$this->isEnabled())
             {



More information about the pLog-svn mailing list