[pLog-svn] r1164 - in plugins/trunk/hostblock: . class/action class/view templates

mark at devel.plogworld.net mark at devel.plogworld.net
Wed Feb 23 08:32:03 GMT 2005


Author: mark
Date: 2005-02-23 08:32:03 +0000 (Wed, 23 Feb 2005)
New Revision: 1164

Added:
   plugins/trunk/hostblock/class/action/adminblockedhostsettingsaction.class.php
   plugins/trunk/hostblock/class/action/adminupdateblockedhostsettingsaction.class.php
   plugins/trunk/hostblock/class/view/adminblockedhostsettingsview.class.php
   plugins/trunk/hostblock/templates/blockedhostsettings.template
Removed:
   plugins/trunk/hostblock/class/action/adminupdatebloghostblockconfigaction.class.php
   plugins/trunk/hostblock/class/action/adminupdatehostblockconfigaction.class.php
Modified:
   plugins/trunk/hostblock/class/view/adminblockedhostsview.class.php
   plugins/trunk/hostblock/class/view/adminblogblockedhostsview.class.php
   plugins/trunk/hostblock/class/view/admineditblockedhostview.class.php
   plugins/trunk/hostblock/class/view/admineditblogblockedhostview.class.php
   plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php
   plugins/trunk/hostblock/class/view/adminnewblogblockedhostview.class.php
   plugins/trunk/hostblock/pluginhostblock.class.php
   plugins/trunk/hostblock/templates/addblockedhost.template
   plugins/trunk/hostblock/templates/addblogblockedhost.template
   plugins/trunk/hostblock/templates/blockedhosts.template
   plugins/trunk/hostblock/templates/blogblockedhosts.template
   plugins/trunk/hostblock/templates/editblockedhost.template
   plugins/trunk/hostblock/templates/editblogblockedhost.template
Log:
Modify hostblock plugin. Now, I seperate the enable option to another page. I think that make more sense. messages need to refine.

