<?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", "vn_VN" );
            $this->version = "20070829";
			
			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>";
	    }		


	}  
?>