[pLog-svn] r5721 - in plog/trunk: class/action/admin templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Jul 25 09:26:43 EDT 2007


Author: oscar
Date: 2007-07-25 09:26:42 -0400 (Wed, 25 Jul 2007)
New Revision: 5721

Modified:
   plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php
   plog/trunk/class/action/admin/admindeletecommentaction.class.php
   plog/trunk/class/action/admin/admindeletecustomfieldsaction.class.php
   plog/trunk/class/action/admin/admindeletelinkaction.class.php
   plog/trunk/class/action/admin/admindeletepostaction.class.php
   plog/trunk/templates/admin/customfields.template
   plog/trunk/templates/admin/customfields_table.template
   plog/trunk/templates/admin/editarticlecategories.template
   plog/trunk/templates/admin/editarticlecategories_table.template
   plog/trunk/templates/admin/editcomments.template
   plog/trunk/templates/admin/editcomments_table.template
   plog/trunk/templates/admin/editlinks.template
   plog/trunk/templates/admin/editlinks_table.template
   plog/trunk/templates/admin/editposts.template
   plog/trunk/templates/admin/editposts_table.template
   plog/trunk/templates/admin/resources.template
Log:
Implemented background (via XmlHttpRequest) deletion of posts, categories, link categories, links and custom fields.


Modified: plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php	2007-07-25 13:26:42 UTC (rev 5721)
@@ -45,6 +45,15 @@
 		 */
 		function _deleteArticleCategories()
 		{
+			// prepare the parameters.. If there's only one category id, then add it to
+			// an array.
+			if( $this->_mode == "deleteArticleCategory" ) {
+				$this->_categoryIds = Array();
+				$this->_categoryIds[] = $this->_request->getValue( "categoryId" );
+			}
+			else
+				$this->_categoryIds = $this->_request->getValue( "categoryIds" );
+            
             $categories = new ArticleCategories();
 			
 			$errorMessage = "";
@@ -86,20 +95,11 @@
 					$errorMessage .= $this->_locale->pr("error_deleting_category2", $categoryId)."<br/>";
 				}
         	}
+
+            if( $totalOk > 0 )
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );                
 			
-			// prepare the view and all the information it needs to know
-			$this->_view = new AdminArticleCategoriesListView( $this->_blogInfo );
-			if( $errorMessage != "" ) 
-				$this->_view->setErrorMessage( $errorMessage );
-			if( $successMessage != "" ) {
-				// and clear the cache to avoid outdated information
-				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );			
-				$this->_view->setSuccessMessage( $successMessage );
-			}
-				
-			$this->setCommonData();
-			
-			return true;
+			return( Array( "errorMessage" => $errorMessage, "successMessage" => $successMessage ));
 		}
 
         /**
@@ -107,16 +107,32 @@
          */
         function perform()
         {
-			// prepare the parameters.. If there's only one category id, then add it to
-			// an array.
-			if( $this->_mode == "deleteArticleCategory" ) {
-				$this->_categoryIds = Array();
-				$this->_categoryIds[] = $this->_request->getValue( "categoryId" );
-			}
-			else
-				$this->_categoryIds = $this->_request->getValue( "categoryIds" );
+            $results = $this->_deleteArticleCategories();
+            
+			// prepare the view and all the information it needs to know
+			$this->_view = new AdminArticleCategoriesListView( $this->_blogInfo );
+            if( $results["errorMessage"] != "" ) $this->_view->setErrorMessage( $results["errorMessage"] );
+			if( $results["successMessage"] != "" ) $this->_view->setSuccessMessage( $results["successMessage"] );            
+
+			$this->setCommonData();
+
 			
-            return $this->_deleteArticleCategories();
+            return( true );
         }
+
+		/**
+		 * Ajax-specific behaviour
+		 */
+		function performAjax()
+		{
+            $results = $this->_deleteArticleCategories();
+			
+			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;			
+		}        
     }
 ?>

