[pLog-svn] r933 - in plugins/trunk/atom: class class/action class/view locale templates

oscar at devel.plogworld.net oscar at devel.plogworld.net
Thu Feb 3 17:00:39 GMT 2005


Author: oscar
Date: 2005-02-03 17:00:39 +0000 (Thu, 03 Feb 2005)
New Revision: 933

Added:
   plugins/trunk/atom/class/view/
   plugins/trunk/atom/class/view/adminatompluginsettingsview.class.php
Modified:
   plugins/trunk/atom/class/action/adminatompluginsettingsaction.class.php
   plugins/trunk/atom/class/action/adminatompluginupdatesettingsaction.class.php
   plugins/trunk/atom/locale/locale_en_UK.php
   plugins/trunk/atom/templates/pluginsettings.template
Log:
updated the atom plugin in order to comply with the latest interface guidelines and to see if I can get it working again with nokia's lifeblog mobile client...

Modified: plugins/trunk/atom/class/action/adminatompluginsettingsaction.class.php
===================================================================
--- plugins/trunk/atom/class/action/adminatompluginsettingsaction.class.php	2005-02-03 14:23:33 UTC (rev 932)
+++ plugins/trunk/atom/class/action/adminatompluginsettingsaction.class.php	2005-02-03 17:00:39 UTC (rev 933)
@@ -1,11 +1,11 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/blogowneradminaction.class.php" );
-	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
-	include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
-	include_once( PLOG_CLASS_PATH."plugins/atom/class/dao/atompasswords.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/atom/class/view/adminatompluginsettingsview.class.php" );
 
+	/**
+	 * doesn't do almost anything :))
+	 */
 	class AdminAtomPluginSettingsAction extends BlogOwnerAdminAction
 	{
 		function AdminAtomPluginSettingsAction( $actionInfo, $request )
@@ -15,37 +15,7 @@
 
 		function perform()
 		{
-			$blogSettings = $this->_blogInfo->getSettings();
-
-			// fetch the current settings
-			$categoryId = $blogSettings->getValue( "plugin_atom_article_category_id" );
-			$albumId = $blogSettings->getValue( "plugin_atom_gallery_resource_album_id" );
-			$passwords = new AtomPasswords();
-			$atomPassword = $passwords->getPassword( $this->_userInfo->getId());
-			
-			// fetch all the current article categories
-			$categories = new ArticleCategories();
-			$blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId());
-			// fetch all the current gallery albums
-			$albums = new GalleryAlbums();
-			$blogAlbums = $albums->getUserAlbums( $this->_blogInfo->getId());
-			
-			// if the user is an admin, then we also have to export a couple more things
-			if( $this->_userInfo->isSiteAdmin()) {
-			     $config =& Config::getConfig();
-			     $loggingEnabled = $config->getValue( "atom_logging_enabled" );
-			     $dontSetHeaders = $config->getValue( "atom_dont_set_headers" );
-			}
-
-			$this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "atom", "pluginsettings" );
-			$this->_view->setValue( "atomPassword", $atomPassword );
-			$this->_view->setValue( "categoryId", $categoryId );
-			$this->_view->setValue( "albumId", $albumId );
-			$this->_view->setValue( "albums", $blogAlbums );
-			$this->_view->setValue( "categories", $blogCategories );
-			$this->_view->setValue( "password", $atomPassword );
-			$this->_view->setValue( "loggingEnabled", $loggingEnabled );
-			$this->_view->setValue( "dontSetHeaders", $dontSetHeaders );
+			$this->_view = new AdminAtomPluginSettingsView( $this->_blogInfo, $this->_userInfo );
 			$this->setCommonData();
 
 			return true;

Modified: plugins/trunk/atom/class/action/adminatompluginupdatesettingsaction.class.php
===================================================================
--- plugins/trunk/atom/class/action/adminatompluginupdatesettingsaction.class.php	2005-02-03 14:23:33 UTC (rev 932)
+++ plugins/trunk/atom/class/action/adminatompluginupdatesettingsaction.class.php	2005-02-03 17:00:39 UTC (rev 933)
@@ -1,7 +1,7 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/blogowneradminaction.class.php" );
-	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/atom/class/view/adminatompluginsettingsview.class.php" );
 	include_once( PLOG_CLASS_PATH."plugins/atom/class/dao/atompasswords.class.php" );
 
 	class AdminAtomPluginUpdateSettingsAction extends BlogOwnerAdminAction
@@ -59,8 +59,8 @@
 			}
 
 			// show an informative message
-			$this->_view = new AdminMessageView( $this->_blogInfo );
-			$this->_view->setMessage( "Plugin settings saved successfully!" );
+			$this->_view = new AdminAtomPluginSettingsView( $this->_blogInfo, $this->_userInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("atom_plugin_settings_saved_ok"));
 			$this->setCommonData();
 		
 			return true;