Added: plugins/trunk/hostblock/class/action/adminblockedhostsettingsaction.class.php
===================================================================
--- plugins/trunk/hostblock/class/action/adminblockedhostsettingsaction.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/action/adminblockedhostsettingsaction.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -0,0 +1,27 @@
+<?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."plugins/hostblock/class/view/adminblockedhostsettingsview.class.php" );
+
+	/**
+	 * shows a form with the current configuration
+	 */
+	class AdminBlockedHostSettingsAction extends AdminAction
+	{
+		
+		function AdminBlockedHostSettingsAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function perform()
+		{
+            $this->_view = new AdminBlockedHostSettingsView( $this->_blogInfo );
+			
+			$this->setCommonData();
+			
+			return true;
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/hostblock/class/action/adminupdateblockedhostsettingsaction.class.php
===================================================================
--- plugins/trunk/hostblock/class/action/adminupdateblockedhostsettingsaction.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/action/adminupdateblockedhostsettingsaction.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -0,0 +1,59 @@
+<?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."plugins/hostblock/class/view/adminblockedhostsettingsview.class.php" );
+		
+	/**
+	 * updates the plugin configuration
+	 */
+	class AdminUpdateBlockedHostSettingsAction extends AdminAction
+	{
+		var $_pluginEnabled;
+		
+		function AdminUpdateBlockedHostSettingsAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function validate()
+		{
+            $this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
+            $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
+			
+			return true;
+		}
+		        
+		function perform()
+		{
+            // // update the plugin configurations to blog setting
+			$blogSettings = $this->_blogInfo->getSettings();
+            $blogSettings->setValue( "plugin_hostblock_enabled", $this->_pluginEnabled );
+            $this->_blogInfo->setSettings( $blogSettings ); 
+		
+			// save the blogs settings
+			$blogs = new Blogs();
+            if( !$blogs->updateBlog( $this->_blogInfo->getId(), $this->_blogInfo )) {
+                $this->_view = new AdminBlockedHostSettingsView( $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 AdminBlockedHostSettingsView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("hostblock_settings_saved_ok"));			
+			$this->setCommonData();
+			
+			// clear the cache
+			CacheControl::resetBlogCache( $this->_blogInfo->getId());					
+            
+            return true;		
+		}
+	}
+?>
\ No newline at end of file

Deleted: plugins/trunk/hostblock/class/action/adminupdatebloghostblockconfigaction.class.php
===================================================================
--- plugins/trunk/hostblock/class/action/adminupdatebloghostblockconfigaction.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/action/adminupdatebloghostblockconfigaction.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,58 +0,0 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/action/admin/blogowneradminaction.class.php" );
-	include_once( PLOG_CLASS_PATH."plugins/hostblock/class/view/adminblogblockedhostsview.class.php" );
-		
-	/**
-	 * updates the plugin configuration
-	 */
-	class AdminUpdateBlogHostBlockConfigAction extends BlogOwnerAdminAction
-	{
-		var $_pluginEnabled;
-		
-		function AdminUpdateBlogHostBlockConfigAction( $actionInfo, $request )
-		{
-			$this->AdminAction( $actionInfo, $request );
-		}
-		
-		function validate()
-		{
-            $this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
-            $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
-			
-			return true;
-		}
-		        
-		function perform()
-		{
-            // update the plugin configurations to blog setting
-			$blogSettings = $this->_blogInfo->getSettings();
-            $blogSettings->setValue( "plugin_hostblock_enabled", $this->_pluginEnabled );
-            $this->_blogInfo->setSettings( $blogSettings ); 
-		
-			// save the blogs settings
-			$blogs = new Blogs();
-            if( !$blogs->updateBlog( $this->_blogInfo->getId(), $this->_blogInfo )) {
-                $this->_view = new AdminBlogBlockedHostsView( $this->_blogInfo );
-                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_host_block_settings"));
-                $this->setCommonData();
-
-                return false;                
-            }
-			
-			// if everything went ok...
-            $this->_blogInfo->setSettings( $blogSettings );
-            $this->_session->setValue( "blogInfo", $this->_blogInfo );
-            $this->saveSession();
-			
-			$this->_view = new AdminBlogBlockedHostsView( $this->_blogInfo );
-			$this->_view->setSuccessMessage( $this->_locale->tr("host_block_settings_updated_ok"));			
-			$this->setCommonData();
-			
-			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());			
-            
-            return true;		
-		}
-	}
-?>
\ No newline at end of file

Deleted: plugins/trunk/hostblock/class/action/adminupdatehostblockconfigaction.class.php
===================================================================
--- plugins/trunk/hostblock/class/action/adminupdatehostblockconfigaction.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/action/adminupdatehostblockconfigaction.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,58 +0,0 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."plugins/hostblock/class/view/adminblockedhostsview.class.php" );
-		
-	/**
-	 * updates the plugin configuration
-	 */
-	class AdminUpdateHostBlockConfigAction extends AdminAction
-	{
-		var $_pluginEnabled;
-		
-		function AdminUpdateHostBlockConfigAction( $actionInfo, $request )
-		{
-			$this->AdminAction( $actionInfo, $request );
-		}
-		
-		function validate()
-		{
-            $this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
-            $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
-			
-			return true;
-		}
-		        
-		function perform()
-		{
-            // update the plugin configurations to blog setting
-			$blogSettings = $this->_blogInfo->getSettings();
-            $blogSettings->setValue( "plugin_hostblock_enabled", $this->_pluginEnabled );
-            $this->_blogInfo->setSettings( $blogSettings ); 
-		
-			// save the blogs settings
-			$blogs = new Blogs();
-            if( !$blogs->updateBlog( $this->_blogInfo->getId(), $this->_blogInfo )) {
-                $this->_view = new AdminBlockedHostsView( $this->_blogInfo );
-                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_host_block_settings"));
-                $this->setCommonData();
-
-                return false;                
-            }
-			
-			// if everything went ok...
-            $this->_blogInfo->setSettings( $blogSettings );
-            $this->_session->setValue( "blogInfo", $this->_blogInfo );
-            $this->saveSession();
-			
-			$this->_view = new AdminBlockedHostsView( $this->_blogInfo );
-			$this->_view->setSuccessMessage( $this->_locale->tr("host_block_settings_updated_ok"));			
-			$this->setCommonData();
-			
-			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());			
-            
-            return true;		
-		}
-	}
-?>
\ No newline at end of file