Modified: plog/trunk/class/action/admin/admindeletecommentaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletecommentaction.class.php	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/class/action/admin/admindeletecommentaction.class.php	2007-07-25 13:26:42 UTC (rev 5721)
@@ -48,26 +48,51 @@
 		 */
 		function perform()
 		{
-			$this->_articleId = $this->_request->getValue( "articleId" );
-			if( $this->_mode == "deleteComment" ) {
-				$commentId = $this->_request->getValue( "commentId" );
-				$this->_commentIds = Array();
-				$this->_commentIds[] = $commentId;
-			}
+			$results = $this->_deleteComments();
+
+			// if everything fine, then display the same view again with the feedback
+			if( $this->_articleId == 0 )
+				$this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => null ));
 			else
-				$this->_commentIds = $this->_request->getValue( "commentIds" );
-				
-			$this->_deleteComments();
+				$this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => $article ));
+
+            if( $results["errorMessage"] != "" ) $this->_view->setErrorMessage( $results["errorMessage"] );
+			if( $results["successMessage"] != "" ) $this->_view->setSuccessMessage( $results["successMessage"] );            
+            $this->setCommonData();            
 			
 			return true;
 		}
 
+		/**
+		 * Ajax-specific behaviour
+		 */
+		function performAjax()
+		{
+			$results = $this->_deleteComments();
+			
+			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;			
+		}                
+
         /**
          * deletes comments
 		 * @private
          */
         function _deleteComments()
         {
+			$this->_articleId = $this->_request->getValue( "articleId" );
+			if( $this->_mode == "deleteComment" ) {
+				$commentId = $this->_request->getValue( "commentId" );
+				$this->_commentIds = Array();
+				$this->_commentIds[] = $commentId;
+			}
+			else
+				$this->_commentIds = $this->_request->getValue( "commentIds" );
+            
             $comments = new CommentsCommon();
             $errorMessage = "";
 			$successMessage = "";
@@ -78,11 +103,7 @@
 				$articles = new Articles();
 				$article = $articles->getBlogArticle( $this->_articleId, $this->_blogInfo->getId());
 				if( !$article ) {
-					$this->_view = new AdminArticleCommentsListView( $this->_blogInfo );
-					$this->_view->setErrorMessage( $this->_locale->tr("error_fetching_article" ));
-					$this->setCommonData();
-					
-					return false;
+                    return( Array( "successMessage" => "", "errorMessage" => $this->_locale->tr("error_fetching_article" )));
 				}
 			}
 			else {
@@ -128,22 +149,12 @@
 				}
             }
 
-			// if everything fine, then display the same view again with the feedback
-			if( $this->_articleId == 0 )
-				$this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => null ));
-			else
-				$this->_view = new AdminArticleCommentsListView( $this->_blogInfo, Array( "article" => $article ));
-				
-			if( $successMessage != "" ) {
-				$this->_view->setSuccessMessage( $successMessage );
-				// clear the cache
+            if( $totalOk > 0 )
 				CacheControl::resetBlogCache( $this->_blogInfo->getId());
-			}
-			if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
-            $this->setCommonData();
 
+            
             // better to return true if everything fine
-            return true;
+            return( Array( "successMessage" => $successMessage, "errorMessage" => $errorMessage ));
         }
     }
 ?>
\ No newline at end of file

Modified: plog/trunk/class/action/admin/admindeletecustomfieldsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletecustomfieldsaction.class.php	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/class/action/admin/admindeletecustomfieldsaction.class.php	2007-07-25 13:26:42 UTC (rev 5721)
@@ -40,7 +40,37 @@
 		 * prepares the data for AdminDeleteCustomFieldsAction::_deleteFields
 		 */
 		function perform()
