[pLog-svn] r4047 - in plugins/branches/lifetype-1.1: . movabletype movabletype/class movabletype/class/action movabletype/class/view movabletype/locale movabletype/templates

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Mon Sep 25 20:20:05 GMT 2006


Author: pwestbro
Date: 2006-09-25 20:20:04 +0000 (Mon, 25 Sep 2006)
New Revision: 4047

Added:
   plugins/branches/lifetype-1.1/movabletype/
   plugins/branches/lifetype-1.1/movabletype/class/
   plugins/branches/lifetype-1.1/movabletype/class/action/
   plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeconfigaction.class.php
   plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeupdateconfigaction.class.php
   plugins/branches/lifetype-1.1/movabletype/class/view/
   plugins/branches/lifetype-1.1/movabletype/class/view/pluginmovabletypeconfigview.class.php
   plugins/branches/lifetype-1.1/movabletype/locale/
   plugins/branches/lifetype-1.1/movabletype/locale/locale_en_UK.php
   plugins/branches/lifetype-1.1/movabletype/pluginmovabletype.class.php
   plugins/branches/lifetype-1.1/movabletype/readme.txt
   plugins/branches/lifetype-1.1/movabletype/templates/
   plugins/branches/lifetype-1.1/movabletype/templates/movabletype.template
Log:
Added plugin to enable LifeType to correctly populate the returned fields in
metaWeblog.getPost and metaWeblog.getRecentPosts


