[pLog-svn] r831 - in plugins/trunk: topcommentposts/class topcommentposts/class/action topcommentposts/class/view topcommentposts/locale topcommentposts/templates topcommentvisitors/class topcommentvisitors/class/action topcommentvisitors/class/view topcommentvisitors/locale topcommentvisitors/templates topreadposts/class topreadposts/class/action topreadposts/class/view topreadposts/locale topreadposts/templates toptrackbackposts/class toptrackbackposts/class/action toptrackbackposts/class/view toptrackbackposts/locale toptrackbackposts/templates

mark at devel.plogworld.net mark at devel.plogworld.net
Tue Jan 25 14:19:58 GMT 2005


Author: mark
Date: 2005-01-25 14:19:58 +0000 (Tue, 25 Jan 2005)
New Revision: 831

Added:
   plugins/trunk/topcommentposts/class/view/
   plugins/trunk/topcommentposts/class/view/plugintopcommentpostsconfigview.class.php
   plugins/trunk/topcommentvisitors/class/view/
   plugins/trunk/topcommentvisitors/class/view/plugintopcommentvisitorsconfigview.class.php
   plugins/trunk/topreadposts/class/view/
   plugins/trunk/topreadposts/class/view/plugintopreadpostsconfigview.class.php
   plugins/trunk/toptrackbackposts/class/view/
   plugins/trunk/toptrackbackposts/class/view/plugintoptrackbackpostsconfigview.class.php
Modified:
   plugins/trunk/topcommentposts/class/action/plugintopcommentpostsconfigaction.class.php
   plugins/trunk/topcommentposts/class/action/plugintopcommentpostsupdateconfigaction.class.php
   plugins/trunk/topcommentposts/locale/locale_en_UK.php
   plugins/trunk/topcommentposts/locale/locale_zh_TW.php
   plugins/trunk/topcommentposts/templates/topcommentposts.template
   plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsconfigaction.class.php
   plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsupdateconfigaction.class.php
   plugins/trunk/topcommentvisitors/locale/locale_en_UK.php
   plugins/trunk/topcommentvisitors/locale/locale_zh_TW.php
   plugins/trunk/topcommentvisitors/templates/topcommentvisitors.template
   plugins/trunk/topreadposts/class/action/plugintopreadpostsconfigaction.class.php
   plugins/trunk/topreadposts/class/action/plugintopreadpostsupdateconfigaction.class.php
   plugins/trunk/topreadposts/locale/locale_en_UK.php
   plugins/trunk/topreadposts/locale/locale_zh_TW.php
   plugins/trunk/topreadposts/templates/topreadposts.template
   plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsconfigaction.class.php
   plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsupdateconfigaction.class.php
   plugins/trunk/toptrackbackposts/locale/locale_en_UK.php
   plugins/trunk/toptrackbackposts/locale/locale_zh_TW.php
   plugins/trunk/toptrackbackposts/templates/toptrackbackposts.template
Log:
Update UI with plugin UI guide line. And seperate view from action to a seperate view class.