+		{				
+			$results = $this->_deleteFields();
+
+            $this->_view = new AdminCustomFieldsListView( $this->_blogInfo );
+            if( $results["errorMessage"] != "" ) $this->_view->setErrorMessage( $results["errorMessage"] );
+			if( $results["successMessage"] != "" ) $this->_view->setSuccessMessage( $results["successMessage"] );
+            $this->setCommonData();
+
+            return( true );
+		}
+
+		/**
+		 * Ajax-specific behaviour
+		 */
+		function performAjax()
 		{
+			$results = $this->_deleteFields();
+			
+			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;			
+		}                
+		
+		/**
+		 * @private
+		 */
+		function _deleteFields()
+		{
 			if( $this->_op == "deleteCustomField" ) {
 				$this->_fieldId = $this->_request->getValue( "fieldId" );
 				$this->_fieldIds = Array();
@@ -48,15 +78,7 @@
 			}
 			else
 				$this->_fieldIds = $this->_request->getValue( "fieldIds" );
-				
-			$this->_deleteFields();
-		}
-		
-		/**
-		 * @private
-		 */
-		function _deleteFields()
-		{
+            
 			// otherwise, go through all the selected fields and remove them one by one, 
 			// also removing the rows that contain the values
 			$customFields = new CustomFields();
@@ -90,12 +112,12 @@
 				else
 					$errorMessage .= $this->_locale->pr( "error_deleting_field2", $fieldId )."<br/>";
 			}
-			
-			if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
-			if( $successMessage != "" ) $this->_view->setSuccessMessage( $successMessage );
-			$this->setCommonData();
-			
-			return true;
+
+            if( $totalOk > 0 )
+                CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
+            
+                // return some feedback
+            return( Array( "errorMessage" => $errorMessage, "successMessage" => $successMessage ));            
 		}
 	}
 ?>
\ No newline at end of file

Modified: plog/trunk/class/action/admin/admindeletelinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletelinkaction.class.php	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/class/action/admin/admindeletelinkaction.class.php	2007-07-25 13:26:42 UTC (rev 5721)
@@ -41,10 +41,43 @@
 			
 			// permission checks
 			$this->requirePermission( "update_link" );
-        }        
+
+            
+        }
+
+		/**
+		 * Ajax-specific behaviour
+		 */
+		function performAjax()
+		{
+			$results = $this->_deleteLinks();
+			
+			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;			
+		}        
 		
 		function perform()
 		{
+			$results = $this->_deleteLinks();
+
+            $this->_view = new AdminLinksListView( $this->_blogInfo );
+            if( $results["errorMessage"] != "" ) $this->_view->setErrorMessage( $results["errorMessage"] );
+			if( $results["successMessage"] != "" ) $this->_view->setSuccessMessage( $results["successMessage"] );
+            $this->setCommonData();
+			
+            return( true );
+		}
+
+        /**
+         * Carries out the specified action
+		 * @private
+         */
+        private function _deleteLinks()
+        {
 			if( $this->_op == "deleteLink" ) {
 				$this->_linkIds = Array();
 				$this->_linkId = $this->_request->getValue( "linkId" );
@@ -52,16 +85,7 @@
 			}
 			else
 				$this->_linkIds = $this->_request->getValue( "linkIds" );
-				
-			$this->_deleteLinks();
-		}
-
-        /**
-         * Carries out the specified action
-		 * @private
-         */
-        function _deleteLinks()
-        {
+            
         	// delete the link
             $links = new MyLinks();
 
@@ -87,16 +111,12 @@
 				}
             }
 
-            $this->_view = new AdminLinksListView( $this->_blogInfo );
-            if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
-			if( $successMessage != "" ) $this->_view->setSuccessMessage( $successMessage );
-            $this->setCommonData();
-			
 			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
+            if( $totalOk > 0 ) 
+                CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 
-            // better to return true if everything fine
-            return true;
+                // return some feedback
+            return( Array( "errorMessage" => $errorMessage, "successMessage" => $successMessage ));
         }
     }
 ?>

Modified: plog/trunk/class/action/admin/admindeletepostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletepostaction.class.php	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/class/action/admin/admindeletepostaction.class.php	2007-07-25 13:26:42 UTC (rev 5721)
@@ -46,6 +46,15 @@
          */
         function _deletePosts()
         {
+			// prepare the parameters.. If there's only one category id, then add it to
+			// an array.
+			if( $this->_mode == "deletePost" ) {
+				$this->_postIds = Array();
+				$this->_postIds[] = $this->_request->getValue( "postId" );
+			}
+			else
+				$this->_postIds = $this->_request->getValue( "postIds" );
+            
         	// delete the post (it is not physically deleted but rather, we set
             // the status field to 'DELETED'
             $articles = new Articles();
@@ -96,33 +105,42 @@
 					$errorMessage .= $this->_locale->pr( "error_deleting_article2", $postId )."<br/>";
 				}
             }
