[pLog-svn] r5715 - in plog/trunk: class/action/admin js/ui js/ui/pages styles templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Tue Jul 24 18:02:23 EDT 2007


Author: oscar
Date: 2007-07-24 18:02:22 -0400 (Tue, 24 Jul 2007)
New Revision: 5715

Added:
   plog/trunk/templates/admin/viewvalidateajax.template
Modified:
   plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php
   plog/trunk/js/ui/forms.js
   plog/trunk/js/ui/pages/articlecategories.js
   plog/trunk/js/ui/pages/comments.js
   plog/trunk/js/ui/pages/customfields.js
   plog/trunk/js/ui/pages/linkcategories.js
   plog/trunk/js/ui/pages/links.js
   plog/trunk/js/ui/pages/posts.js
   plog/trunk/js/ui/ui.js
   plog/trunk/styles/admin.css
   plog/trunk/templates/admin/customfields.template
   plog/trunk/templates/admin/editcomments.template
   plog/trunk/templates/admin/editlinkcategories.template
   plog/trunk/templates/admin/editlinkcategories_table.template
   plog/trunk/templates/admin/editposts.template
   plog/trunk/templates/admin/header.template
Log:
Implemented YUI's custom events for some of our javascript classes such as the AjaxPager, AjaxFormProcessor, etc, which is cleaner than passing callback functions around. Now if for example a page needs to do something after a table with data has been dynamically refreshed, all it needs to do is subscribe to the Lifetype.UI.AjaxPager.Event.dataLoaded event and provide its own logic there. Additionally, we decouple classes from each other, as the event sender doesn't really need to know anything about the event receiver(s) (which is not quite true when using callbacks)


Modified: plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php	2007-07-24 22:02:22 UTC (rev 5715)
@@ -42,23 +42,31 @@
 		
 		function perform()
 		{
-			if( $this->_op == "deleteLinkCategory" ) {
-				$this->_categoryId = $this->_request->getValue( "categoryId" );
-				$this->_categoryIds = Array();
-				$this->_categoryIds[] = $this->_categoryId;
-			}
-			else
-				$this->_categoryIds = $this->_request->getValue( "categoryIds" );
-				
-			$this->_deleteLinkCategories();
+			$results = $this->_deleteLinkCategories();
+			
+            $this->_view = new AdminLinkCategoriesListView( $this->_blogInfo );
+            if( $results["errorMessage"] != "" ) $this->_view->setErrorMessage( $results["errorMessage"] );
+			if( $results["successMessage"] != "" ) $this->_view->setSuccessMessage( $results["successMessage"] );				
+            $this->setCommonData();
+
+            // better to return true if everything fine
+            return true;				
 		}
-
+		
         /**
          * Carries out the specified action
 		 * @static
          */
         function _deleteLinkCategories()
         {
+			if( $this->_op == "deleteLinkCategory" ) {
+				$this->_categoryId = $this->_request->getValue( "categoryId" );
+				$this->_categoryIds = Array();
+				$this->_categoryIds[] = $this->_categoryId;
+			}
+			else
+				$this->_categoryIds = $this->_request->getValue( "categoryIds" );			
+			
         	// delete the link category, but only if there are no links under it
             $categories = new MyLinksCategories();
             $errorMessage = "";
@@ -90,19 +98,27 @@
                 	$errorMessage .= $this->_locale->pr("error_removing_link_category2", $categoryId )."<br/>";
                 }
             }
-			
-            $this->_view = new AdminLinkCategoriesListView( $this->_blogInfo );
-            if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
-			if( $successMessage != "" ) {
-				$this->_view->setSuccessMessage( $successMessage );
-				// clear the cache
-				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
+
+			if( $totalOk > 0 ) {
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );				
 			}
-				
-            $this->setCommonData();
 
