[pLog-svn] r5702 - in plog/trunk: class/action/admin class/view/admin styles templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Fri Jul 20 18:29:26 EDT 2007


Author: oscar
Date: 2007-07-20 18:29:26 -0400 (Fri, 20 Jul 2007)
New Revision: 5702

Added:
   plog/trunk/class/view/admin/adminerrordialogview.class.php
   plog/trunk/templates/admin/dialog.template
Modified:
   plog/trunk/class/action/admin/admineditarticlecategoryaction.class.php
   plog/trunk/class/action/admin/admineditcommentaction.class.php
   plog/trunk/class/action/admin/admineditcustomfieldaction.class.php
   plog/trunk/class/action/admin/admineditlinkaction.class.php
   plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php
   plog/trunk/styles/admin.css
Log:
Error reporting is now just a simple error message rather than the whole page, since it's going to be displayed in a smaller pop-up/overlay.


Modified: plog/trunk/class/action/admin/admineditarticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditarticlecategoryaction.class.php	2007-07-20 22:27:05 UTC (rev 5701)
+++ plog/trunk/class/action/admin/admineditarticlecategoryaction.class.php	2007-07-20 22:29:26 UTC (rev 5702)
@@ -2,7 +2,7 @@
 
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
     lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticlecategorieslistview.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminerrordialogview.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
@@ -31,8 +31,7 @@
 			$this->registerFieldValidator( "categoryId", new IntegerValidator());
 			$this->_form->registerField( "categoryName" );
 			$this->_form->registerField( "categoryDescription" );
-			$errorView = new AdminArticleCategoriesListView( $this->_blogInfo );
-			$errorView->setErrorMessage( $this->_locale->tr("error_incorrect_category_id"));
+			$errorView = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr("error_incorrect_category_id"));
 			$this->setValidationErrorView( $errorView );
 			
 			$this->requirePermission( "update_category" );
@@ -59,7 +58,7 @@
 			$category = $this->loadData();
             // show an error if we couldn't fetch the category
             if( !$category ) {
-            	$this->_view = new AdminArticleCategoriesListView( $this->_blogInfo );
+            	$this->_view = new AdminErrorDialogView( $this->_blogInfo );
                 $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_category") );
 				$this->_view->setError( true );
                 $this->setCommonData();
@@ -96,4 +95,4 @@
 			}
 		}
     }
-?>
+?>
\ No newline at end of file