-			
-			// clean up the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());
 
-			$this->_view = new AdminPostsListView( $this->_blogInfo );
-			if( $errorMessage != "" ) 
-				$this->_view->setErrorMessage( $errorMessage );
-			if( $successMessage != "" )
-				$this->_view->setSuccessMessage( $successMessage );
-				
-			$this->setCommonData();
+			// clear the cache
+            if( $totalOk > 0 ) 
+                CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
+
+                // return some feedback
+            return( Array( "errorMessage" => $errorMessage, "successMessage" => $successMessage ));            
 			
             return true;
         }
 		
 		function perform()
 		{
-			// prepare the parameters.. If there's only one category id, then add it to
-			// an array.
-			if( $this->_mode == "deletePost" ) {
-				$this->_postIds = Array();
-				$this->_postIds[] = $this->_request->getValue( "postId" );
-			}
-			else
-				$this->_postIds = $this->_request->getValue( "postIds" );
+			$results = $this->_deletePosts();
+
+			$this->_view = new AdminPostsListView( $this->_blogInfo );
+            if( $results["errorMessage"] != "" ) $this->_view->setErrorMessage( $results["errorMessage"] );
+			if( $results["successMessage"] != "" ) $this->_view->setSuccessMessage( $results["successMessage"] );            
 				
-			$this->_deletePosts();
+			$this->setCommonData();
+            
 		}
+
+		/**
+		 * Ajax-specific behaviour
+		 */
+		function performAjax()
+		{
+			$results = $this->_deletePosts();
+			
+			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;			
+		}                
     }
 ?>
\ No newline at end of file

Modified: plog/trunk/templates/admin/customfields.template
===================================================================
--- plog/trunk/templates/admin/customfields.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/customfields.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -8,10 +8,9 @@
  <br style="clear:both" />
 </div>
 
-        <form id="customFields" action="admin.php" method="post">
+        <form id="customFields" 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/customfields_table.template"} 
         </div>
         <div id="list_action_bar">

Modified: plog/trunk/templates/admin/customfields_table.template
===================================================================
--- plog/trunk/templates/admin/customfields_table.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/customfields_table.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -35,7 +35,10 @@
         <div class="list_action_button">
 		   {check_perms perm=update_custom_field}
            <a id="edit_link_{$field->getId()}" rel="overlay" href="?op=editCustomField&amp;fieldId={$field->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("editCustomField")}" /></a>
-           <a href="?op=deleteCustomField&amp;fieldId={$field->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+           <a
+    href="?op=deleteCustomField&amp;fieldId={$field->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>				 
@@ -43,4 +46,4 @@
   {/foreach}
   </tbody>
 </table>
-{adminpagerajax style=list}
\ No newline at end of file
+{adminpagerajax style=list}

Modified: plog/trunk/templates/admin/editarticlecategories.template
===================================================================
--- plog/trunk/templates/admin/editarticlecategories.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editarticlecategories.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -32,10 +32,9 @@
 <br style="clear:both" />
 </div>
 
- <form id="deleteCategories" action="admin.php" method="post">
+ <form id="deleteCategories" 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/editarticlecategories_table.template"}
  </div>
  <div id="list_action_bar">

Modified: plog/trunk/templates/admin/editarticlecategories_table.template
===================================================================
--- plog/trunk/templates/admin/editarticlecategories_table.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editarticlecategories_table.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -31,7 +31,9 @@
       <a rel="overlay" id="edit_link_{$category->getId()}" href="?op=editArticleCategory&amp;categoryId={$category->getId()}" title="{$locale->tr("edit")}">
 	     <img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" />
 	   </a>
-      <a href="?op=deleteArticleCategory&amp;categoryId={$category->getId()}" title="{$locale->tr("delete")}">
+      <a
+ href="?op=deleteArticleCategory&amp;categoryId={$category->getId()}"
+ title="{$locale->tr("delete")}" onClick="Lifetype.Forms.performRequest(this);return(false);">
 	     <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
 	   </a>
 	 {/check_perms}