+			return( Array( "errorMessage" => $errorMessage, "successMessage" => $successMessage ));	
+        }
+
+		/**
+		 * Ajax-specific behaviour
+		 */
+		function performAjax()
+		{
+			$results = $this->_deleteLinkCategories();
+			
+			lt_include( PLOG_CLASS_PATH."class/view/admin/ajax/adminajaxview.class.php" );
+            $this->_view = new AdminAjaxView( $this->_blogInfo );
+			$this->_view->setResult( $results );
+
             // better to return true if everything fine
-            return true;
-        }
+            return true;			
+		}
     }
 ?>
\ No newline at end of file

Modified: plog/trunk/js/ui/forms.js
===================================================================
--- plog/trunk/js/ui/forms.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/forms.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -6,6 +6,8 @@
 
 Lifetype.Forms = function() {}
 
+Lifetype.Forms.Events = function() {}
+
 Lifetype.Forms.List = function() {}
 
 /**
@@ -157,6 +159,16 @@
 }
 
 /**
+ * CustomEvent object fired when the form has been successfully processed
+ */
+Lifetype.Forms.Events.formProcessorSuccessEvent = new YAHOO.util.CustomEvent('formProcessorSuccessEvent');
+
+/**
+ * CustomEvent object fired when the form was not successfully processed
+ */
+Lifetype.Forms.Events.formProcessorFailureEvent = new YAHOO.util.CustomEvent('formProcessorFailureEvent');
+
+/**
  * @static
  * Processes responses for forms submitted via Ajax
  * @param formId
@@ -224,14 +236,10 @@
 					if(( elem = YAHOO.util.Dom.get( "FormError" ))) {					
 						elem.style.display = 'block';
 					}
+
+					// fire the error event
+					Lifetype.Forms.Events.formProcessorFailureEvent.fire( o );					
 					
-					// check the arguments
-					if( o.argument ) {
-						// is there an error callback?
-						if( o.argument.formErrorCallback )
-							o.argument.formErrorCallback( o );
-					}					
-					
 					return( true );
 				}
 				else {
@@ -248,17 +256,88 @@
 						if( o.argument.resetAfterSuccess == true ) {
 							o.argument.formElement.reset();
 						}					
-						// is there a success callback?
-						if( o.argument.formSuccessCallback )
-							o.argument.formSuccessCallback( o );
 					}
+
+					// fire the success					
+					Lifetype.Forms.Events.formProcessorSuccessEvent.fire( o );					
 				}									
-			}			
+			},
+			failure: function() {
+				// fire the error event
+				Lifetype.Forms.Events.formProcessorFailureEvent.fire( o );				
+			}
 		}
 	);
 }
 
+/**
+ * CustomEvent object fired when the link has been successfully processed
+ */
+Lifetype.Forms.Events.performRequestSuccessEvent = new YAHOO.util.CustomEvent('performRequestSuccessEvent');
 
