[pLog-svn] r828 - in plugins/trunk/nofollow: class class/action class/view locale templates

mark at devel.plogworld.net mark at devel.plogworld.net
Tue Jan 25 11:09:36 GMT 2005


Author: mark
Date: 2005-01-25 11:09:35 +0000 (Tue, 25 Jan 2005)
New Revision: 828

Added:
   plugins/trunk/nofollow/class/view/
   plugins/trunk/nofollow/class/view/pluginnofollowconfigview.class.php
Modified:
   plugins/trunk/nofollow/class/action/pluginnofollowconfigaction.class.php
   plugins/trunk/nofollow/class/action/pluginnofollowupdateconfigaction.class.php
   plugins/trunk/nofollow/locale/locale_en_UK.php
   plugins/trunk/nofollow/locale/locale_zh_TW.php
   plugins/trunk/nofollow/templates/nofollow.template
Log:


Modified: plugins/trunk/nofollow/class/action/pluginnofollowconfigaction.class.php
===================================================================
--- plugins/trunk/nofollow/class/action/pluginnofollowconfigaction.class.php	2005-01-25 11:09:00 UTC (rev 827)
+++ plugins/trunk/nofollow/class/action/pluginnofollowconfigaction.class.php	2005-01-25 11:09:35 UTC (rev 828)
@@ -1,7 +1,8 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/nofollow/class/view/pluginnofollowconfigview.class.php" );
 
 	/**
 	 * shows a form with the current configuration
@@ -16,14 +17,8 @@
 		
 		function perform()
 		{
-			// load some configuration settings
-			$blogSettings = $this->_blogInfo->getSettings();
-			$pluginEnabled = $blogSettings->getValue( "plugin_nofollow_enabled" );
+            $this->_view = new PluginNoFollowConfigView( $this->_blogInfo );
 			
-			// create a view and export the settings to the template
-			$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "nofollow", "nofollow", true );
-			$this->_view->setValue( "pluginEnabled", $pluginEnabled );
-			
 			$this->setCommonData();
 			
 			return true;

Modified: plugins/trunk/nofollow/class/action/pluginnofollowupdateconfigaction.class.php
===================================================================
--- plugins/trunk/nofollow/class/action/pluginnofollowupdateconfigaction.class.php	2005-01-25 11:09:00 UTC (rev 827)
+++ plugins/trunk/nofollow/class/action/pluginnofollowupdateconfigaction.class.php	2005-01-25 11:09:35 UTC (rev 828)
@@ -1,8 +1,8 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminerrorview.class.php" );
-	include_once( PLOG_CLASS_PATH."class/view/admin/adminmessageview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/nofollow/class/view/pluginnofollowconfigview.class.php" );
 		
 	/**
 	 * updates the plugin configuration
@@ -34,11 +34,11 @@
 			// save the blogs settings
 			$blogs = new Blogs();
             if( !$blogs->updateBlog( $this->_blogInfo->getId(), $this->_blogInfo )) {
-                $this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setValue( "message", $this->_locale->tr("error_updating_settings"));
+                $this->_view = new PluginNoFollowConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
                 $this->setCommonData();
 
-                return false;
+                return false;                       
             }
 			
 			// if everything went ok...
@@ -46,9 +46,9 @@
             $this->_session->setValue( "blogInfo", $this->_blogInfo );
             $this->saveSession();
 			
-			$this->_view = new AdminMessageView( $this->_blogInfo );
-			$this->_view->setMessage( $this->_locale->tr("nofollow_settings_saved_ok"));
-			$this->setCommonData();
+			$this->_view = new PluginNoFollowConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("nofollow_settings_saved_ok"));			
+			$this->setCommonData();			
             
             return true;		
 		}

Added: plugins/trunk/nofollow/class/view/pluginnofollowconfigview.class.php
===================================================================
--- plugins/trunk/nofollow/class/view/pluginnofollowconfigview.class.php	2005-01-25 11:09:00 UTC (rev 827)
+++ plugins/trunk/nofollow/class/view/pluginnofollowconfigview.class.php	2005-01-25 11:09:35 UTC (rev 828)
@@ -0,0 +1,28 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginNoFollowConfigView extends AdminPluginTemplatedView
+	{
+
+		function PluginNoFollowConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "nofollow", "nofollow" );
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_nofollow_enabled" );
+			
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );		
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/trunk/nofollow/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/nofollow/locale/locale_en_UK.php	2005-01-25 11:09:00 UTC (rev 827)
+++ plugins/trunk/nofollow/locale/locale_en_UK.php	2005-01-25 11:09:35 UTC (rev 828)
@@ -1,6 +1,9 @@
 <?php
-$messages["nofollow_plugin_configuration"] = "Configuration this plugin";
 $messages["nofollow_plugin_enabled"] = "Enable this plugin";
 $messages["nofollow_plugin"] = "No Follow Plugin";
+
 $messages["nofollow_settings_saved_ok"] = "No Follow settings saved successfully!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
 ?>
\ No newline at end of file

Modified: plugins/trunk/nofollow/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/nofollow/locale/locale_zh_TW.php	2005-01-25 11:09:00 UTC (rev 827)
+++ plugins/trunk/nofollow/locale/locale_zh_TW.php	2005-01-25 11:09:35 UTC (rev 828)
@@ -1,6 +1,9 @@
 <?php
-$messages["nofollow_plugin_configuration"] = "外掛程式設定";
 $messages["nofollow_plugin_enabled"] = "啟動外掛程式";
 $messages["nofollow_plugin"] = "No Follow 外掛程式";
+
 $messages["nofollow_settings_saved_ok"] = "No Follow 設定儲存成功。";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "å•Ÿå‹•";
 ?>
\ No newline at end of file

Modified: plugins/trunk/nofollow/templates/nofollow.template
===================================================================
--- plugins/trunk/nofollow/templates/nofollow.template	2005-01-25 11:09:00 UTC (rev 827)
+++ plugins/trunk/nofollow/templates/nofollow.template	2005-01-25 11:09:35 UTC (rev 828)
@@ -2,15 +2,21 @@
 {include file="$admintemplatepath/navigation.template" showOpt=NoFollow title=$locale->tr("nofollow_plugin")}
 <form name="nofollowPluginConfig" method="post">
  <fieldset class="inputField">
- <legend>{$locale->tr("nofollow_plugin_configuration")}</legend>  
+ <legend>{$locale->tr("label_configuration")}</legend>  
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}   
   <div class="field">
-   <label for="pluginEnabled">{$locale->tr("nofollow_plugin_enabled")}</label>
-   <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" /><br/>
+   <label for="pluginEnabled">{$locale->tr("label_enable")}</label>
+   <div class="formHelp">   
+    <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" />{$locale->tr("nofollow_plugin_enabled")}
+   </div>
   </div>
+  
  </fieldset>  
- <br/>
+
  <div class="buttons">
   <input type="hidden" name="op" value="updateNoFollowConfig" />
+  <input type="reset" name="{$locale->tr("reset")}" />    
   <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
  </div>
 </form>




More information about the pLog-svn mailing list