@@ -41,4 +43,4 @@
  {/foreach}
 </tbody> 
 </table>
-{adminpagerajax style=list}
\ No newline at end of file
+{adminpagerajax style=list}

Modified: plog/trunk/templates/admin/editcomments.template
===================================================================
--- plog/trunk/templates/admin/editcomments.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editcomments.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -61,18 +61,18 @@
 		</div>
 		{/check_perms}
 		
-        <form id="postCommentsList" action="admin.php" method="post">
+        <form id="postCommentsList" 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/editcomments_table.template"}
         </div>
 		<a name="bulkEdit"></a>
         <div id="list_action_bar">
 			{check_perms perm=update_comment}	
 			<input type="hidden" name="articleId" value="{if $post}{$post->getId()}{else}0{/if}" />
-            <input type="button" name="delete" value="{$locale->tr("delete")}" class="submit" onClick="Lifetype.UI.Pages.Comments.submitCommentsList('deleteComments');" />
-            <input type="hidden" name="op" value="" />
+            <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
+            <input type="hidden" name="op" value="deleteComments" />
 			{/check_perms}
 			{check_perms perm=update_comment}
             <div id="massiveChangeOption" style="display: none">

Modified: plog/trunk/templates/admin/editcomments_table.template
===================================================================
--- plog/trunk/templates/admin/editcomments_table.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editcomments_table.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -57,7 +57,10 @@
             <td>
                 <div class="list_action_button">
 				{check_perms perm=update_comment}	
-                <a href="?op=deleteComment&amp;commentId={$comment->getId()}&amp;articleId={if $post}{$post->getId()}{else}0{/if}" title="{$locale->tr("delete")}">
+                <a
+    href="?op=deleteComment&amp;commentId={$comment->getId()}&amp;articleId={if
+    $post}{$post->getId()}{else}0{/if}"
+    title="{$locale->tr("delete")}" onClick="Lifetype.Forms.performRequest(this);return(false);">
                 	<img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
                 </a>
 				{if $bayesian_filter_enabled}
@@ -83,4 +86,4 @@
         {/foreach}
     </tbody>
 </table>
-{adminpagerajax style=list}
\ No newline at end of file
+{adminpagerajax style=list}

Modified: plog/trunk/templates/admin/editlinks.template
===================================================================
--- plog/trunk/templates/admin/editlinks.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editlinks.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -59,10 +59,9 @@
  <br style="clear:both" />
 </div>
 
-<form id="links" action="admin.php" method="post">
+<form id="links" 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/editlinks_table.template"}
  </div>
  <a name="bulkEdit"></a>