+/**
+ * CustomEvent object fired when the link was not successfully processed
+ */
+Lifetype.Forms.Events.performRequestFailureEvent = new YAHOO.util.CustomEvent('performRequestFailureEvent');
+
+/**
+ * This method can be used to execute a form or an anchor tag via XmlHttpRequest. Its output
+ * is processed and placed in the page according to certain tags: ViewInfo and ViewInfoMessage for
+ * successful cases and ViewError and ViewErrorMessage for error cases.
+ *
+ * The code is able to automatically detect whether we're dealing with an anchor tag or a
+ * form tag.
+ *
+ * In case of successful request, the event performRequestSuccessEvent will be generated, while in case
+ * of error requests, performRequestFailureEvent will be generated.
+ */
+Lifetype.Forms.performRequest = function( o ) 
+{
+	if( o.tagName.toLowerCase() == "form" ) {
+		// it's a form
+		YAHOO.util.Connect.setForm( o );
+		url = '?output=json';		
+	}
+	else {
+		// it's an anchor tag
+		var url = o.href + "&output=json";
+	}	
+	
+	YAHOO.util.Connect.asyncRequest('GET', url,
+		callback = {
+			success: function( o ) {
+				
+				Lifetype.Dom.$( 'ViewError' ).style.display = 'none';
+				Lifetype.Dom.$( 'ViewInfo' ).style.display = 'none';
+				
+				var result = Lifetype.JSon.decode( o.responseText ).result;
+				if( result.successMessage ) {
+					Lifetype.Dom.$( 'ViewInfoMessage' ).innerHTML = result.successMessage;
+					Lifetype.Dom.$( 'ViewInfo' ).style.display = 'block';
+					
+					// fire the success event
+					Lifetype.Forms.Events.performRequestSuccessEvent.fire( o );
+				}
+				if( result.errorMessage ) {
+					Lifetype.Dom.$( 'ViewErrorMessage' ).innerHTML = result.errorMessage;
+					Lifetype.Dom.$( 'ViewError' ).style.display = 'block';
+					
+					// fire the error event
+					Lifetype.Forms.Events.performRequestFailureEvent.fire( o );
+				}
+			},
+			failure: function( o ) {
+				Lifetype.Dom.$( 'ViewErrorMessage' ).innerHTML = 'Error performing request';
+				Lifetype.Dom.$( 'ViewError' ).style.display = 'block';
+				
+				// fire the error event
+				Lifetype.Forms.Events.performRequestFailureEvent.fire( o );
+			}
+		}
+	);
+}
+
+
 //
 // :TODO:
 // Move the functions above to the Lifetype.Forms.List namespace

Modified: plog/trunk/js/ui/pages/articlecategories.js
===================================================================
--- plog/trunk/js/ui/pages/articlecategories.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/pages/articlecategories.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -2,16 +2,20 @@
 
 Lifetype.UI.Pages.ArticleCategories.updateSubmitHook = function( form )
 {
-	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {formSuccessCallback:Lifetype.UI.AjaxPager.reload} );
+	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json' );
 }
 
 Lifetype.UI.Pages.ArticleCategories.addSubmitHook = function( form )
 {
-	Lifetype.Forms.AjaxFormProcessor(form.id,'?output=json', {resetAfterSuccess:true, formSuccessCallback:Lifetype.UI.AjaxPager.reload});
+	Lifetype.Forms.AjaxFormProcessor(form.id,'?output=json', {resetAfterSuccess:true });
 }
 
 YAHOO.util.Event.addListener( window, "load", function() {
-		var t = new Lifetype.UI.TableEffects( "list" );
-		t.stripe();
-		t.highlightRows();
+	var t = new Lifetype.UI.TableEffects( "list" );
+	t.stripe();
+	t.highlightRows();
+	
+	// reload the list when successfully deleting an item and processing one of the forms
+	Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+	Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );		
 });
\ No newline at end of file

Modified: plog/trunk/js/ui/pages/comments.js
===================================================================
--- plog/trunk/js/ui/pages/comments.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/pages/comments.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -22,4 +22,14 @@
 Lifetype.UI.Pages.Comments.submitHook = function( form )
 {
 	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {formSuccessCallback:Lifetype.UI.AjaxPager.reload} );
-}
\ No newline at end of file
+}
+
+YAHOO.util.Event.addListener( window, "load", function() {
+	var t = new Lifetype.UI.TableEffects( "comments" );
+	t.stripe();
+	t.highlightRows();
+	
+	// reload the list when successfully deleting an item and processing one of the forms
+	Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+	Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+});
\ No newline at end of file

Modified: plog/trunk/js/ui/pages/customfields.js
===================================================================
--- plog/trunk/js/ui/pages/customfields.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/pages/customfields.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -30,4 +30,14 @@
 	if(newValue != null ) {
 		Lifetype.Forms.List.appendToList( 'fieldValues', newValue, newValue);
 	}
-}
\ No newline at end of file
+}
+
+YAHOO.util.Event.addListener( window, "load", function() {
+	var t = new Lifetype.UI.TableEffects( "customFields" );
+	t.stripe();
+	t.highlightRows();
+	
+	// reload the list when successfully deleting an item and processing one of the forms
+	Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+	Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+});