Added: plugins/trunk/hostblock/class/view/adminblockedhostsettingsview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/adminblockedhostsettingsview.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/view/adminblockedhostsettingsview.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -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 AdminBlockedHostSettingsView extends AdminPluginTemplatedView
+	{
+
+		function AdminBlockedHostSettingsView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "hostblock", "blockedhostsettings" );
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_hostblock_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/hostblock/class/view/adminblockedhostsview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/adminblockedhostsview.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/view/adminblockedhostsview.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -27,7 +27,13 @@
             $blogBlockedHosts = array_merge( $hostsBlockedFromPosting, $hostsBlocked );
 
             $this->setValue( "pluginEnabled", $pluginEnabled );
-            $this->setValue( "blockedhosts", $blogBlockedHosts );	
+            $this->setValue( "blockedhosts", $blogBlockedHosts );
+
+            if (!$pluginEnabled) {
+                $locale = $this->_blogInfo->getLocale();
+                $text = $locale->tr("error_hostblock_not_enabled");
+                $this->setErrorMessage( $text );
+            }            
 			
 			parent::render();
 		}

Modified: plugins/trunk/hostblock/class/view/adminblogblockedhostsview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/adminblogblockedhostsview.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/view/adminblogblockedhostsview.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -27,7 +27,13 @@
             $blogBlockedHosts = array_merge( $hostsBlockedFromPosting, $hostsBlocked );
 
             $this->setValue( "pluginEnabled", $pluginEnabled );
-            $this->setValue( "blockedhosts", $blogBlockedHosts );	
+            $this->setValue( "blockedhosts", $blogBlockedHosts );
+
+            if (!$pluginEnabled) {
+                $locale = $this->_blogInfo->getLocale();
+                $text = $locale->tr("error_hostblock_not_enabled");
+                $this->setErrorMessage( $text );
+            }            
 			
 			parent::render();
 		}

Modified: plugins/trunk/hostblock/class/view/admineditblockedhostview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/admineditblockedhostview.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/view/admineditblockedhostview.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -19,9 +19,13 @@
 		
 		function render()
 		{
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_hostblock_enabled" );
+			
         	$blockedHosts = new BlockedHosts();
             $blockedHost = $blockedHosts->getBlockedHost( $this->_hostId );
 
+            $this->setValue( "pluginEnabled", $pluginEnabled );
             $this->setValue( "blockedhost", $blockedHost );
             // to make things easier in the template, let's do the following:
             $ipParts = explode( ".", $blockedHost->getHost());
@@ -29,6 +33,12 @@
             $this->setValue( "ip2", $ipParts[1] );
             $this->setValue( "ip3", $ipParts[2] );
             $this->setValue( "ip4", $ipParts[3] );
+
+            if (!$pluginEnabled) {
+                $locale = $this->_blogInfo->getLocale();
+                $text = $locale->tr("error_hostblock_not_enabled");
+                $this->setErrorMessage( $text );
+            }            
             
             parent::render();
 		}

