[pLog-svn] r5375 - plugins/branches/lifetype-1.2/unported/categorycloud

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed May 2 23:41:33 EDT 2007


Author: jondaley
Date: 2007-05-02 23:41:33 -0400 (Wed, 02 May 2007)
New Revision: 5375

Modified:
   plugins/branches/lifetype-1.2/unported/categorycloud/plugincategorycloud.class.php
   plugins/branches/lifetype-1.2/unported/categorycloud/readme.txt
Log:
updated for 1.2.  Thanks chaghi

Modified: plugins/branches/lifetype-1.2/unported/categorycloud/plugincategorycloud.class.php
===================================================================
--- plugins/branches/lifetype-1.2/unported/categorycloud/plugincategorycloud.class.php	2007-05-02 14:09:07 UTC (rev 5374)
+++ plugins/branches/lifetype-1.2/unported/categorycloud/plugincategorycloud.class.php	2007-05-03 03:41:33 UTC (rev 5375)
@@ -1,15 +1,10 @@
 <?php
 
 lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
-lt_include( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
 
     
     /*
      * This plugin generates a CategoryCloud for a specific Blog
-     *
-     * The plugin is based on TagCloud, by Ben Yacoub Hatem. In fact, most
-     * of the admin interface and the main algorithm to build the cloud is
-     * EXACTLY the same.
      */
      class PluginCategoryCloud extends PluginBase
      {
@@ -28,7 +23,7 @@
         $this->author    = "Mariano Draghi (cHagHi)";
 		$this->desc      = "This plugin offers a CategoryCloud for a specific Blog";
 
-        $this->version   = '1.0';
+        $this->version   = '20070502';
 		$this->locales   = Array( "en_UK", "es_ES" );
 
         $this->init();
@@ -47,7 +42,7 @@
         $menu =& Menu::getMenu();
         if( !$menu->entryExists( "/menu/controlCenter/manageAppearancePlugins" ))                       
             $this->addMenuEntry( "/menu/controlCenter", "manageAppearancePlugins", "", "", true, false );           
-        $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "CategoryCloud", "?op=categorycloud", "" );            
+        $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "CategoryCloud", "?op=categorycloud", "" );
     }
     
     function register()
@@ -107,6 +102,7 @@
 	* Return cloud of the blog categories
 	*/
 	function createCloud(){
+        lt_include( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
 
 		$blogId = $this->blogInfo->getId();
 
@@ -181,29 +177,50 @@
 	    }
 		
     }
-    
+	
     /*
-	* Return cloud for blog's categories
+	* Return cloud for blog categories
 	*/
-	function getCategoryCloud(){
+    function getCategoryCloud(){
 
-        $saveFile = $this->cacheFolder."/categorycloud";  
-	    
 	    $Cloud = '';
 	    
-	    $fh = fopen( $saveFile, "r");
-	    if ($fh)
-	    {
-    	    $Cloud = fread($fh, filesize($saveFile));
-            fclose($fh);
-	    }
-		
-	
-		return $Cloud;
-		
+        if ($this->isEnabled())
+        {
+            $saveFile = $this->cacheFolder."/categorycloud";  
+            
+    
+            if(File::isReadable($saveFile)){
+                $fh = fopen( $saveFile, "r");
+                if ($fh)
+                {
+                    $Cloud = fread($fh, filesize($saveFile));
+                    fclose($fh);
+                }
+            }
+        }
+
+        return $Cloud;
     }
+
+    function getPluginConfigurationKeys()
+    {
+        lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+        lt_include( PLOG_CLASS_PATH."class/data/validator/floatvalidator.class.php" );
+        
+        return( Array(
+                    Array( "name" => "plugin_categorycloud_enabled", "type" => "boolean" ),
+                    Array( "name" => "plugin_categorycloud_min_size",
+                           "validator" => new FloatValidator(), "type" => "integer", "allowEmpty" => true ),
+                    Array( "name" => "plugin_categorycloud_max_size",
+                           "validator" => new FloatValidator(), "type" => "integer", "allowEmpty" => true ),
+                    Array( "name" => "plugin_categorycloud_min_weight",
+                           "validator" => new IntegerValidator(), "type" => "integer", "allowEmpty" => true ),
+                    Array( "name" => "plugin_categorycloud_max_weight",
+                           "validator" => new IntegerValidator(), "type" => "integer", "allowEmpty" => true ),
+                    ));
+    }
 	
-	
 }
         
         

Modified: plugins/branches/lifetype-1.2/unported/categorycloud/readme.txt
===================================================================
--- plugins/branches/lifetype-1.2/unported/categorycloud/readme.txt	2007-05-02 14:09:07 UTC (rev 5374)
+++ plugins/branches/lifetype-1.2/unported/categorycloud/readme.txt	2007-05-03 03:41:33 UTC (rev 5375)
@@ -1,28 +1,26 @@
 Plugin: CategoryCloud
 Author: Mariano Draghi
 Release Date: 2006/11/05
-Version: 1.0
+Current Version: 20070502
 
-This plugin offers a category cloud for a blog.
+This plugin offers a category cloud.
 
-The plugin is based on TagCloud, by Ben Yacoub Hatem. In fact, most
-of the admin interface and the main algorithm to build the cloud is
-EXACTLY the same.
+The plugin is based on TagCloud, by Ben Yacoub Hatem.
 
+Usage:
 
-Example usage:
 
-<div class="sidetitle">{$locale->tr("categories")}</div>
-<div class="side">
-{if $categorycloud->isEnabled()}
-  <div style="text-align:center; padding: 3px;">{ $categorycloud->getCategoryCloud()}</div>
-{else}
- <!-- fallback to "classic" categories sidebar -->
- <ul>
-  {foreach from=$articlecategories item=category}
-  <li><a href="{$url->categoryLink($category)}">{$category->getName()}</a></li>
-  {/foreach}
- </ul>
+{if $categorycloud && $categorycloud->isEnabled()}
+<h2> {$locale->tr("Category cloud")} </h2>
+<ul>
+ <li><div style="text-align:center">
+  {$categorycloud->getCategoryCloud()}
+ </div></li>
+</ul>
 {/if}
-</div>
 
+Changelog
+=========
+20070502 - Migration to LifeType 1.2
+1.0.0    - Initial version
+



More information about the pLog-svn mailing list