[pLog-svn] r1074 - in plugins/trunk: . authimage authimage/backgrounds authimage/class authimage/class/action authimage/class/authimage authimage/class/view authimage/install authimage/locale authimage/templates

mark at devel.plogworld.net mark at devel.plogworld.net
Mon Feb 14 17:19:52 GMT 2005


Author: mark
Date: 2005-02-14 17:19:52 +0000 (Mon, 14 Feb 2005)
New Revision: 1074

Added:
   plugins/trunk/authimage/
   plugins/trunk/authimage/backgrounds/
   plugins/trunk/authimage/backgrounds/marble.gif
   plugins/trunk/authimage/backgrounds/ocean.gif
   plugins/trunk/authimage/backgrounds/pine.gif
   plugins/trunk/authimage/backgrounds/rain.gif
   plugins/trunk/authimage/backgrounds/sky.gif
   plugins/trunk/authimage/class/
   plugins/trunk/authimage/class/action/
   plugins/trunk/authimage/class/action/pluginauthimageconfigaction.class.php
   plugins/trunk/authimage/class/action/pluginauthimageshowaction.class.php
   plugins/trunk/authimage/class/action/pluginauthimageupdateconfigaction.class.php
   plugins/trunk/authimage/class/authimage/
   plugins/trunk/authimage/class/authimage/authimage.class.php
   plugins/trunk/authimage/class/view/
   plugins/trunk/authimage/class/view/pluginauthimageconfigview.class.php
   plugins/trunk/authimage/install/
   plugins/trunk/authimage/install/authimage.template
   plugins/trunk/authimage/locale/
   plugins/trunk/authimage/locale/locale_en_UK.php
   plugins/trunk/authimage/locale/locale_zh_TW.php
   plugins/trunk/authimage/pluginauthimage.class.php
   plugins/trunk/authimage/readme.txt
   plugins/trunk/authimage/templates/
   plugins/trunk/authimage/templates/authimage.template
Log:
Porting AuthImage to pLog 1.0, not complete yet.