Added: plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeconfigaction.class.php	2006-09-25 19:24:36 UTC (rev 4046)
+++ plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeconfigaction.class.php	2006-09-25 20:20:04 UTC (rev 4047)
@@ -0,0 +1,45 @@
+<?php
+
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+    
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    */
+    
+
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/movabletype/class/view/pluginmovabletypeconfigview.class.php" );
+
+	/**
+	 * shows a form with the current configuration
+	 */
+	class PluginMovabletypeConfigAction extends AdminAction
+	{
+		
+		function PluginMovabletypeConfigAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function perform()
+		{
+            $this->_view = new PluginMovabletypeConfigView( $this->_blogInfo );
+			
+			$this->setCommonData();
+			
+			return true;
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeupdateconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeupdateconfigaction.class.php	2006-09-25 19:24:36 UTC (rev 4046)
+++ plugins/branches/lifetype-1.1/movabletype/class/action/pluginmovabletypeupdateconfigaction.class.php	2006-09-25 20:20:04 UTC (rev 4047)
@@ -0,0 +1,79 @@
+<?php
+
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+    
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    */
+
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/movabletype/class/view/pluginmovabletypeconfigview.class.php" );
+		
+	/**
+	 * updates the plugin configuration
+	 */
+	class PluginMovabletypeUpdateConfigAction extends AdminAction
+	{
+		var $_use_mt_more_text;
+		var $_sitesArray;
+		
+		function PluginMovabletypeUpdateConfigAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function validate()
+		{
+
+            $this->_use_mt_more_text = $this->_request->getValue( "useMTMoreText" );
+            $this->_use_mt_more_text = ($this->_use_mt_more_text != "" );			
+			
+			return true;
+		}
+		        
+		function perform()
+		{
+
+            // update the plugin configurations to blog setting
+			$blogSettings = $this->_blogInfo->getSettings();
+            $blogSettings->setValue( "xmlrpc_movabletype_enabled", $this->_use_mt_more_text );
+            $this->_blogInfo->setSettings( $blogSettings ); 
+		
+			// save the blogs settings
+			$blogs = new Blogs();
+            if( !$blogs->updateBlog( $this->_blogInfo )) {
+                $this->_view = new PluginMovabletypeConfigView( $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 PluginMovabletypeConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("movabletype_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.1/movabletype/class/view/pluginmovabletypeconfigview.class.php
===================================================================
--- plugins/branches/lifetype-1.1/movabletype/class/view/pluginmovabletypeconfigview.class.php	2006-09-25 19:24:36 UTC (rev 4046)
+++ plugins/branches/lifetype-1.1/movabletype/class/view/pluginmovabletypeconfigview.class.php	2006-09-25 20:20:04 UTC (rev 4047)
@@ -0,0 +1,50 @@
+<?php
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+    
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    */
+
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginMovabletypeConfigView extends AdminPluginTemplatedView
+	{
+        var $_pm;
+
+
+
+		function PluginMovabletypeConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "movabletype", "movabletype" );
+			
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$mtMoreTextEnabled = $blogSettings->getValue( "xmlrpc_movabletype_enabled" );
+			
+			// create a view and export the settings to the template
+			$this->setValue( "useMTMoreText", $mtMoreTextEnabled );		
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/movabletype/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.1/movabletype/locale/locale_en_UK.php	2006-09-25 19:24:36 UTC (rev 4046)
+++ plugins/branches/lifetype-1.1/movabletype/locale/locale_en_UK.php	2006-09-25 20:20:04 UTC (rev 4047)
@@ -0,0 +1,14 @@
+<?php
+$messages["manageAppearancePlugins"] = "Appearance Management";
+$messages["movabletype"] = "MovableType";
+
+$messages["movabletype_plugin_enabled"] = "Enable MovableType xmlrpc";
+$messages["movabletype_plugin"] = "MovableType";
+$messages["detail"] = "Detail";
+
+$messages["movabletype_settings_saved_ok"] = "MovableType settings saved successfully!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["enable_description"] = "This option changes LifeType to use the MovableType extensions to the xmlrpc specification";
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/movabletype/pluginmovabletype.class.php
===================================================================
--- plugins/branches/lifetype-1.1/movabletype/pluginmovabletype.class.php	2006-09-25 19:24:36 UTC (rev 4046)
+++ plugins/branches/lifetype-1.1/movabletype/pluginmovabletype.class.php	2006-09-25 20:20:04 UTC (rev 4047)
@@ -0,0 +1,59 @@
+<?php
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+    
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    */
+
+
+
+	include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
+	include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
+	include_once( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
+
+
+	class PluginMovabletype extends PluginBase
+	{
+
+		
+		function PluginMovabletype()
+		{
+			$this->PluginBase();
+
+			$this->id      = "movabletype";
+			$this->author  = "Paul Westbrook";
+			$this->desc    = "This plugin enables extended text in xmlrpc structures.";
+
+			$this->locales = Array( "en_UK");
+
+			$this->init();
+		}
+
+		function init()
+		{
+            $this->registerAdminAction( "movabletypeConfig", "PluginMovabletypeConfigAction" );
+			$this->registerAdminAction( "updateMovabletypeConfig", "PluginMovabletypeUpdateConfigAction" );
+			
+			$menu =& Menu::getMenu();
+            if( !$menu->entryExists( "/menu/controlCenter/manageSettings" ))                     
+                $this->addMenuEntry( "/menu/controlCenter", "manageSettings", "", "", true, false );
+            $this->addMenuEntry( "/menu/controlCenter/manageSettings", "movabletype", "?op=movabletypeConfig", "" );
+		}
+
+		function register()
+		{
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/branches/lifetype-1.1/movabletype/readme.txt
===================================================================
--- plugins/branches/lifetype-1.1/movabletype/readme.txt	2006-09-25 19:24:36 UTC (rev 4046)
+++ plugins/branches/lifetype-1.1/movabletype/readme.txt	2006-09-25 20:20:04 UTC (rev 4047)
@@ -0,0 +1,7 @@
+Plugin: MovableType
+Author: paul at westbrooks.org
+Release Date: 2006/09/25
+Version: 1.0
+
+Enables the MovableType extensions to the metaWeblog xmlrcp specification.
+http://www.movabletype.org/mt-static/docs/mtmanual_programmatic.html

Added: plugins/branches/lifetype-1.1/movabletype/templates/movabletype.template
===================================================================
--- plugins/branches/lifetype-1.1/movabletype/templates/movabletype.template	2006-09-25 19:24:36 UTC (rev 4046)
+++ plugins/branches/lifetype-1.1/movabletype/templates/movabletype.template	2006-09-25 20:20:04 UTC (rev 4047)
@@ -0,0 +1,23 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=movabletype title=$locale->tr("movabletype_plugin")}
+<form name="movabletypePluginConfig" method="post">
+ <fieldset class="inputField">
+ <legend>{$locale->tr("label_configuration")}</legend>  
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}   
+  <div class="field">
+   <label for="useMTMoreText">{$locale->tr("label_enable")}</label>
+   <div class="formHelp"> {$locale->tr("enable_description")}</div>  
+    <input class="checkbox" type="checkbox" name="useMTMoreText" id="useMTMoreText" {if $useMTMoreText} checked="checked" {/if} value="1" />{$locale->tr("movabletype_plugin_enabled")}
+ 
+  </div>
+ </fieldset>  
+
+ <div class="buttons">
+  <input type="hidden" name="op" value="updateMovabletypeConfig" />
+  <input type="reset" name="{$locale->tr("reset")}" />    
+  <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
+ </div>
+</form>
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}



More information about the pLog-svn mailing list