Modified: plog/trunk/js/ui/pages/linkcategories.js
===================================================================
--- plog/trunk/js/ui/pages/linkcategories.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/pages/linkcategories.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -2,10 +2,20 @@
 
 Lifetype.UI.Pages.LinkCategories.addSubmitHook = function( form )
 {
-	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {resetAfterSuccess:true, formSuccessCallback:Lifetype.UI.AjaxPager.reload} );	
+	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {resetAfterSuccess:true} );	
 }
 
 Lifetype.UI.Pages.LinkCategories.updateSubmitHook = function( form )
 {
-	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {formSuccessCallback:Lifetype.UI.AjaxPager.reload} );
-}
\ No newline at end of file
+	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json' );
+}
+
+YAHOO.util.Event.addListener( window, "load", function() {
+	var t = new Lifetype.UI.TableEffects( "list" );
+	t.stripe();
+	t.highlightRows();
+	
+	// reload the list when successfully deleting an item and processing one of the forms
+	Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+	Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );
+});
\ No newline at end of file

Modified: plog/trunk/js/ui/pages/links.js
===================================================================
--- plog/trunk/js/ui/pages/links.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/pages/links.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -11,7 +11,11 @@
 }
 
 YAHOO.util.Event.addListener( window, "load", function() {
-		var t = new Lifetype.UI.TableEffects( "links" );
-		t.stripe();
-		t.highlightRows();
+	var t = new Lifetype.UI.TableEffects( "links" );
+	t.stripe();
+	t.highlightRows();
+
+	// reload the list when successfully deleting an item and processing one of the forms
+	Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+	Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );		
 });
\ No newline at end of file

Modified: plog/trunk/js/ui/pages/posts.js
===================================================================
--- plog/trunk/js/ui/pages/posts.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/pages/posts.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -25,4 +25,14 @@
 			document.getElementById("postsList").submit();
 		}	
 	}
-}
\ No newline at end of file
+}
+
+YAHOO.util.Event.addListener( window, "load", function() {
+	var t = new Lifetype.UI.TableEffects( "posts" );
+	t.stripe();
+	t.highlightRows();
+	
+	// reload the list when successfully deleting an item and processing one of the forms
+	Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+	Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( Lifetype.UI.AjaxPager.reload );	
+});
\ No newline at end of file

Modified: plog/trunk/js/ui/ui.js
===================================================================
--- plog/trunk/js/ui/ui.js	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/js/ui/ui.js	2007-07-24 22:02:22 UTC (rev 5715)
@@ -16,6 +16,18 @@
 Lifetype.UI.AjaxPager = function() {}
 
 /**
+ * Namespace for events generated by the AjaxPager class
+ */
+Lifetype.UI.AjaxPager.Events = function() {}
+
+/**
+ * CustomEvent object fired when the table has been loaded. It should be used to trigger other tasks 
+ * that need to happen when the table loads (i.e. reprocessing of the rel="overlay" links, table
+ * row striping, etc)
+ */
+Lifetype.UI.AjaxPager.Events.dataLoaded = new YAHOO.util.CustomEvent('dataLoaded');
+
+/**
  * Jumps to the previous page in the ajax pager.
  * @static
  */
@@ -64,16 +76,23 @@
 		callback = {
 			success: function( o ) {
 				Lifetype.Dom.$( 'list' ).innerHTML = o.responseText;
-				// we need to reprocess all that we just loaded
-				// :TODO:
-				// This should be implemented via events!!!
-				Lifetype.UI.ContentOverlay.processAnchors();				
+
+				// fire the 'dataLoaded' in case somebody else wants to do so some post-processing of the data
+				Lifetype.UI.AjaxPager.Events.dataLoaded.fire( e );
 			}
 		}
 	);
 }
 
 /**
+ * This is a common thing to do after loading a table, as we need to reprocess all those links that
+ * have been marked as "rel='overlay'" in the markup that was just loaded via Ajax. We cannot provide
+ * a direct reference to the processAnchors() function becauseit does not exist yet when this file is
+ * loaded (ui.js is one of the first files to be loaded)
+ */
+Lifetype.UI.AjaxPager.Events.dataLoaded.subscribe( function() { Lifetype.UI.ContentOverlay.processAnchors() } );
+
+/**
  * Namespace for helper methods
  */
 Lifetype.Helpers = function() {}