Modified: plog/trunk/class/action/admin/admineditcommentaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditcommentaction.class.php	2007-07-20 22:27:05 UTC (rev 5701)
+++ plog/trunk/class/action/admin/admineditcommentaction.class.php	2007-07-20 22:29:26 UTC (rev 5702)
@@ -2,7 +2,8 @@
 
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
-	lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticlecommentslistview.class.php" );	
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticlecommentslistview.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminerrordialogview.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );	
 
 	/**
@@ -16,8 +17,7 @@
 			$this->AdminAction( $actionInfo, $request );
 			
 			$this->registerFieldValidator( "commentId", new IntegerValidator());
-			$view = new AdminArticleCommentsListView( $this->_blogInfo );
-			$view->setErrorMessage( $this->_locale->tr( "error_incorrect_comment_id" ));
+			$view = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr( "error_incorrect_comment_id" ));
 			
 			$this->requirePermission( "update_comment" );
 		}
@@ -59,8 +59,7 @@
 				$this->_view->setValue( "articleId", $comment->getArticleId());
 			}
 			else {
-				$this->_view = new AdminArticleCommentsListView( $this->_blogInfo );
-				$this->_view->setErrorMessage( $this->_locale->tr( "error_incorrect_comment_id" ));				
+				$this->_view = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr( "error_incorrect_comment_id" ));
 			}
 			
 			$this->setCommonData();

Modified: plog/trunk/class/action/admin/admineditcustomfieldaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditcustomfieldaction.class.php	2007-07-20 22:27:05 UTC (rev 5701)
+++ plog/trunk/class/action/admin/admineditcustomfieldaction.class.php	2007-07-20 22:29:26 UTC (rev 5702)
@@ -5,6 +5,7 @@
 	lt_include( PLOG_CLASS_PATH."class/view/admin/admincustomfieldslistview.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminerrordialogview.class.php" );	
 
     /**
      * \ingroup Action
@@ -22,8 +23,7 @@
 			
 			// validate data
 			$this->registerFieldValidator( "fieldId", new IntegerValidator());
-			$view = new AdminCustomFieldsListView( $this->_blogInfo );
-			$view->setErrorMessage( $this->_locale->tr( "error_fetching_custom_field" ));
+			$view = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr( "error_fetching_custom_field" ));
 			$this->setValidationErrorView( $view );
 			
 			$this->requirePermission( "update_custom_field" );
@@ -50,8 +50,7 @@
             // show an error if we couldn't fetch the link
 			$field = $this->getCustomField();
             if( !$field ) {
-            	$this->_view = new AdminCustomFieldsListView( $this->_blogInfo );
-                $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_custom_field"));
+				$this->_view = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr( "error_fetching_custom_field" ));
             }
 			else {			
 				$this->_view = new AdminTemplatedView( $this->_blogInfo, "editcustomfield" );

Modified: plog/trunk/class/action/admin/admineditlinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditlinkaction.class.php	2007-07-20 22:27:05 UTC (rev 5701)
+++ plog/trunk/class/action/admin/admineditlinkaction.class.php	2007-07-20 22:29:26 UTC (rev 5702)
@@ -1,7 +1,8 @@
 <?php
 
-	lt_include( PLOG_CLASS_PATH."class/view/admin/admineditlinkview.class.php") ;
-	lt_include( PLOG_CLASS_PATH."class/view/admin/adminlinkslistview.class.php") ;	
+	lt_include( PLOG_CLASS_PATH."class/view/admin/admineditlinkview.class.php");
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminlinkslistview.class.php");
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminerrordialogview.class.php" );	
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/mylinkscategories.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/mylinks.class.php" );
@@ -32,8 +33,7 @@
 			$this->_form->registerField( "linkName" );
 			$this->_form->registerField( "linkRssFeed" );
 			$this->_form->registerField( "linkUrl" );
-			$view = new AdminLinksListView( $this->_blogInfo );
-			$view->setErrorMessage( $this->_locale->tr("error_fetching_link" ));
+			$view = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr("error_fetching_link" ));
 			$this->setValidationErrorView( $view );
 
 			// permission checks
@@ -63,7 +63,7 @@
         {			
 			$link = $this->loadLink();
             if( !$link ) {
-                $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_link"));
+                $this->_view = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr("error_fetching_link" ));
                 $this->setCommonData();
                 return false;
             }			

Modified: plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php	2007-07-20 22:27:05 UTC (rev 5701)
+++ plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php	2007-07-20 22:29:26 UTC (rev 5702)
@@ -2,7 +2,7 @@
 
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
     lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
-	lt_include( PLOG_CLASS_PATH."class/view/admin/adminlinkcategorieslistview.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/view/admin/adminerrordialogview.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/mylinkscategories.class.php" );
     lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
 
@@ -28,8 +28,7 @@
 			// data validation
 			$this->registerFieldValidator( "categoryId", new IntegerValidator());
 			$this->_form->registerField( "categoryName" );
-			$view = new AdminLinkCategoriesListView( $this->_blogInfo );
-			$view->setErrorMessage( $this->_locale->tr("error_incorrect_link_category_id"));
+			$view = new AdminErrorDialogView( $this->_blogInfo, $this->_locale->tr("error_incorrect_link_category_id"));
 			$this->setValidationErrorView( $view );
 			
 			// permission checks
@@ -58,7 +57,7 @@
         {
 			$category = $this->getLinkCategory();
 			if( !$category ) {
-				$this->_view = new AdminLinkCategoriesListView( $this->_blogInfo );
+				$this->_view = new AdminErrorDialogView( $this->_blogInfo );
                 $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_link_category"));
                 $this->setCommonData();
 				return( false );

Added: plog/trunk/class/view/admin/adminerrordialogview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminerrordialogview.class.php	                        (rev 0)
+++ plog/trunk/class/view/admin/adminerrordialogview.class.php	2007-07-20 22:29:26 UTC (rev 5702)
@@ -0,0 +1,22 @@
+<?php
+
+	lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
+	
+    /**
+     * \ingroup View
+     * @private
+     */
+    class AdminErrorDialogView extends AdminTemplatedView 
+	{
+    	/**
+         * Constructor. If nothing else, it also has to call the constructor of the parent
+         * class, BlogAction with the same parameters
+         */
+        function AdminErrorDialogView( $blogInfo, $message = "" )
+        {
+        	$this->AdminTemplatedView( $blogInfo, "dialog" );
+			if( $message )
+				$this->setErrorMessage( $message );
+        }
+    }
+?>

Modified: plog/trunk/styles/admin.css
===================================================================
--- plog/trunk/styles/admin.css	2007-07-20 22:27:05 UTC (rev 5701)
+++ plog/trunk/styles/admin.css	2007-07-20 22:29:26 UTC (rev 5702)
@@ -434,7 +434,7 @@
     border           : 1px solid #8cacbb;
     margin           : 1em 0em 1em 0em;
     padding          : 0em 1em 1em 1em;
-    line-height      : 1.5em;
+    /*line-height      : 1.5em;*/
     width            : auto;
 }
 
@@ -453,7 +453,7 @@
     margin-left: auto;
     margin-right: auto;
     text-align: right;
-	padding-top: 1em; 
+	/*padding-top: 1em; */
 }
 
 .inputField input
@@ -1008,6 +1008,17 @@
 #album a:visited {color: #b50394;}
 #album a:hover, #album a:active, #album a:focus {color: #004ca1;background:none;}
 
+.dialog
+{
+    color            : #000000;
+    font-family      : arial, verdana, tahoma, sans-serif;
+    font-size        : 1em;
+    padding-bottom   : 0px;
+    margin-top       : 10px;
+    width            : auto;
+}
+
+
 /*.pictureFrame {
 	border: 1px solid #dfdfdf;
 	background-color: #ffffff;

Added: plog/trunk/templates/admin/dialog.template
===================================================================
--- plog/trunk/templates/admin/dialog.template	                        (rev 0)
+++ plog/trunk/templates/admin/dialog.template	2007-07-20 22:29:26 UTC (rev 5702)
@@ -0,0 +1,7 @@
+{** this template is used to display messages in one of those nice pop-up/overlay windows **}
+<div class="dialog">
+{include file="$admintemplatepath/formvalidateajax.template"}
+</div>
+<!-- <div class="buttons">
+	<input type="button" name="close" value="{$locale->tr("close")}" />
+</div> -->
\ No newline at end of file



More information about the pLog-svn mailing list