Modified: plugins/trunk/hostblock/class/view/admineditblogblockedhostview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/admineditblogblockedhostview.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/view/admineditblogblockedhostview.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -19,9 +19,13 @@
 		
 		function render()
 		{
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_hostblock_enabled" );
+			
         	$blockedHosts = new BlockedHosts();
             $blockedHost = $blockedHosts->getBlockedHost( $this->_hostId, $this->_blogInfo->getId());
 
+            $this->setValue( "pluginEnabled", $pluginEnabled );
             $this->setValue( "blockedhost", $blockedHost );
             // to make things easier in the template, let's do the following:
             $ipParts = explode( ".", $blockedHost->getHost());
@@ -29,6 +33,12 @@
             $this->setValue( "ip2", $ipParts[1] );
             $this->setValue( "ip3", $ipParts[2] );
             $this->setValue( "ip4", $ipParts[3] );
+
+            if (!$pluginEnabled) {
+                $locale = $this->_blogInfo->getLocale();
+                $text = $locale->tr("error_hostblock_not_enabled");
+                $this->setErrorMessage( $text );
+            }                
             
             parent::render();
 		}

Modified: plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/view/adminnewblockedhostview.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -15,6 +15,17 @@
 		
 		function render()
 		{
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_hostblock_enabled" );
+
+            $this->setValue( "pluginEnabled", $pluginEnabled );
+
+            if (!$pluginEnabled) {
+                $locale = $this->_blogInfo->getLocale();
+                $text = $locale->tr("error_hostblock_not_enabled");
+                $this->setErrorMessage( $text );
+            }
+            		    
         	// get the content that has been filtered by this blog
 			parent::render();
 		}

Modified: plugins/trunk/hostblock/class/view/adminnewblogblockedhostview.class.php
===================================================================
--- plugins/trunk/hostblock/class/view/adminnewblogblockedhostview.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/class/view/adminnewblogblockedhostview.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -15,6 +15,17 @@
 		
 		function render()
 		{
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_hostblock_enabled" );
+
+            $this->setValue( "pluginEnabled", $pluginEnabled );
+
+            if (!$pluginEnabled) {
+                $locale = $this->_blogInfo->getLocale();
+                $text = $locale->tr("error_hostblock_not_enabled");
+                $this->setErrorMessage( $text );
+            }               			
+
         	// get the content that has been filtered by this blog
 			parent::render();
 		}

Modified: plugins/trunk/hostblock/pluginhostblock.class.php
===================================================================
--- plugins/trunk/hostblock/pluginhostblock.class.php	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/pluginhostblock.class.php	2005-02-23 08:32:03 UTC (rev 1164)
@@ -48,7 +48,6 @@
 			$this->registerAdminAction( "updateBlockedHost", "AdminUpdateBlockedHostAction" );
 			$this->registerAdminAction( "deleteBlockedHost", "AdminDeleteBlockedHostAction" );
 			$this->registerAdminAction( "deleteBlockedHosts", "AdminDeleteBlockedHostAction" );
-			$this->registerAdminAction( "updateHostBlockConfig", "AdminUpdateHostBlockConfigAction" );
 
 			// register the blog owner actions
 			$this->registerAdminAction( "blogBlockHostFromPosting", "AdminBlogBlockHostFromPostingAction" );
@@ -59,7 +58,10 @@
 			$this->registerAdminAction( "updateBlogBlockedHost", "AdminUpdateBlogBlockedHostAction" );
 			$this->registerAdminAction( "deleteBlogBlockedHost", "AdminDeleteBlogBlockedHostAction" );
 			$this->registerAdminAction( "deleteBlogBlockedHosts", "AdminDeleteBlogBlockedHostAction" );
-			$this->registerAdminAction( "updateBlogHostBlockConfig", "AdminUpdateBlogHostBlockConfigAction" );
+
+			// register the plugin settings actions
+			$this->registerAdminAction( "blockedHostSettings", "AdminBlockedHostSettingsAction" );
+			$this->registerAdminAction( "updateBlockedHostSettings", "AdminUpdateBlockedHostSettingsAction" );
 			
 			// register the menu entries, but the first one is only registered if it hasn't been
 			// created yet