Modified: plog/trunk/styles/admin.css
===================================================================
--- plog/trunk/styles/admin.css	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/styles/admin.css	2007-07-24 22:02:22 UTC (rev 5715)
@@ -725,6 +725,20 @@
     padding-top: 0px;
 }
 
+#ViewError
+{
+    padding-left: 20px;	
+    text-align: left;
+    padding-top: 0px;	
+}
+
+#ViewInfo
+{
+    text-align: left;
+    padding-top: 0px;	
+    padding-left: 20px;	
+}
+
 #list #FormInfo
 {
     padding-left: 10px;

Modified: plog/trunk/templates/admin/customfields.template
===================================================================
--- plog/trunk/templates/admin/customfields.template	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/templates/admin/customfields.template	2007-07-24 22:02:22 UTC (rev 5715)
@@ -1,16 +1,6 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=blogCustomFields title=$locale->tr("blogCustomFields")}
 {js src="js/ui/pages/customfields.js"}
-<script type="text/javascript">
-{literal}
-YAHOO.util.Event.addListener( window, "load", function() {
-		var t = new Lifetype.UI.TableEffects( "list" );
-		t.stripe();
-		t.highlightRows();
-	});
-{/literal}
-</script>
-
 <div class="extraFunctions">
  <div class="left">
   <a id="newCustomFieldButton" href="?op=newCustomField" rel="overlay">New Custom Field</a>

Modified: plog/trunk/templates/admin/editcomments.template
===================================================================
--- plog/trunk/templates/admin/editcomments.template	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/templates/admin/editcomments.template	2007-07-24 22:02:22 UTC (rev 5715)
@@ -7,15 +7,6 @@
 		var showMassiveChangeOption = '{$locale->tr("show_massive_change_option")}';
 		var hideMassiveChangeOption = '{$locale->tr("hide_massive_change_option")}';
 </script>
-<script type="text/javascript">
-{literal}
-YAHOO.util.Event.addListener( window, "load", function() {
-		var t = new Lifetype.UI.TableEffects( "list" );
-		t.stripe();
-		t.highlightRows();
-	});
-{/literal}
-	</script>	
         <div id="list_nav_bar">
             <div id="list_nav_select">		
 

Modified: plog/trunk/templates/admin/editlinkcategories.template
===================================================================
--- plog/trunk/templates/admin/editlinkcategories.template	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/templates/admin/editlinkcategories.template	2007-07-24 22:02:22 UTC (rev 5715)
@@ -1,15 +1,6 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=editLinkCategories title=$locale->tr("editLinkCategories")}
 {js src="js/ui/pages/linkcategories.js"}
-<script type="text/javascript">
-{literal}
-YAHOO.util.Event.addListener( window, "load", function() {
-		var t = new Lifetype.UI.TableEffects( "list" );
-		t.stripe();
-		t.highlightRows();
-	});
-{/literal}
-</script>
 <div id="list_nav_bar">
    <div id="list_nav_select">
 <form id="viewLinkCategories" action="admin.php" method="post">
@@ -36,10 +27,9 @@
 </div>
 <br style="clear:both" />
 </div>
- <form id="linkCategories" action="admin.php" method="post">
+ <form id="linkCategories" action="admin.php" method="post" onSubmit="Lifetype.Forms.performRequest(this);return(false);">
+ {include file="$admintemplatepath/viewvalidateajax.template"}	
  <div id="list"> 
-  {include file="$admintemplatepath/successmessage.template"}
-  {include file="$admintemplatepath/errormessage.template"}
   {include file="$admintemplatepath/editlinkcategories_table.template"}
  </div>
  <div id="list_action_bar">