Added: plugins/trunk/atom/class/view/adminatompluginsettingsview.class.php
===================================================================
--- plugins/trunk/atom/class/view/adminatompluginsettingsview.class.php	2005-02-03 14:23:33 UTC (rev 932)
+++ plugins/trunk/atom/class/view/adminatompluginsettingsview.class.php	2005-02-03 17:00:39 UTC (rev 933)
@@ -0,0 +1,61 @@
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
+	include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/atom/class/dao/atompasswords.class.php" );	
+	
+	/**
+	 * loads and displays the plugin settings
+	 */
+	class AdminAtomPluginSettingsView extends AdminPluginTemplatedView
+	{
+	
+		var $_userInfo;
+	
+		function AdminAtomPluginSettingsView( $blogInfo, $userInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "atom", "pluginsettings" );
+			
+			$this->_userInfo = $userInfo;
+		}
+		
+		function render()
+		{
+			$blogSettings = $this->_blogInfo->getSettings();
+
+			// fetch the current settings
+			$categoryId = $blogSettings->getValue( "plugin_atom_article_category_id" );
+			$albumId = $blogSettings->getValue( "plugin_atom_gallery_resource_album_id" );
+			$passwords = new AtomPasswords();
+			$atomPassword = $passwords->getPassword( $this->_userInfo->getId());
+			
+			// fetch all the current article categories
+			$categories = new ArticleCategories();
+			$blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId());
+			// fetch all the current gallery albums
+			$albums = new GalleryAlbums();
+			$blogAlbums = $albums->getUserAlbums( $this->_blogInfo->getId());		
+			
+			// if the user is an admin, then we also have to export a couple more things
+			if( $this->_userInfo->isSiteAdmin()) {
+			     $config =& Config::getConfig();
+			     $loggingEnabled = $config->getValue( "atom_logging_enabled" );
+			     $dontSetHeaders = $config->getValue( "atom_dont_set_headers" );
+			}							
+			
+			// finally pass all these things to the templates
+			$this->setValue( "atomPassword", $atomPassword );
+			$this->setValue( "categoryId", $categoryId );
+			$this->setValue( "albumId", $albumId );
+			$this->setValue( "albums", $blogAlbums );
+			$this->setValue( "categories", $blogCategories );
+			$this->setValue( "password", $atomPassword );
+			$this->setValue( "loggingEnabled", $loggingEnabled );
+			$this->setValue( "dontSetHeaders", $dontSetHeaders );
+			
+		
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Modified: plugins/trunk/atom/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/atom/locale/locale_en_UK.php	2005-02-03 14:23:33 UTC (rev 932)
+++ plugins/trunk/atom/locale/locale_en_UK.php	2005-02-03 17:00:39 UTC (rev 933)
@@ -1,3 +1,11 @@
 <?php
-$messages["atomSettings"] = "Atom";
+$messages['atomSettings'] = 'Atom';
+$messages['atom_articles_help'] = 'In which category would you like articles posted via Atom to be categorized?';
+$messages['atom_resources_help'] = 'Uploading resources such as images and videos is also supported by this implementation. In which album would you like files to be classified?';
+$messages['atom_password_help'] = 'This implementation needs a password which is different from your normal user password. Leave it as it is for no change or please type a new password.';
+$messages['atom_logging_enabled'] = 'Logging enabled';
+$messages['atom_logging_enabled_help'] = 'Enable logging if you are having problems accessing your blog via Atom.';
+$messages['atom_dont_set_headers'] = 'Do not set headers';
+$messages['atom_dont_set_headers_help'] = 'Some servers will generate an "HTTP 500 Internal Server Error" message whenever the atom layer tries to change the heders to conform to the Atom specification. Please set the following to "Yes" if you are having problems with this.';
+$messages['atom_plugin_settings_saved_ok'] = 'Atom plugin settings saved successfully';
 ?>
\ No newline at end of file

Modified: plugins/trunk/atom/templates/pluginsettings.template
===================================================================
--- plugins/trunk/atom/templates/pluginsettings.template	2005-02-03 14:23:33 UTC (rev 932)
+++ plugins/trunk/atom/templates/pluginsettings.template	2005-02-03 17:00:39 UTC (rev 933)
@@ -1,57 +1,65 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=atomSettings title=$locale->tr("atomSettings")}
 <form name="pluginAtomSettings" method="post" action="admin.php">