Added: plugins/trunk/authimage/backgrounds/marble.gif
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/authimage/backgrounds/marble.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/authimage/backgrounds/ocean.gif
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/authimage/backgrounds/ocean.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/authimage/backgrounds/pine.gif
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/authimage/backgrounds/pine.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/authimage/backgrounds/rain.gif
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/authimage/backgrounds/rain.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/authimage/backgrounds/sky.gif
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/authimage/backgrounds/sky.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/authimage/class/action/pluginauthimageconfigaction.class.php
===================================================================
--- plugins/trunk/authimage/class/action/pluginauthimageconfigaction.class.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/class/action/pluginauthimageconfigaction.class.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,26 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/authimage/class/view/pluginauthimageconfigview.class.php" );		
+
+	/**
+	 * shows a form with the current configuration
+	 */
+	class PluginAuthImageConfigAction extends AdminAction
+	{
+		
+		function PluginAuthImageConfigAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function perform()
+		{
+            $this->_view = new PluginAuthImageConfigView( $this->_blogInfo );
+			
+			$this->setCommonData();
+			
+			return true;
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/class/action/pluginauthimageshowaction.class.php
===================================================================
--- plugins/trunk/authimage/class/action/pluginauthimageshowaction.class.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/class/action/pluginauthimageshowaction.class.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,27 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
+    include_once( PLOG_CLASS_PATH."class/view/blogview.class.php" );
+
+	/**
+	 * shows a flickr template without smarty cache
+	 */
+	class PluginAuthImageShowAction extends BlogAction
+	{
+		
+		function PluginAuthImageShowAction( $actionInfo, $request )
+		{
+        	$this->BlogAction( $actionInfo, $request );
+		}
+		
+		function perform()
+		{
+            $this->_view = new BlogView( $this->_blogInfo, "authimage", SMARTY_VIEW_CACHE_DISABLED );
+            $this->_view->setValue( "request", $this->_request );
+            // add all the common information to the view
+            $this->setCommonData();
+
+            return true;
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/class/action/pluginauthimageupdateconfigaction.class.php
===================================================================
--- plugins/trunk/authimage/class/action/pluginauthimageupdateconfigaction.class.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/class/action/pluginauthimageupdateconfigaction.class.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,82 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/authimage/class/view/pluginauthimageconfigview.class.php" );		
+
+		
+	/**
+	 * updates the plugin configuration
+	 */
+	class PluginAuthImageUpdateConfigAction extends AdminAction
+	{
+		var $_pluginEnabled;
+		var $_length;
+		var $_key;
+		var $_default;
+		
+		function PluginAuthImageUpdateConfigAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function validate()
+		{
+            $this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
+            $this->_pluginEnabled = ($this->_pluginEnabled != "" );
+            $this->_length = $this->_request->getValue( "length" );
+            if( $this->_length <= 0 || $this->_length > 6 || !ctype_digit($this->_length)) {
+                $this->_view = new PluginAuthImageConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("authimage_error_length"));
+                $this->setCommonData();
+
+                return false;                
+            }
+            $this->_key = $this->_request->getValue( "key" );
+            if( $this->_key == "" ) {
+                $this->_view = new PluginAuthImageConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("authimage_error_key"));
+                $this->setCommonData();
+
+                return false;                
+            }                         
+            $this->_default = $this->_request->getValue( "default" );
+
+			return true;
+		}
+		        
+		function perform()
+		{
+            // // update the plugin configurations to blog setting
+			$blogSettings = $this->_blogInfo->getSettings();
+            $blogSettings->setValue( "plugin_authimage_enabled", $this->_pluginEnabled );
+            $blogSettings->setValue( "plugin_authimage_length", $this->_length );
+            $blogSettings->setValue( "plugin_authimage_key", $this->_key );
+            $blogSettings->setValue( "plugin_authimage_default", $this->_default );
+            $this->_blogInfo->setSettings( $blogSettings ); 
+		
+			// save the blogs settings
+			$blogs = new Blogs();
+            if( !$blogs->updateBlog( $this->_blogInfo->getId(), $this->_blogInfo )) {
+                $this->_view = new PluginAuthImageConfigView( $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 PluginAuthImageConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("authimage_settings_saved_ok"));
+			$this->setCommonData();
+			
+			// clear the cache
+			CacheControl::resetBlogCache( $this->_blogInfo->getId());			
+            
+            return true;		
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/class/authimage/authimage.class.php
===================================================================
--- plugins/trunk/authimage/class/authimage/authimage.class.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/class/authimage/authimage.class.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,34 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
+    include_once( PLOG_CLASS_PATH."class/misc/glob.class.php" );
+    include_once( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );    
+	
+	/**
+	 * deals with backgrounds in disk and so on...
+	 */
+	class AuthImage extends Object
+	{
+        /**
+         * tries to detect and load all the different backgrounds that can be found in the
+         * backgrounds folder, so that the user can chose the nicest one :)
+		 *
+		 * @static
+         */
+        function scanBackgoundImages()
+        {
+            $gifImages = Glob::glob( AUTHIMAGE_BACKGROUND_FOLDER , '*.gif');
+            
+            $backgroundImages = Array();
+            
+            if ( !empty($gifImages) ) {
+                foreach($gifImages as $image) {
+                    $imageName =  basename($image);
+                    array_push( $backgroundImages, $imageName);
+                }
+            }
+
+            return $backgroundImages;
+        }		
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/class/view/pluginauthimageconfigview.class.php
===================================================================
--- plugins/trunk/authimage/class/view/pluginauthimageconfigview.class.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/class/view/pluginauthimageconfigview.class.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,40 @@
+<?php
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/authimage/class/authimage/authimage.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginAuthImageConfigView extends AdminPluginTemplatedView
+	{
+
+		function PluginAuthImageConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "authimage", "authimage" );
+		}
+		
+		function render()
+		{
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_authimage_enabled" );
+			$length = $blogSettings->getValue( "plugin_authimage_length" );
+			if ($length == "") $length = 6;
+			$key = $blogSettings->getValue( "plugin_authimage_key" );
+			if ($key == "") $key = "pLog";			
+			$default = $blogSettings->getValue( "plugin_authimage_default" );
+			if ($default == "") $default = "marble.gif";
+
+			$backgrounds = AuthImage::scanBackgoundImages();
+			
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );
+			$this->setValue( "length", $length );
+			$this->setValue( "key", $key );
+			$this->setValue( "default", $default );
+			$this->setValue( "backgrounds", $backgrounds );
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/install/authimage.template
===================================================================
--- plugins/trunk/authimage/install/authimage.template	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/install/authimage.template	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1 @@
+{$authimage->showImage()}
\ No newline at end of file

Added: plugins/trunk/authimage/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/authimage/locale/locale_en_UK.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/locale/locale_en_UK.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,23 @@
+<?php
+$messages["manageAntiSpamPlugins"] = "Anti Spam Management";
+$messages["AuthImage"] = "AuthImage";
+
+$messages["authimage_length"] = "Authentication Code Length";
+$messages["authimage_key"] = "Authentication Code Encryption Key";
+$messages["authimage_default"] = "Choose Default AuthImage Background";
+$messages["authimage_background_name"] = "Name";
+$messages["authimage_background_image"] = "Image";
+$messages["authimage_plugin_enabled"] = "Enable this plugin";
+$messages["authimage_plugin"] = "AuthImage Plugin";
+
+$messages["authimage_error_length"] = "Length should be between 1 and 6";
+$messages["authimage_error_key"] = "Encryption Key can not be empty!";
+
+$messages["authimage_settings_saved_ok"] = "AuthImage settings saved successfully!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["label_lengthx"] = "Length";
+$messages["label_key"] = "Key";
+$messages["label_default"] = "Default";
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/authimage/locale/locale_zh_TW.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/locale/locale_zh_TW.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,23 @@
+<?php
+$messages["manageAntiSpamPlugins"] = "防制垃圾干擾管理";
+$messages["AuthImage"] = "AuthImage 迴響驗證設定";
+
+$messages["authimage_length"] = "驗證碼的長度";
+$messages["authimage_key"] = "驗證碼的編碼鑰匙";
+$messages["authimage_default"] = "選擇預設背景圖";
+$messages["authimage_background_name"] = "檔名";
+$messages["authimage_background_image"] = "圖像";
+$messages["authimage_plugin_enabled"] = "啟動外掛程式";
+$messages["authimage_plugin"] = "迴響驗證外掛程式";
+
+$messages["authimage_error_length"] = "長度必須介於 1 到 6 之間。";
+$messages["authimage_error_key"] = "編碼鑰匙錯誤!不可空白。";
+
+$messages["authimage_settings_saved_ok"] = "迴響驗證設定儲存成功。";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "å•Ÿå‹•";
+$messages["label_length"] = "長度";
+$messages["label_key"] = "編碼鑰匙";
+$messages["label_default"] = "預設";
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/pluginauthimage.class.php
===================================================================
--- plugins/trunk/authimage/pluginauthimage.class.php	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/pluginauthimage.class.php	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,152 @@
+<?php
+
+    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/dao/model.class.php" );
+	include_once( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
+    include_once( PLOG_CLASS_PATH."class/misc/glob.class.php" );	
+
+    define( "AUTHIMAGE_FILE", "/plugins/authimage/authimage.php" );
+    define( "AUTHIMAGE_BACKGROUND_FOLDER", PLOG_CLASS_PATH."plugins/authimage/backgrounds/" );
+    
+    /**
+     * Plugin that offers comment authentication image for current blog
+     * Original Author: Gudlyf http://www.gudlyf.com/index.php?p=376
+     * Modified by: Mark Wu
+     */
+    class PluginAuthImage extends PluginBase
+    {
+        var $pluginEnabled;
+        var $background;
+        var $prefix;
+        var $cacheFolder;
+        
+        function PluginAuthImage()
+        {
+            $this->PluginBase();
+            
+            $this->id = "authimage";
+            $this->author = "Mark Wu";
+            $this->desc = 'This plugin offers extra comment authentication for pLog. The idea is inspired by <a href="http://www.gudlyf.com/index.php?p=376">WordPress AuthImage Plugin</a> written by Gudlyf.';
+
+            $config =& Config::getConfig();
+            $this->cacheFolder = $config->getValue('temp_folder');
+
+            $this->locales = Array( "en_UK" , "zh_TW" );
+            
+            $this->init();              
+        }
+
+		function init()
+		{
+            $this->registerAdminAction( "authimage", "PluginAuthImageConfigAction" );
+			$this->registerAdminAction( "updateAuthImageConfig", "PluginAuthImageUpdateConfigAction" );
+			$this->registerBlogAction( "AuthImageShow", "PluginAuthImageShowAction" );
+			
+			$menu =& Menu::getMenu();
+			if( !$menu->entryExists( "/menu/controlCenter/manageAntiSpamPlugins" ))						
+				$this->addMenuEntry( "/menu/controlCenter", "manageAntiSpamPlugins", "", "", true, false );			
+            $this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "AuthImage", "?op=authimage", "" );            
+		}
+ 
+		function register()
+		{
+			$this->cacheFolder = $this->cacheFolder.'/'.$this->blogInfo->getId();
+			if( !File::exists( $this->cacheFolder )) {
+			    $this->log->debug( "creating temporary folder".$this->tempFolder );
+				File::createDir( $this->cacheFolder );
+			}
+		    
+		    $blogSettings = $this->blogInfo->getSettings();
+			$this->pluginEnabled = $blogSettings->getValue( "plugin_authimage_enabled" );
+			$this->length = $blogSettings->getValue( "plugin_authimage_length" );
+			$this->key = $blogSettings->getValue( "plugin_authimage_key" );
+			$this->background = $blogSettings->getValue( "plugin_authimage_background" );
+		}
+
+	    function isEnabled()
+	    {
+	        return $this->pluginEnabled;
+	    }
+
+        function pluginTemplatePage( $template )
+        {
+ 			$rg = new RawRequestGenerator($this->blogInfo);
+            
+        	$rg->addParameter( "op", "AuthImageShow" );
+            $rg->addParameter( "blogId", $this->blogInfo->getId());
+
+            $templatePage = $rg->getIndexUrl().$rg->getRequest();
+
+            return $templatePage;
+        }
+
+        function show() {
+            $authImage = $this->pluginTemplatePage( "authimage" );
+            $authImageUrl = '<img src="'.$authImage.'" align="absmiddle" />';
+            return $authImageUrl;
+        }
+
+        function showImage() {
+            $code = $this->generateCode();
+            $background = AUTHIMAGE_BACKGROUND_FOLDER.$this->background;
+            $tempFile = $this->cacheFolder."/".$code.".gif";
+            
+            $image = @imagecreatefromgif($background) or die("Cannot Initialize new GD image stream"); 
+            $textColor = imageColorAllocate($image, 0x00, 0x00, 0x00);
+            ImageString($image, 5, 7, 2, $code, $textColor);
+            ImageGIF($image, $tempFile);
+            
+            $temp = fopen($tempFile,"rb");
+            $buffer = fread($temp,filesize($tempFile));
+            fclose($temp);
+            
+            // Now zero-length the file. No need for its content anymore.
+            $temp = fopen($tempFile,"w");
+            fwrite($temp, NULL);
+            fclose($temp);
+
+            // Now chmod it so it can be deleted later by the user
+            chmod($tempFile, 0666);
+            
+            header("Content-type: image/gif");
+            echo $buffer;
+        }
+
+        // encrypt string
+        function encrypt($string) {
+            $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
+            $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+            return mcrypt_encrypt(MCRYPT_BLOWFISH, $this->key, $string, MCRYPT_MODE_ECB, $iv);
+        }
+        	
+        // decrypt string
+        function decrypt($crypttext) {
+            $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
+            $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+            return mcrypt_decrypt(MCRYPT_BLOWFISH, $this->key, $crypttext, MCRYPT_MODE_ECB, $iv);
+        }
+        
+        function generateCode() {
+            $code = "";
+            for($i=0; $i < $this->length; $i++) $code .= rand(0,9);
+            return $code;
+        }        
+        
+        function deleteExpiredAuthImage( $expiretime ) {
+            $path = PLOG_CLASS_PATH . $this->cacheFolder;
+            if ( is_dir($path) ) 
+            { 
+                $handle=opendir($path); 
+                while (false!==($file = readdir($handle))) { 
+                    if ($file != "." && $file != ".." && $file != "index.htm") {  
+                        $diff = time() - filectime("$path/$file");
+                        if ($diff > $expiretime) unlink("$path/$file");
+                    } 
+                }
+                closedir($handle); 
+            }
+        }           
+    }
+        
+?>
\ No newline at end of file

Added: plugins/trunk/authimage/readme.txt
===================================================================
--- plugins/trunk/authimage/readme.txt	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/readme.txt	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,23 @@
+Plugin: Gravatar
+Author: Original by Dani Armengol, Modified by Mark Wu
+Release Date: 2005/01/23
+Version: 1.0
+
+Returns the URL of an (gr)avatar for every comment. The image is loaded from Gravatar.com
+
+In order to use, simply include the following:
+1. $gravatar->isEnabled() to check the plugin is enabled or not. 
+2. $gravatar->gravatar($comment,$rating,$default,$size) to get to Avatar from Gravatar.com
+
+Where:
+1. $rating is the allowed rating of avatar. Default is "G"
+2. $default is the URL of the default image that will be shown in case there is no gravatar available or if the user did not give an email address. You also can choose your default avatar from configuration panel. Default is "default.jpg"
+3. $size is the desired size in pixels of the gravatar. Default is 40.
+
+Example:
+Add the following code to postandcomments.template:
+{if $gravatar->isEnabled()}
+<img src="{$gravatar->gravatar($comment)}" width="{$gravatar->getSize()}" height="{$gravatar->getSize()}" align="left" />
+{/if}
+
+You can add your own default avatar image to /plugin/gravatar/avatars. This plugin only support GIF and JPG format currently.
\ No newline at end of file

Added: plugins/trunk/authimage/templates/authimage.template
===================================================================
--- plugins/trunk/authimage/templates/authimage.template	2005-02-14 17:15:11 UTC (rev 1073)
+++ plugins/trunk/authimage/templates/authimage.template	2005-02-14 17:19:52 UTC (rev 1074)
@@ -0,0 +1,67 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=AuthImage title=$locale->tr("authimage_plugin")}
+<form name="authimageluginConfig" 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>
+   <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("authimage_plugin_enabled")}
+   </div>
+  </div> 
+
+  <div class="field">
+   <label for="length">{$locale->tr("label_length")}</label>
+   <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("authimage_length")}</div>
+   <input class="text" type="text" name="length" id="length" value="{$length}" width="10" />
+  </div>
+  
+  <div class="field">
+   <label for="key">{$locale->tr("label_key")}</label>
+   <span class="required">*</span>
+   <div class="formHelp">{$locale->tr("authimage_key")}</div>
+   <input class="text" type="text" name="key" id="key" value="{$key}" width="10" />
+  </div>  
+
+  <div class="field">
+  <label for="default">{$locale->tr("label_default")}</label>
+  <span class="required"></span>
+  <div class="formHelp">{$locale->tr("authimage_default")}</div>
+    <table>
+    <thead>
+     <tr>
+      <th style="width:20px;"></th>
+      <th style="width:130px;">{$locale->tr("authimage_background_name")}</th>
+      <th style="width:450px;">{$locale->tr("authimage_background_image")}</th>
+     </tr>
+    </thead>
+    <tbody> 
+     {foreach from=$backgrounds item=background}
+     <tr>
+      <td>
+       <input class="radio" type="radio" name="default" id="default" value="{$background}" {if $default==$background} checked="checked" {/if} />
+      </td>
+      <td>
+       {$background}
+      </td>
+      <td>
+       <img src="{$url->getUrl("/plugins/authimage/backgrounds/$background")}" alt="{$background}" />
+      </td> 
+     </tr> 
+     {/foreach}
+    </tbody>
+   </table>
+    </div>
+ </fieldset>
+ <div class="buttons">
+  <input type="hidden" name="op" value="updateAuthImageConfig" />
+  <input type="reset" name="{$locale->tr("reset")}" />
+  <input type="submit" name="{$locale->tr("settings")}" value="{$locale->tr("update")}" />
+ </div>
+</form>
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file




More information about the pLog-svn mailing list