Modified: plog/trunk/templates/admin/editlinkcategories_table.template
===================================================================
--- plog/trunk/templates/admin/editlinkcategories_table.template	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/templates/admin/editlinkcategories_table.template	2007-07-24 22:02:22 UTC (rev 5715)
@@ -24,10 +24,10 @@
   <td>
     <div class="list_action_button">
 	  {check_perms perm="update_link_category"}	
-      <a hrel="overlay" id="edit_link_{$category->getId()}" ref="?op=editLinkCategory&amp;categoryId={$category->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
+      <a rel="overlay" id="edit_link_{$category->getId()}" href="?op=editLinkCategory&amp;categoryId={$category->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
      {/check_perms} 
 	  {check_perms perm="update_link_category"}	
-      <a href="?op=deleteLinkCategory&amp;categoryId={$category->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+      <a href="?op=deleteLinkCategory&amp;categoryId={$category->getId()}" onClick="Lifetype.Forms.performRequest(this);return(false)"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
 	  {/check_perms}
     </div>
   </td>   

Modified: plog/trunk/templates/admin/editposts.template
===================================================================
--- plog/trunk/templates/admin/editposts.template	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/templates/admin/editposts.template	2007-07-24 22:02:22 UTC (rev 5715)
@@ -1,7 +1,7 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=editPosts title=$locale->tr("editPosts")}
 {js src="js/ui/pages/global.js"}
-{js src="js/ui/pages/editposts.js"}
+{js src="js/ui/pages/posts.js"}
 	<script type="text/javascript" src="js/ui/plogui.js"></script>
 	<script type="text/javascript">
 		var errorPostStatusMsg = '{$locale->tr("error_post_status")}';
@@ -9,15 +9,6 @@
 		var showMassiveChangeOption = '{$locale->tr("show_massive_change_option")}';
 		var hideMassiveChangeOption = '{$locale->tr("hide_massive_change_option")}';
 	</script>
-	<script type="text/javascript">
-	{literal}
-	YAHOO.util.Event.addListener( window, "load", function() {
-			var t = new Lifetype.UI.TableEffects( "list" );
-			t.stripe();
-			t.highlightRows();
-		});
-	{/literal}
-	</script>	
 		  <div id="list_nav_bar">
             <div id="list_nav_select">
                 <form id="showBy" action="admin.php" method="post">

Modified: plog/trunk/templates/admin/header.template
===================================================================
--- plog/trunk/templates/admin/header.template	2007-07-24 21:57:38 UTC (rev 5714)
+++ plog/trunk/templates/admin/header.template	2007-07-24 22:02:22 UTC (rev 5715)
@@ -45,7 +45,6 @@
 {js src="js/ui/contentoverlay.js"}
 {js src="js/ui/dom.js"}
 {js src="js/ui/menu.js"}
-{js src="js/ui/locale.js"}
 {if $location_data_enabled}
 <!-- Location libraries -->
 {js src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=$google_maps_api_key"}

Added: plog/trunk/templates/admin/viewvalidateajax.template
===================================================================
--- plog/trunk/templates/admin/viewvalidateajax.template	                        (rev 0)
+++ plog/trunk/templates/admin/viewvalidateajax.template	2007-07-24 22:02:22 UTC (rev 5715)
@@ -0,0 +1,11 @@
+{**
+  Please use this smarty code to carry our form validations
+**}
+<div id="ViewError" {if $viewErrorMessage == ""}style="display:none"{/if}>
+  <img src="imgs/admin/icon_warning-16.png" alt="Error" class="InfoIcon" />
+  <p class="ErrorText" id="ViewErrorMessage">{$viewErrorMessage}</p>
+</div>  
+<div id="ViewInfo" {if $viewSuccessMessage == ""}style="display:none"{/if}>
+  <img src="imgs/admin/icon_info-16.png" alt="Info" class="InfoIcon" />
+  <p class="InfoText" id="ViewInfoMessage">{$viewSuccessMessage}</p>
+</div>
\ No newline at end of file



More information about the pLog-svn mailing list