-<!-- article categories -->
-<h2>Articles</h2>
-In which category would you like articles posted via Atom to be categorized?<br />
-<select name="categoryId">
-{foreach from=$categories item=category}
- <option value="{$category->getId()}" {if $categoryId == $category->getId()}selected="selected"{/if}>{$category->getName()}</option>
-{/foreach}
-</select>
+ <fieldset class="inputField">
+  <legend>{$locale->tr("atomSettings")}</legend>
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}  
+  <!-- article categories -->
+  <div class="field">
+   <label for="categoryId">{$locale->tr("articles")}</label>
+   <div class="formHelp">{$locale->tr("atom_articles_help")}</div>
+   <select name="categoryId">
+    {foreach from=$categories item=category}
+	<option value="{$category->getId()}" {if $categoryId == $category->getId()}selected="selected"{/if}>{$category->getName()}</option>
+	{/foreach}
+   </select>
+  </div> 
+  
+ <!-- album categories -->
+ <div class="field">
+  <label for="albumId">{$locale->tr("resources")}</label>
+  <div class="formHelp">{$locale->tr("atom_resources_help")}</div>
+  <select name="albumId">
+   {foreach from=$albums item=album}
+    <option value="{$album->getId()}" {if $albumId == $album->getId()}selected="selected"{/if}>{$album->getName()}</option>
+   {/foreach}
+  </select>
+ </div>
+ 
+ <!-- password -->
+ <div class="field">
+  <label for="password">{$locale->tr("password")}</label>
+  <div class="formHelp">{$locale->tr("atom_password_help")}</div>
+  <input type="password" name="password" value="{$password}" />
+ </div> 
 
-<!-- album categories -->
-<h2>Files</h2>
-Uploading resources such as images and videos is also supported by this implementation. In which album would you like files to be classified?<br />
-<select name="albumId">
-{foreach from=$albums item=album}
- <option value="{$album->getId()}" {if $albumId == $album->getId()}selected="selected"{/if}>{$album->getName()}</option>
-{/foreach}
-</select>
-
-<!-- password -->
-<h2>Password</h2>
-This implementation needs a password which is different from your normal user password. Leave it as it is for no change or please type a new password.<br />
-<input type="password" name="password" value="{$password}" /><br />
-
 <!-- only for admin users -->
 {if $user->isSiteAdmin()}
-  <h2>Advanced Features</h2>
+  <h4>&raquo; Advanced Features</h4>
   <!-- logging enabled or disabled -->
-  <p>
-  Enable logging if you are having problems accessing your blog via Atom. Enabling logging will create
-  a log file with information under tmp/atom.log. Be careful, the size of this file might grow quite big
-  if you forget to turn logging off!<br/>
-  Enable logging:
-  <input type="radio" name="loggingEnabled" value="1"{if $loggingEnabled==1}checked="checked"{/if}>Yes</input>
-  <input type="radio" name="loggingEnabled" value="0"{if $loggingEnabled==0}checked="checked"{/if}>No</input>
-  </p>
+  <div class="field">
+   <label for="loggingEnabled">{$locale->tr("atom_logging_enabled")}</label>
+   <div class="formHelp">{$locale->tr("atom_logging_enabled_help")}</div>
+   <input type="radio" class="radio" name="loggingEnabled" value="1"{if $loggingEnabled==1}checked="checked"{/if}>Yes</input>
+   <input type="radio" class="radio" name="loggingEnabled" value="0"{if $loggingEnabled==0}checked="checked"{/if}>No</input>   
+  </div>
   
   <!-- don't set headers -->
-  <p>
-  Some servers will generate an "HTTP 500 Internal Server Error" message whenever the atom layer tries to
-  change the heders to conform to the Atom specification. Please set the following to 'Yes' if you are having
-  problems with this.<br/>
-  Don't try to change HTTP headers:
-  <input type="radio" name="dontSetHeaders" value="1" {if $dontSetHeaders==1}checked="checked"{/if}>Yes</input>
-  <input type="radio" name="dontSetHeaders" value="0" {if $dontSetHeaders==0}checked="checked"{/if}>No</input>
-  </p>
-  
+  <div class="field">
+   <label for="dontSetHeaders">{$locale->tr("atom_dont_set_headers")}</label>
+   <div class="formHelp">{$locale->tr("atom_dont_set_headers_help")}</div>
+   <input type="radio" class="radio" name="dontSetHeaders" value="1" {if $dontSetHeaders==1}checked="checked"{/if}>Yes</input>
+   <input type="radio" class="radio" name="dontSetHeaders" value="0" {if $dontSetHeaders==0}checked="checked"{/if}>No</input>
+  </div>
 {/if}
 <!-- end of options for admin users -->
-
-<input type="hidden" name="op" value="updateAtomSettings" />
-<input type="submit" name="submit" value="Update Settings" />
+</fieldset>
+<div class="buttons">
+ <input type="hidden" name="op" value="updateAtomSettings" />
+ <input type="reset" name="reset" value="{$locale->tr("reset")}" />
+ <input type="submit" name="submit" 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