@@ -86,4 +85,4 @@
  </div>
 </form>
 {include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+{include file="$admintemplatepath/footer.template"}

Modified: plog/trunk/templates/admin/editlinks_table.template
===================================================================
--- plog/trunk/templates/admin/editlinks_table.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editlinks_table.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -37,8 +37,8 @@
        </a>
 	  {/check_perms}
 	  {check_perms perm="update_link"}
-  	  {** if $user->hasPermissionByName("update_link",$blog->getId()) **}
-        <a href="?op=deleteLink&amp;linkId={$link->getId()}" title="{$locale->tr("delete")}">
+        <a href="?op=deleteLink&amp;linkId={$link->getId()}"
+ title="{$locale->tr("delete")}" onClick="Lifetype.Forms.performRequest(this);return(false)">
          <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
         </a>
 	  {/check_perms}
@@ -48,4 +48,4 @@
  {/foreach}
  </tbody>
  </table>
- {adminpagerajax style=list}
\ No newline at end of file
+ {adminpagerajax style=list}

Modified: plog/trunk/templates/admin/editposts.template
===================================================================
--- plog/trunk/templates/admin/editposts.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editposts.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -102,18 +102,16 @@
 		 <br style="clear:both" />
 		</div>
 
-        <form id="postsList" action="admin.php" method="post">
-
+        <form id="postsList" 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/editposts_table.template"}
         </div>
         <a name="bulkEdit"></a>
         <div id="list_action_bar">
 			{check_perms perm=update_post}
-            <input type="button" name="delete" value="{$locale->tr("delete")}" class="submit" onClick="Lifetype.UI.Pages.EditPosts('deletePosts');" />
-            <input type="hidden" name="op" value="" />
+            <input type="submit" name="delete" value="{$locale->tr("delete")}" class="submit" />
+            <input type="hidden" name="op" value="deletePosts" />
 			{/check_perms}
 			{check_perms perm=update_post}
             <div id="massiveChangeOption" style="display: none">
@@ -126,14 +124,14 @@
 		                <option value="{$status}">{$locale->tr($name)}</option>
 		              {/foreach}
 		            </select>
-		            <input type="button" name="changePostsStatus" value="{$locale->tr("change_status")}" class="submit" onClick="Lifetype.UI.Pages.EditPosts.submitPostsList('changePostsStatus');" />
+		            <input type="button" name="changePostsStatus" value="{$locale->tr("change_status")}" class="submit" onClick="Lifetype.UI.Pages.Posts.submitPostsList('changePostsStatus');" />
 		            <label for="postCategories[]">{$locale->tr("categories")}</label>
 		            <select name="postCategories[]" id="postCategories" size="5" multiple="multiple">
 		              {foreach name=categories from=$categories item=category}
 		                <option value="{$category->getId()}" {if $smarty.foreach.categories.first} selected="selected" {/if}>{$category->getName()}</option>
 		              {/foreach}
 		            </select>
-		            <input type="button" name="changePostsCategory" value="{$locale->tr("change_category")}" class="submit" onClick="Lifetype.UI.Pages.EditPosts.submitPostsList('changePostsCategory');" />
+		            <input type="button" name="changePostsCategory" value="{$locale->tr("change_category")}" class="submit" onClick="Lifetype.UI.Pages.Posts.submitPostsList('changePostsCategory');" />
 			 		<!-- location stuff -->
 					{if $location_data_enabled}
                     <label for="location">{$locale->tr("location")}</label>
@@ -147,7 +145,7 @@
 					<a href="#" onClick="Lifetype.UI.Location.displaySelectedLocationFromId('postLocation', [ 0, -1 ] );">
 					  <img src="imgs/admin/icon_globe-16.png" alt="View" style="border:0px" />
 					</a>
-		            <input type="button" name="changePostsLocation" value="{$locale->tr("change_location")}" class="submit" onClick="Lifetype.UI.Pages.EditPosts.submitPostsList('changePostsLocation');" />
+		            <input type="button" name="changePostsLocation" value="{$locale->tr("change_location")}" class="submit" onClick="Lifetype.UI.Pages.Posts.submitPostsList('changePostsLocation');" />
 					{/if}		
 		        </fieldset>
 			</div>

Modified: plog/trunk/templates/admin/editposts_table.template
===================================================================
--- plog/trunk/templates/admin/editposts_table.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/editposts_table.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -78,7 +78,8 @@
                 <a href="?op=editPost&amp;postId={$post->getId()}" title="{$locale->tr("edit")}">
                 	<img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" />
                 </a>
-                <a href="?op=deletePost&amp;postId={$post->getId()}" title="{$locale->tr("delete")}">
+                <a href="?op=deletePost&amp;postId={$post->getId()}"
+    title="{$locale->tr("delete")}" onClick="Lifetype.Forms.performRequest(this);return(false);">
                 	<img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
                 </a>
 				{/check_perms}
@@ -96,4 +97,4 @@
         {/foreach}
     </tbody>
 </table>
-{adminpagerajax style="list"}
\ No newline at end of file
+{adminpagerajax style="list"}

Modified: plog/trunk/templates/admin/resources.template
===================================================================
--- plog/trunk/templates/admin/resources.template	2007-07-25 12:35:34 UTC (rev 5720)
+++ plog/trunk/templates/admin/resources.template	2007-07-25 13:26:42 UTC (rev 5721)
@@ -187,4 +187,4 @@
 </div>
 </form>
 {include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+{include file="$admintemplatepath/footer.template"}



More information about the pLog-svn mailing list