[pLog-svn] r5878 - in plugins/branches/lifetype-1.2: . plugoo plugoo/class plugoo/class/action plugoo/class/view plugoo/locale plugoo/templates

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Aug 29 21:59:18 EDT 2007


Author: jondaley
Date: 2007-08-29 21:59:17 -0400 (Wed, 29 Aug 2007)
New Revision: 5878

Added:
   plugins/branches/lifetype-1.2/plugoo/
   plugins/branches/lifetype-1.2/plugoo/class/
   plugins/branches/lifetype-1.2/plugoo/class/action/
   plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginsettingsaction.class.php
   plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginupdatesettingsaction.class.php
   plugins/branches/lifetype-1.2/plugoo/class/view/
   plugins/branches/lifetype-1.2/plugoo/class/view/adminplugoopluginsettingsview.class.php
   plugins/branches/lifetype-1.2/plugoo/locale/
   plugins/branches/lifetype-1.2/plugoo/locale/locale_en_UK.php
   plugins/branches/lifetype-1.2/plugoo/locale/locale_vn_VN.php
   plugins/branches/lifetype-1.2/plugoo/pluginplugoo.class.php
   plugins/branches/lifetype-1.2/plugoo/plugoo-read-me.txt
   plugins/branches/lifetype-1.2/plugoo/templates/
   plugins/branches/lifetype-1.2/plugoo/templates/pluginsettings.template
Log:
plugoo plugin from http://forums.lifetype.net/viewtopic.php?t=6944

Added: plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginsettingsaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginsettingsaction.class.php	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginsettingsaction.class.php	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,30 @@
+<?php
+
+	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	lt_include( PLOG_CLASS_PATH."plugins/plugoo/class/view/adminplugoopluginsettingsview.class.php" );
+
+    class AdminPlugooPluginSettingsAction extends AdminAction 
+	{
+
+    	/**
+         * Constructor. If nothing else, it also has to call the constructor of the parent
+         * class, BlogAction with the same parameters
+         */
+        function AdminPlugooPluginSettingsAction( $actionInfo, $request )
+        {
+        	$this->AdminAction( $actionInfo, $request );
+        }
+
+        /**
+         * Carries out the specified action
+         */
+        function perform()
+        {
+            $this->_view = new AdminPlugooPluginSettingsView( $this->_blogInfo );
+			
+			$this->setCommonData();
+			
+			return true;
+        }
+    }
+?>