@@ -68,11 +70,15 @@
 				$this->addMenuEntry( "/menu/Manage", "blogSecurity", "", "", true, false );
 			$this->addMenuEntry( "/menu/Manage/blogSecurity", "blogBlockedHosts", "admin.php?op=blogBlockedHosts", "blogBlockedHosts", true, false );
 			$this->addMenuEntry( "/menu/Manage/blogSecurity", "newBlogBlockedHost", "admin.php?op=newBlogBlockedHost", "newBlogBlockedHost", true, false );
+
 			if( !$menu->entryExists( "/menu/adminSettings/siteSecurity" ))			
 				$this->addMenuEntry( "/menu/adminSettings", "siteSecurity", "", "", true, false );			
             $this->addMenuEntry( "/menu/adminSettings/siteSecurity", "blockedHosts", "admin.php?op=blockedHosts", "blockedHosts", false, true );
             $this->addMenuEntry( "/menu/adminSettings/siteSecurity", "newBlockedHost", "admin.php?op=newBlockedHost", "newBlockedHost", false, true );			
-			
+
+            if( !$menu->entryExists( "/menu/controlCenter/manageSecurityPlugins" ))                     
+                $this->addMenuEntry( "/menu/controlCenter", "manageSecurityPlugins", "", "", true, false );
+            $this->addMenuEntry( "/menu/controlCenter/manageSecurityPlugins", "blockedHostSettings", "admin.php?op=blockedHostSettings", "", true, false );
 		}
 	}  
 ?>
\ No newline at end of file

Modified: plugins/trunk/hostblock/templates/addblockedhost.template
===================================================================
--- plugins/trunk/hostblock/templates/addblockedhost.template	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/templates/addblockedhost.template	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,6 +1,7 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=newBlockedHost title=$locale->tr("newBlockedHost")}
 {include file="common.template"}
+{if $pluginEnabled}
 <form name="newBlockedHost" action="admin.php" method="post" onSubmit="return checkIpAddress(this);">
  <fieldset class="inputField">
  <legend>{$locale->tr("add_blocked_host")}</legend>
@@ -48,5 +49,8 @@
  </div>    
 
 </form>
+{else}
+ {include file="$admintemplatepath/errormessage.template"} 
+{/if}
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Modified: plugins/trunk/hostblock/templates/addblogblockedhost.template
===================================================================
--- plugins/trunk/hostblock/templates/addblogblockedhost.template	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/templates/addblogblockedhost.template	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,6 +1,7 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=newBlogBlockedHost title=$locale->tr("newBlogBlockedHost")}
 {include file="common.template"}
+{if $pluginEnabled}
 <form name="newBlogBlockedHost" action="admin.php" method="post" onSubmit="return checkIpAddress(this);">
  <fieldset class="inputField">
  <legend>{$locale->tr("add_blocked_host")}</legend>
@@ -48,5 +49,8 @@
  </div>    
 
 </form>
+{else}
+ {include file="$admintemplatepath/errormessage.template"} 
+{/if}
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Modified: plugins/trunk/hostblock/templates/blockedhosts.template
===================================================================
--- plugins/trunk/hostblock/templates/blockedhosts.template	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/templates/blockedhosts.template	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,28 +1,6 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=blockedHosts title=$locale->tr("blockedHosts")}
-<div id="list_nav_bar">
- <div id="list_nav_select">
-  <form id="hostBlock" action="admin.php" method="post">
-   <fieldset>
-    <legend>{$locale->tr("label_configuration")}</legend>
-    <div class="list_nav_option">
-     <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("hostblock_plugin_enabled")}
-     </div>
-    </div>
-    <div class="list_nav_option">
-     <br />
-     <input type="hidden" name="op" value="updateHostBlockConfig">
-     <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}">
-    </div>
-   </fieldset> 
-  </form> 
- </div>
- <br style="clear:both">
-</div>
-
+{if $pluginEnabled}
 <form name="blockedHosts" action="admin.php" method="post">
  <div id="list">
   {include file="$admintemplatepath/successmessage.template"}