Modified: plugins/trunk/topcommentposts/class/action/plugintopcommentpostsconfigaction.class.php
===================================================================
--- plugins/trunk/topcommentposts/class/action/plugintopcommentpostsconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentposts/class/action/plugintopcommentpostsconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/topcommentposts/class/view/plugintopcommentpostsconfigview.class.php" );	
 
 	/**
 	 * shows a form with the current configuration
@@ -16,17 +17,8 @@
 		
 		function perform()
 		{
-			// load some configuration settings
-			$blogSettings = $this->_blogInfo->getSettings();
-			$pluginEnabled = $blogSettings->getValue( "plugin_topcommentposts_enabled" );
-			$maxPosts = $blogSettings->getValue( "plugin_topcommentposts_maxposts" );
-			if ($maxPosts == "") $maxPosts = 10;
+            $this->_view = new PluginTopCommentPostsConfigView( $this->_blogInfo );
 			
-			// create a view and export the settings to the template
-			$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "topcommentposts", "topcommentposts", true );
-			$this->_view->setValue( "pluginEnabled", $pluginEnabled );
-			$this->_view->setValue( "maxPosts", $maxPosts );
-			
 			$this->setCommonData();
 			
 			return true;

Modified: plugins/trunk/topcommentposts/class/action/plugintopcommentpostsupdateconfigaction.class.php
===================================================================
--- plugins/trunk/topcommentposts/class/action/plugintopcommentpostsupdateconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentposts/class/action/plugintopcommentpostsupdateconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/topcommentposts/class/view/plugintopcommentpostsconfigview.class.php" );	
 		
 	/**
 	 * updates the plugin configuration
@@ -23,13 +23,12 @@
             $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
             $this->_maxPosts = $this->_request->getValue( "maxPosts" );
             if( $this->_maxPosts <= 0 ) {
-                
-                
-                $this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setValue( "message", $this->_locale->tr("topcommentposts_error_maxposts"));
-                $this->setCommonData();  
-                return false;
-        }        	                
+                $this->_view = new PluginTopCommentPostsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("topcommentposts_error_maxposts"));
+                $this->setCommonData();
+
+                return false;                
+            }        	                
 			
 			return true;
 		}
@@ -45,21 +44,21 @@
 			// 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 PluginTopCommentPostsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
                 $this->setCommonData();
 
-                return false;
+                return false;                
             }
 			
 			// if everything went ok...
             $this->_blogInfo->setSettings( $blogSettings );
             $this->_session->setValue( "blogInfo", $this->_blogInfo );
             $this->saveSession();
-			
-			$this->_view = new AdminMessageView( $this->_blogInfo );
-			$this->_view->setMessage( $this->_locale->tr("topcommentposts_settings_saved_ok"));
-			$this->setCommonData();
+
+			$this->_view = new PluginTopCommentPostsConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("topcommentposts_settings_saved_ok"));
+			$this->setCommonData();				
             
             return true;		
 		}

Added: plugins/trunk/topcommentposts/class/view/plugintopcommentpostsconfigview.class.php
===================================================================
--- plugins/trunk/topcommentposts/class/view/plugintopcommentpostsconfigview.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentposts/class/view/plugintopcommentpostsconfigview.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -0,0 +1,31 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginTopCommentPostsConfigView extends AdminPluginTemplatedView
+	{
+
+		function PluginTopCommentPostsConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "topcommentposts", "topcommentposts" );
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_topcommentposts_enabled" );
+			$maxPosts = $blogSettings->getValue( "plugin_topcommentposts_maxposts" );
+			if ($maxPosts == "") $maxPosts = 10;
+			
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );
+			$this->setValue( "maxPosts", $maxPosts );	
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/trunk/topcommentposts/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/topcommentposts/locale/locale_en_UK.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentposts/locale/locale_en_UK.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["topcommentposts_maxposts"] = "Maximum Showed Posts";
-$messages["topcommentposts_plugin_configuration"] = "Configuration this plugin";
 $messages["topcommentposts_plugin_enabled"] = "Enable this plugin";
 $messages["topcommentposts_plugin"] = "Top Comment Posts Plugin";
+
 $messages["topcommentposts_settings_saved_ok"] = "Top Comment Posts settings saved successfully!";
-$messages["topcommentposts_error_maxposts"] = "Maximum Showed Posts Should >= 0!";
+$messages["topcommentposts_error_maxposts"] = "Maximum Showed Posts Should > 0!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["label_maxposts"] = "Max Comments";
 ?>
\ No newline at end of file

Modified: plugins/trunk/topcommentposts/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/topcommentposts/locale/locale_zh_TW.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentposts/locale/locale_zh_TW.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["topcommentposts_maxposts"] = "最多迴響文章顯示數量";
-$messages["topcommentposts_plugin_configuration"] = "外掛程式設定";
 $messages["topcommentposts_plugin_enabled"] = "啟動外掛程式";
 $messages["topcommentposts_plugin"] = "最多迴響文章外掛程式";
+
 $messages["topcommentposts_settings_saved_ok"] = "最多迴響文章設定儲存成功。";
-$messages["topcommentposts_error_maxposts"] = "最多迴響文章顯示數量必須要 >= 0!";
+$messages["topcommentposts_error_maxposts"] = "最多迴響文章顯示數量必須要 > 0!";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "å•Ÿå‹•";
+$messages["label_maxposts"] = "顯示數目";
 ?>
\ No newline at end of file

Modified: plugins/trunk/topcommentposts/templates/topcommentposts.template
===================================================================
--- plugins/trunk/topcommentposts/templates/topcommentposts.template	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentposts/templates/topcommentposts.template	2005-01-25 14:19:58 UTC (rev 831)
@@ -2,20 +2,29 @@
 {include file="$admintemplatepath/navigation.template" showOpt=TopCommentPosts title=$locale->tr("topcommentposts_plugin")}
 <form name="topcommentpostsPluginConfig" method="post">
  <fieldset class="inputField">
- <legend>{$locale->tr("topcommentposts_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("topcommentposts_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>
+   <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("topcommentposts_plugin_enabled")}
+   </div>
   </div>   
+
   <div class="field">
-   <label for="maxPosts">{$locale->tr("topcommentposts_maxposts")}</label>
+   <label for="maxPosts">{$locale->tr("label_maxposts")}</label>
    <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("topcommentposts_maxposts")}</div>
    <input class="text" type="text" name="maxPosts" id="maxPosts" value="{$maxPosts}"width="10" />
   </div>
+
  </fieldset>
- <br/>
+
  <div class="buttons">   
   <input type="hidden" name="op" value="updateTopCommentPostsConfig" />
+  <input type="reset" name="{$locale->tr("reset")}" />  
   <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
  </div>  
 </form>

Modified: plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsconfigaction.class.php
===================================================================
--- plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/topcommentvisitors/class/view/plugintopcommentvisitorsconfigview.class.php" );		
 
 	/**
 	 * shows a form with the current configuration
@@ -16,17 +17,8 @@
 		
 		function perform()
 		{
-			// load some configuration settings
-			$blogSettings = $this->_blogInfo->getSettings();
-			$pluginEnabled = $blogSettings->getValue( "plugin_topcommentvisitors_enabled" );
-			$maxVisitors = $blogSettings->getValue( "plugin_topcommentvisitors_maxvisitors" );
-			if ($maxVisitors == "") $maxVisitors = 10;
+            $this->_view = new PluginTopCommentVisitorsConfigView( $this->_blogInfo );
 			
-			// create a view and export the settings to the template
-			$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "topcommentvisitors", "topcommentvisitors", true );
-			$this->_view->setValue( "pluginEnabled", $pluginEnabled );
-			$this->_view->setValue( "maxVisitors", $maxVisitors );
-			
 			$this->setCommonData();
 			
 			return true;

Modified: plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsupdateconfigaction.class.php
===================================================================
--- plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsupdateconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentvisitors/class/action/plugintopcommentvisitorsupdateconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/topcommentvisitors/class/view/plugintopcommentvisitorsconfigview.class.php" );	
 		
 	/**
 	 * updates the plugin configuration
@@ -23,13 +23,12 @@
             $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
             $this->_maxVisitors = $this->_request->getValue( "maxVisitors" );
             if( $this->_maxVisitors <= 0 ) {
-                
-                
-                $this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setValue( "message", $this->_locale->tr("topcommentvisitors_error_maxvisitors"));
-                $this->setCommonData();  
-                return false;
-        }        	                
+                $this->_view = new PluginTopCommentVisitorsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("topcommentvisitors_error_maxvisitors"));
+                $this->setCommonData();
+
+                return false;                  
+            }        	                
 			
 			return true;
 		}
@@ -45,21 +44,21 @@
 			// 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 PluginTopCommentVisitorsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
                 $this->setCommonData();
 
-                return false;
+                return false;                    
             }
 			
 			// if everything went ok...
             $this->_blogInfo->setSettings( $blogSettings );
             $this->_session->setValue( "blogInfo", $this->_blogInfo );
             $this->saveSession();
-			
-			$this->_view = new AdminMessageView( $this->_blogInfo );
-			$this->_view->setMessage( $this->_locale->tr("topcommentvisitors_settings_saved_ok"));
-			$this->setCommonData();
+
+			$this->_view = new PluginTopCommentVisitorsConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("topcommentvisitors_settings_saved_ok"));
+			$this->setCommonData();				
             
             return true;		
 		}

Added: plugins/trunk/topcommentvisitors/class/view/plugintopcommentvisitorsconfigview.class.php
===================================================================
--- plugins/trunk/topcommentvisitors/class/view/plugintopcommentvisitorsconfigview.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentvisitors/class/view/plugintopcommentvisitorsconfigview.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -0,0 +1,31 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginTopCommentVisitorsConfigView extends AdminPluginTemplatedView
+	{
+
+		function PluginTopCommentVisitorsConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "topcommentvisitors", "topcommentvisitors" );
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_topcommentvisitors_enabled" );
+			$maxVisitors = $blogSettings->getValue( "plugin_topcommentvisitors_maxvisitors" );
+			if ($maxVisitors == "") $maxVisitors = 10;
+			
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );
+			$this->setValue( "maxVisitors", $maxVisitors );
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/trunk/topcommentvisitors/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/topcommentvisitors/locale/locale_en_UK.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentvisitors/locale/locale_en_UK.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["topcommentvisitors_maxvisitors"] = "Maximum Showed Visitors";
-$messages["topcommentvisitors_plugin_configuration"] = "Configuration this plugin";
 $messages["topcommentvisitors_plugin_enabled"] = "Enable this plugin";
 $messages["topcommentvisitors_plugin"] = "Top Comment Visitors Plugin";
+
 $messages["topcommentvisitors_settings_saved_ok"] = "Top Comment Visitors settings saved successfully!";
-$messages["topcommentvisitors_error_maxvisitors"] = "Maximum Showed Visitors Should >= 0!";
+$messages["topcommentvisitors_error_maxvisitors"] = "Maximum Showed Visitors Should > 0!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["label_maxvisitors"] = "Max Visitors";
 ?>
\ No newline at end of file

Modified: plugins/trunk/topcommentvisitors/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/topcommentvisitors/locale/locale_zh_TW.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentvisitors/locale/locale_zh_TW.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["topcommentvisitors_maxvisitors"] = "最多迴響訪客顯示數量";
-$messages["topcommentvisitors_plugin_configuration"] = "外掛程式設定";
 $messages["topcommentvisitors_plugin_enabled"] = "啟動外掛程式";
 $messages["topcommentvisitors_plugin"] = "最多迴響訪客外掛程式";
+
 $messages["topcommentvisitors_settings_saved_ok"] = "最多迴響訪客設定儲存成功。";
-$messages["topcommentvisitors_error_maxvisitors"] = "最多迴響訪客顯示數量必須要 >= 0!";
+$messages["topcommentvisitors_error_maxvisitors"] = "最多迴響訪客顯示數量必須要 > 0!";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "å•Ÿå‹•";
+$messages["label_maxvisitors"] = "顯示數目";
 ?>
\ No newline at end of file

Modified: plugins/trunk/topcommentvisitors/templates/topcommentvisitors.template
===================================================================
--- plugins/trunk/topcommentvisitors/templates/topcommentvisitors.template	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topcommentvisitors/templates/topcommentvisitors.template	2005-01-25 14:19:58 UTC (rev 831)
@@ -2,20 +2,29 @@
 {include file="$admintemplatepath/navigation.template" showOpt=TopCommentVisitors title=$locale->tr("topcommentvisitors_plugin")}
 <form name="topcommentvisitorsPluginConfig" method="post">
  <fieldset class="inputField">
- <legend>{$locale->tr("topcommentvisitors_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("topcommentvisitors_plugin_enabled")}</label>
-   <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" /><br/>
-  </div>   
+   <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("topcommentvisitors_plugin_enabled")}
+   </div>
+  </div>
+     
   <div class="field">
-   <label for="maxVisitors">{$locale->tr("topcommentvisitors_maxvisitors")}</label>
-   <span class="required">*</span>   
+   <label for="maxVisitors">{$locale->tr("label_maxvisitors")}</label>
+   <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("topcommentvisitors_maxvisitors")}</div>
    <input class="text" type="text" name="maxVisitors" id="maxVisitors" value="{$maxVisitors}" width="10" />
   </div>   
+
  </fieldset>
- <br/>
+
  <div class="buttons">  
   <input type="hidden" name="op" value="updateTopCommentVisitorsConfig" />
+  <input type="reset" name="{$locale->tr("reset")}" />   
   <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
  </div>  
 </form>

Modified: plugins/trunk/topreadposts/class/action/plugintopreadpostsconfigaction.class.php
===================================================================
--- plugins/trunk/topreadposts/class/action/plugintopreadpostsconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topreadposts/class/action/plugintopreadpostsconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/topreadposts/class/view/plugintopreadpostsconfigview.class.php" );	
 
 	/**
 	 * shows a form with the current configuration
@@ -16,17 +17,8 @@
 		
 		function perform()
 		{
-			// load some configuration settings
-			$blogSettings = $this->_blogInfo->getSettings();
-			$pluginEnabled = $blogSettings->getValue( "plugin_topreadposts_enabled" );
-			$maxPosts = $blogSettings->getValue( "plugin_topreadposts_maxposts" );
-			if ($maxPosts == "") $maxPosts = 10;
+            $this->_view = new PluginTopReadPostsConfigView( $this->_blogInfo );
 			
-			// create a view and export the settings to the template
-			$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "topreadposts", "topreadposts", true );
-			$this->_view->setValue( "pluginEnabled", $pluginEnabled );
-			$this->_view->setValue( "maxPosts", $maxPosts );
-			
 			$this->setCommonData();
 			
 			return true;

Modified: plugins/trunk/topreadposts/class/action/plugintopreadpostsupdateconfigaction.class.php
===================================================================
--- plugins/trunk/topreadposts/class/action/plugintopreadpostsupdateconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topreadposts/class/action/plugintopreadpostsupdateconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/topreadposts/class/view/plugintopreadpostsconfigview.class.php" );	
 		
 	/**
 	 * updates the plugin configuration
@@ -23,13 +23,12 @@
             $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
             $this->_maxPosts = $this->_request->getValue( "maxPosts" );
             if( $this->_maxPosts <= 0 ) {
-                
-                
-                $this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setValue( "message", $this->_locale->tr("topreadposts_error_maxposts"));
-                $this->setCommonData();  
-                return false;
-        }        	                
+                $this->_view = new PluginTopReadPostsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("topreadposts_error_maxposts"));
+                $this->setCommonData();
+
+                return false;                   
+            }        	                
 			
 			return true;
 		}
@@ -45,11 +44,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 PluginTopReadPostsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
                 $this->setCommonData();
 
-                return false;
+                return false;                  
             }
 			
 			// if everything went ok...
@@ -57,9 +56,9 @@
             $this->_session->setValue( "blogInfo", $this->_blogInfo );
             $this->saveSession();
 			
-			$this->_view = new AdminMessageView( $this->_blogInfo );
-			$this->_view->setMessage( $this->_locale->tr("topreadposts_settings_saved_ok"));
-			$this->setCommonData();
+			$this->_view = new PluginTopReadPostsConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("topreadposts_settings_saved_ok"));
+			$this->setCommonData();					
             
             return true;		
 		}

Added: plugins/trunk/topreadposts/class/view/plugintopreadpostsconfigview.class.php
===================================================================
--- plugins/trunk/topreadposts/class/view/plugintopreadpostsconfigview.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topreadposts/class/view/plugintopreadpostsconfigview.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -0,0 +1,31 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginTopReadPostsConfigView extends AdminPluginTemplatedView
+	{
+
+		function PluginTopReadPostsConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "topreadposts", "topreadposts" );
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_topreadposts_enabled" );
+			$maxPosts = $blogSettings->getValue( "plugin_topreadposts_maxposts" );
+			if ($maxPosts == "") $maxPosts = 10;
+			
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );
+			$this->setValue( "maxPosts", $maxPosts );
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/trunk/topreadposts/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/topreadposts/locale/locale_en_UK.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topreadposts/locale/locale_en_UK.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["topreadposts_maxposts"] = "Maximum Showed Posts";
-$messages["topreadposts_plugin_configuration"] = "Configuration this plugin";
 $messages["topreadposts_plugin_enabled"] = "Enable this plugin";
 $messages["topreadposts_plugin"] = "Top Read Posts Plugin";
+
 $messages["topreadposts_settings_saved_ok"] = "Top Read Posts settings saved successfully!";
-$messages["topreadposts_error_maxposts"] = "Maximum Showed Posts Should >= 0!";
+$messages["topreadposts_error_maxposts"] = "Maximum Showed Posts Should > 0!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["label_maxposts"] = "Max Comments";
 ?>
\ No newline at end of file

Modified: plugins/trunk/topreadposts/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/topreadposts/locale/locale_zh_TW.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topreadposts/locale/locale_zh_TW.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["topreadposts_maxposts"] = "最多閱讀文章顯示數量";
-$messages["topreadposts_plugin_configuration"] = "外掛程式設定";
 $messages["topreadposts_plugin_enabled"] = "啟動外掛程式";
 $messages["topreadposts_plugin"] = "最多閱讀文章外掛程式";
+
 $messages["topreadposts_settings_saved_ok"] = "最多閱讀文章設定儲存成功。";
-$messages["topreadposts_error_maxposts"] = "最多閱讀文章顯示數量必須要 >= 0!";
+$messages["topreadposts_error_maxposts"] = "最多閱讀文章顯示數量必須要 > 0!";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "å•Ÿå‹•";
+$messages["label_maxposts"] = "顯示數目";
 ?>
\ No newline at end of file

Modified: plugins/trunk/topreadposts/templates/topreadposts.template
===================================================================
--- plugins/trunk/topreadposts/templates/topreadposts.template	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/topreadposts/templates/topreadposts.template	2005-01-25 14:19:58 UTC (rev 831)
@@ -2,20 +2,29 @@
 {include file="$admintemplatepath/navigation.template" showOpt=TopReadPosts title=$locale->tr("topreadposts_plugin")}
 <form name="topreadpostsPluginConfig" method="post">
  <fieldset class="inputField">
- <legend>{$locale->tr("topreadposts_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("topreadposts_plugin_enabled")}</label>
-   <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" /><br/>
-  </div>   
+   <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("topreadposts_plugin_enabled")}
+   </div>
+  </div> 
+    
   <div class="field">
-   <label for="maxPosts">{$locale->tr("topreadposts_maxposts")}</label>
+   <label for="maxPosts">{$locale->tr("label_maxposts")}</label>
    <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("topreadposts_maxposts")}</div>
    <input class="text" type="text" name="maxPosts" id="maxPosts" value="{$maxPosts}" width="10" />
-  </div>   
+  </div>
+     
  </fieldset>
- <br/>
+
  <div class="buttons">  
   <input type="hidden" name="op" value="updateTopReadPostsConfig" />
+  <input type="reset" name="{$locale->tr("reset")}" />    
   <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
  </div>  
 </form>

Modified: plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsconfigaction.class.php
===================================================================
--- plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/toptrackbackposts/class/view/plugintoptrackbackpostsconfigview.class.php" );
 
 	/**
 	 * shows a form with the current configuration
@@ -16,17 +17,8 @@
 		
 		function perform()
 		{
-			// load some configuration settings
-			$blogSettings = $this->_blogInfo->getSettings();
-			$pluginEnabled = $blogSettings->getValue( "plugin_toptrackbackposts_enabled" );
-			$maxPosts = $blogSettings->getValue( "plugin_toptrackbackposts_maxposts" );
-			if ($maxPosts == "") $maxPosts = 10;
+            $this->_view = new PluginTopTrackbackPostsConfigView( $this->_blogInfo );
 			
-			// create a view and export the settings to the template
-			$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "toptrackbackposts", "toptrackbackposts", true );
-			$this->_view->setValue( "pluginEnabled", $pluginEnabled );
-			$this->_view->setValue( "maxPosts", $maxPosts );
-			
 			$this->setCommonData();
 			
 			return true;

Modified: plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsupdateconfigaction.class.php
===================================================================
--- plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsupdateconfigaction.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/toptrackbackposts/class/action/plugintoptrackbackpostsupdateconfigaction.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -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/toptrackbackposts/class/view/plugintoptrackbackpostsconfigview.class.php" );
 		
 	/**
 	 * updates the plugin configuration
@@ -23,13 +23,12 @@
             $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
             $this->_maxPosts = $this->_request->getValue( "maxPosts" );
             if( $this->_maxPosts <= 0 ) {
-                
-                
-                $this->_view = new AdminErrorView( $this->_blogInfo );
-                $this->_view->setValue( "message", $this->_locale->tr("toptrackbackposts_error_maxposts"));
-                $this->setCommonData();  
-                return false;
-        }        	                
+                $this->_view = new PluginTopTrackbackPostsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("toptrackbackposts_error_maxposts"));
+                $this->setCommonData();
+
+                return false;                  
+            }        	                
 			
 			return true;
 		}
@@ -45,21 +44,21 @@
 			// 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 PluginTopTrackbackPostsConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
                 $this->setCommonData();
 
-                return false;
+                return false;                  
             }
 			
 			// if everything went ok...
             $this->_blogInfo->setSettings( $blogSettings );
             $this->_session->setValue( "blogInfo", $this->_blogInfo );
             $this->saveSession();
-			
-			$this->_view = new AdminMessageView( $this->_blogInfo );
-			$this->_view->setMessage( $this->_locale->tr("toptrackbackposts_settings_saved_ok"));
-			$this->setCommonData();
+
+			$this->_view = new PluginTopTrackbackPostsConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("toptrackbackposts_settings_saved_ok"));
+			$this->setCommonData();				
             
             return true;		
 		}

Added: plugins/trunk/toptrackbackposts/class/view/plugintoptrackbackpostsconfigview.class.php
===================================================================
--- plugins/trunk/toptrackbackposts/class/view/plugintoptrackbackpostsconfigview.class.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/toptrackbackposts/class/view/plugintoptrackbackpostsconfigview.class.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -0,0 +1,31 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginTopTrackbackPostsConfigView extends AdminPluginTemplatedView
+	{
+
+		function PluginTopTrackbackPostsConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "toptrackbackposts", "toptrackbackposts" );
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_toptrackbackposts_enabled" );
+			$maxPosts = $blogSettings->getValue( "plugin_toptrackbackposts_maxposts" );
+			if ($maxPosts == "") $maxPosts = 10;
+			
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );
+			$this->setValue( "maxPosts", $maxPosts );
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/trunk/toptrackbackposts/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/toptrackbackposts/locale/locale_en_UK.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/toptrackbackposts/locale/locale_en_UK.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["toptrackbackposts_maxposts"] = "Maximum Showed Posts";
-$messages["toptrackbackposts_plugin_configuration"] = "Configuration this plugin";
 $messages["toptrackbackposts_plugin_enabled"] = "Enable this plugin";
 $messages["toptrackbackposts_plugin"] = "Top Trackback Posts Plugin";
+
 $messages["toptrackbackposts_settings_saved_ok"] = "Top Trackback Posts settings saved successfully!";
-$messages["toptrackbackposts_error_maxposts"] = "Maximum Showed Posts Should >= 0!";
+$messages["toptrackbackposts_error_maxposts"] = "Maximum Showed Posts Should > 0!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["label_maxposts"] = "Max Comments";
 ?>
\ No newline at end of file

Modified: plugins/trunk/toptrackbackposts/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/toptrackbackposts/locale/locale_zh_TW.php	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/toptrackbackposts/locale/locale_zh_TW.php	2005-01-25 14:19:58 UTC (rev 831)
@@ -1,8 +1,12 @@
 <?php
 $messages["toptrackbackposts_maxposts"] = "最多引用文章顯示數量";
-$messages["toptrackbackposts_plugin_configuration"] = "外掛程式設定";
 $messages["toptrackbackposts_plugin_enabled"] = "啟動外掛程式";
 $messages["toptrackbackposts_plugin"] = "最多引用文章外掛程式";
+
 $messages["toptrackbackposts_settings_saved_ok"] = "最多引用文章設定儲存成功。";
-$messages["toptrackbackposts_error_maxposts"] = "最多引用文章顯示數量必須要 >= 0!";
+$messages["toptrackbackposts_error_maxposts"] = "最多引用文章顯示數量必須要 > 0!";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "å•Ÿå‹•";
+$messages["label_maxposts"] = "顯示數目";
 ?>
\ No newline at end of file

Modified: plugins/trunk/toptrackbackposts/templates/toptrackbackposts.template
===================================================================
--- plugins/trunk/toptrackbackposts/templates/toptrackbackposts.template	2005-01-25 12:27:28 UTC (rev 830)
+++ plugins/trunk/toptrackbackposts/templates/toptrackbackposts.template	2005-01-25 14:19:58 UTC (rev 831)
@@ -2,20 +2,29 @@
 {include file="$admintemplatepath/navigation.template" showOpt=TopTrackbackPosts title=$locale->tr("toptrackbackposts_plugin")}
 <form name="toptrackbackpostsPluginConfig" method="post">
  <fieldset class="inputField">
- <legend>{$locale->tr("toptrackbackposts_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("toptrackbackposts_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>
+   <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("toptrackbackposts_plugin_enabled")}
+   </div>
   </div>
+
   <div class="field">
-   <label for="maxPosts">{$locale->tr("toptrackbackposts_maxposts")}</label>
+   <label for="maxPosts">{$locale->tr("label_maxposts")}</label>
    <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("toptrackbackposts_maxposts")}</div>
    <input class="text" type="text" name="maxPosts" id="maxPosts" value="{$maxPosts}" width="10" />
   </div>   
+ 
  </fieldset>
- <br/>
+
  <div class="buttons">  
   <input type="hidden" name="op" value="updateTopTrackbackPostsConfig" />
+  <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