Added: plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginupdatesettingsaction.class.php
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginupdatesettingsaction.class.php	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/class/action/adminplugoopluginupdatesettingsaction.class.php	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,85 @@
+
+<?php
+
+	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	lt_include( PLOG_CLASS_PATH."plugins/plugoo/class/view/adminplugoopluginsettingsview.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
+
+    class AdminPlugooPluginUpdateSettingsAction extends AdminAction 
+	{
+	
+		var $_pluginEnabled;
+		var $_key;
+    	/**
+         * Constructor. If nothing else, it also has to call the constructor of the parent
+         * class, BlogAction with the same parameters
+         */
+        function AdminPlugooPluginUpdateSettingsAction( $actionInfo, $request )
+        {
+        	$this->AdminAction( $actionInfo, $request );
+        }
+		
+		function validate()
+		{
+			$this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
+			
+			if( $this->_pluginEnabled == "" )
+				$this->_pluginEnabled = false;
+			else
+				$this->_pluginEnabled = true;
+				
+			// get the parameters from the request
+			$this->_url  = $this->_request->getValue( "pluginUrl" );
+			
+			return true;
+		}
+		
+
+        /**
+         * Carries out the specified action
+         */
+        function perform()
+        {
+			// Check data
+			if ($this->_pluginEnabled && $this->_url == "") {
+                $this->_view = new AdminPlugooPluginSettingsView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("plugoo_pluginurl_error"));
+                $this->setCommonData();
+
+                return false; 				
+			}
+			
+			// save the plugin settings to the db
+			$blogSettings = $this->_blogInfo->getSettings();
+			$blogSettings->setValue( "plugin_plugoo_enabled", $this->_pluginEnabled );
+			$blogSettings->setValue( "plugin_plugoo_url", $this->_url );
+			$this->_blogInfo->setSettings( $blogSettings );
+			$blogs = new Blogs();
+			
+			// update the settings in the db, and make sure that everything went fine
+            if( !$blogs->updateBlog( $this->_blogInfo )) {
+                $this->_view = new AdminPlugooPluginSettingsView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
+                $this->setCommonData();
+
+                return false; 				
+			}
+			
+
+			// if everything went ok...
+            $this->_blogInfo->setSettings( $blogSettings );
+            $this->_session->setValue( "blogInfo", $this->_blogInfo );
+            $this->saveSession();
+			
+			$this->_view = new AdminPlugooPluginSettingsView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("plugoo_settings_saved_ok"));			
+			$this->setCommonData();
+			
+			// clear the cache
+			CacheControl::resetBlogCache( $this->_blogInfo->getId());			
+            
+            return true;
+        }
+    }
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.2/plugoo/class/view/adminplugoopluginsettingsview.class.php
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/class/view/adminplugoopluginsettingsview.class.php	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/class/view/adminplugoopluginsettingsview.class.php	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,34 @@
+
+<?php
+	
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class AdminPlugooPluginSettingsView extends AdminPluginTemplatedView
+	{
+
+		function AdminPlugooPluginSettingsView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "plugoo", "pluginsettings" );
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_plugoo_enabled" );
+			$pluginUrl = $blogSettings->getValue( "plugin_plugoo_url" );
+			
+       		
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );
+			$this->setValue( "pluginUrl", $pluginUrl );
+			
+			
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.2/plugoo/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/locale/locale_en_UK.php	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/locale/locale_en_UK.php	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,17 @@
+<?php
+$messages["manageAppearancePlugins"] = "Appearance Management";
+$messages["plugooPluginSettings"] = "Plugoo";
+$messages["plugoo"] = "Plugoo";
+$messages["plugooTags_help"] = "Account needed for Plugoo use";
+
+$messages["plugoo_plugin_enabled"] = "Enable this plugin";
+$messages["plugoo_plugin"] = "Plugoo Plugin";
+$messages["plugoo_pluginurl"] = "HTML code or ID";
+$messages["label_pluginurl"] = "HTML code or ID";
+$messages["plugoo_pluginurl_error"] = "HTML code or ID (e.g 858L9ZIJLPEPQD6). You should use ID to avoid error with IE 7.";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+
+$messages["plugoo_settings_saved_ok"] = "plugoo settings saved successfully!";
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.2/plugoo/locale/locale_vn_VN.php
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/locale/locale_vn_VN.php	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/locale/locale_vn_VN.php	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,17 @@
+<?php
+$messages["manageAppearancePlugins"] = "Quảnn lý giao diện";
+$messages["plugooPluginSettings"] = "Plugoo";
+$messages["plugoo"] = "Plugoo";
+$messages["plugooTags_help"] = "Bạn cần phải có tài khoản Plugoo để sử dụng tính năng này";
+
+$messages["plugoo_plugin_enabled"] = "Kích hoạt plugin này";
+$messages["plugoo_plugin"] = "Plugoo Plugin";
+$messages["label_pluginurl"] = "Đoạn mã HTML hoặc ID";
+$messages["plugoo_pluginurl"] = "Đoạn mã HTML hoặc ID (ví dụ 858L9ZIJLPEPQD6) mà Plugoo cung cấp. Nên dùng ID để dễ tương thích với trình duyệt IE hơn.";
+$messages["plugoo_pluginurl_error"] = "Đoạn mã HTML hoặc ID không thể trống";
+
+$messages["label_configuration"] = "Cấu hình";
+$messages["label_enable"] = "Kích hoạt";
+
+$messages["plugoo_settings_saved_ok"] = "Thiết lập thông số thành công!";
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.2/plugoo/pluginplugoo.class.php
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/pluginplugoo.class.php	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/pluginplugoo.class.php	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,65 @@
+<?php
+	lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
+	/* plugoo plugin */
+
+	class PluginPlugoo extends PluginBase
+	{
+	    var $pluginEnabled;
+		var $pluginUrl;
+	
+		function PluginPlugoo( $source = "" )
+		{
+			$this->PluginBase($source);
+			
+			$this->id = "plugoo";
+			$this->desc ="Implements Plugoo Live Chat Messenger which allows blog visitors to contact you directly via your instant messenger account needed at www.plugoo.com";
+			$this->author = "Andy Collins";
+			$this->locales = Array("en_UK" );
+                        $this->version = "0.1";
+			
+			if( $source == "admin" )
+				$this->initAdmin();
+		}
+		
+		/**
+		 * registers all the filters and actions that we're going to use
+		 */
+		function initAdmin()
+		{
+			$this->registerAdminAction( "plugooPluginSettings", "AdminPlugooPluginSettingsAction" );
+			$this->registerAdminAction( "plugooUpdateSettings", "AdminPlugooPluginUpdateSettingsAction" );			
+			
+			// add a menu entry pluginPlugooUpdateSettings
+			$this->addMenuEntry( "/menu/controlCenter/manageSettings", "plugooPluginSettings", "admin.php?op=plugooPluginSettings", "", true, false );
+			
+		}
+		
+		function register()
+		{
+		    $blogSettings = $this->blogInfo->getSettings();
+		    $this->pluginEnabled = $blogSettings->getValue( "plugin_plugoo_enabled" );
+			$this->pluginUrl = $blogSettings->getValue( "plugin_plugoo_url" );
+	    }
+	    
+	    function isEnabled()
+	    {
+	        return $this->pluginEnabled;
+	    }
+
+	    function getPlugoo()
+	    {
+			if (ereg('[^A-Za-z0-9]', $this->pluginUrl))
+				return $this->pluginUrl;
+			else
+		        return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"160\" height=\"300\" id=\"plugoo\" align=\"middle\">
+<param name=\"movie\" value=\"http://www.plugoo.com/plug.swf?go=".$this->pluginUrl."\">
+<param name=\"quality\" value=\"high\">
+<embed src=\"http://www.plugoo.com/plug.swf?go=".$this->pluginUrl."\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"160\" height=\"300\"></embed>
+<param name=\"allowScriptAccess\" value=\"always\" />
+<param name=\"wmode\" value=\"transparent\" />
+</object>";
+	    }		
+
+
+	}  
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.2/plugoo/plugoo-read-me.txt
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/plugoo-read-me.txt	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/plugoo-read-me.txt	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,32 @@
+Plugin: Plugoo Live Chat Plugin
+Author: Andy Collins
+Release Date: 2007/26/08
+LT VErsion: 1.2.4
+Licence: GPL.
+
+Released under GPL Licence. All rights reserved. Original ownership must accompany any plugin dereivatives. PLugin is free for use and distribution.
+Contact webmaster at blogireland.ie with details of where used - be nice to see it in use elsewhere. 
+
+This plugin allows the blog owner to have a live chat messenger in there blog. 
+Connects directly to there favorite messenger client
+
+Install:
+1. Copy the files into your plugin directory like any other plugin.
+
+Use:
+1. Sign up for an account at http://www.plugoo.com
+2. Copy the 'Object code'
+3. Go to Control Center and click on 'Plugoo'
+4. Tick Enable This Plugin
+5. Paste the 'Object' code into the Plugoo URl - object code Field (You can use Object code or ID (e.g 858L9ZIJLPEPQD6)
+6. Update settings
+
+
+To Implement: Copy the folowing to your Template Navigation 
+(Adjust div id to suit your template styling).
+
+{if $plugoo->isEnabled()}
+<div id="style attribute here">
+{$plugoo->getPlugoo()}
+</div>
+{/if} 
\ No newline at end of file

Added: plugins/branches/lifetype-1.2/plugoo/templates/pluginsettings.template
===================================================================
--- plugins/branches/lifetype-1.2/plugoo/templates/pluginsettings.template	                        (rev 0)
+++ plugins/branches/lifetype-1.2/plugoo/templates/pluginsettings.template	2007-08-30 01:59:17 UTC (rev 5878)
@@ -0,0 +1,34 @@
+
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=plugooPluginSettings title=$locale->tr("plugoo_plugin")}
+<form name="pluginPlugooSettings" action="admin.php" method="get">
+ <fieldset class="inputField">
+ <legend>{$locale->tr("label_configuration")}</legend> 
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"} 
+  <div class="field">
+   <label for="pluginEnabled">{$locale->tr("label_enable")}</label>
+   <span class="required"></span>   
+   <div class="formHelp">
+    <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" />{$locale->tr("plugoo_plugin_enabled")}
+   </div>
+  </div>
+
+  <div class="field">
+   <label for="pluginurl">{$locale->tr("label_pluginurl")}</label>
+   <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("plugoo_pluginurl")}</div>    
+   <input class="text" type="text" name="pluginUrl" id="pluginKey" value='{$pluginUrl}' width="120" />
+  </div>
+ </fieldset>
+
+
+
+ <div class="buttons"> 
+  <input type="hidden" name="op" value="plugooUpdateSettings" />
+  <input type="reset" name="{$locale->tr("reset")}" />  
+  <input type="submit" name="{$locale->tr("update")}" value="{$locale->tr("update")}" />
+ </div>
+</form>
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}



More information about the pLog-svn mailing list