@@ -63,5 +41,8 @@
   </div> 
  </div> 
 </form>
+{else}
+ {include file="$admintemplatepath/errormessage.template"} 
+{/if}
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Added: plugins/trunk/hostblock/templates/blockedhostsettings.template
===================================================================
--- plugins/trunk/hostblock/templates/blockedhostsettings.template	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/templates/blockedhostsettings.template	2005-02-23 08:32:03 UTC (rev 1164)
@@ -0,0 +1,24 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=blockedHostSettings title=$locale->tr("hostblock_plugin")}
+<form name="blockedHostSettings" 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="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("hostblock_plugin_enabled")}
+   </div>
+  </div>
+  
+ </fieldset>  
+
+ <div class="buttons">
+  <input type="hidden" name="op" value="updateBlockedHostSettings" />
+  <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"}
\ No newline at end of file

Modified: plugins/trunk/hostblock/templates/blogblockedhosts.template
===================================================================
--- plugins/trunk/hostblock/templates/blogblockedhosts.template	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/templates/blogblockedhosts.template	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,28 +1,6 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=blogBlockedHosts title=$locale->tr("blogBlockedHosts")}
-<div id="list_nav_bar">
- <div id="list_nav_select">
-  <form id="blogHostBlock" action="admin.php" method="post">
-   <fieldset>
-    <legend>{$locale->tr("label_configuration")}</legend>
-    <div class="list_nav_option">
-     <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("hostblock_plugin_enabled")}
-     </div>
-    </div>
-    <div class="list_nav_option">
-     <br />
-     <input type="hidden" name="op" value="updateBlogHostBlockConfig">
-     <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}">
-    </div>
-   </fieldset> 
-  </form> 
- </div>
- <br style="clear:both">
-</div>
-
+{if $pluginEnabled}
 <form name="blogBlockedHosts" action="admin.php" method="post">
  <div id="list">
   {include file="$admintemplatepath/successmessage.template"}
@@ -62,5 +40,8 @@
   </div> 
  </div> 
 </form>
+{else}
+ {include file="$admintemplatepath/errormessage.template"} 
+{/if}
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Modified: plugins/trunk/hostblock/templates/editblockedhost.template
===================================================================
--- plugins/trunk/hostblock/templates/editblockedhost.template	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/templates/editblockedhost.template	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,6 +1,7 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=blockedHosts title=$locale->tr("blockedHosts")}
 {include file="common.template"}
+{if $pluginEnabled}
 <form name="editBlockedHost" action="admin.php" method="post" onSubmit="return checkIpAddress(this);">
  <fieldset class="inputField">
  <legend>{$locale->tr("edit_blocked_host")}</legend>
@@ -49,5 +50,8 @@
  </div> 
 
 </form>
+{else}
+ {include file="$admintemplatepath/errormessage.template"} 
+{/if}
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Modified: plugins/trunk/hostblock/templates/editblogblockedhost.template
===================================================================
--- plugins/trunk/hostblock/templates/editblogblockedhost.template	2005-02-23 08:30:30 UTC (rev 1163)
+++ plugins/trunk/hostblock/templates/editblogblockedhost.template	2005-02-23 08:32:03 UTC (rev 1164)
@@ -1,6 +1,7 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=blogBlockedHosts title=$locale->tr("blogBlockedHosts")}
 {include file="common.template"}
+{if $pluginEnabled}
 <form name="editBlogBlockedHost" action="admin.php" method="post" onSubmit="return checkIpAddress(this);">
  <fieldset class="inputField">
  <legend>{$locale->tr("edit_blocked_host")}</legend>
@@ -49,5 +50,8 @@
  </div> 
 
 </form>
+{else}
+ {include file="$admintemplatepath/errormessage.template"} 
+{/if}
 {include file="$admintemplatepath/footernavigation.template"}
 {include file="$admintemplatepath/footer.template"}
\ No newline at end of file




More information about the pLog-svn mailing list