[pLog-svn] r6965 - plog/branches/lifetype-1.2/class/action/admin
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Wed Jan 27 07:15:09 EST 2010
Author: jondaley
Date: 2010-01-27 07:15:08 -0500 (Wed, 27 Jan 2010)
New Revision: 6965
Modified:
plog/branches/lifetype-1.2/class/action/admin/adminaddresourceaction.class.php
Log:
always generate an error message
Modified: plog/branches/lifetype-1.2/class/action/admin/adminaddresourceaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaddresourceaction.class.php 2010-01-19 01:13:58 UTC (rev 6964)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaddresourceaction.class.php 2010-01-27 12:15:08 UTC (rev 6965)
@@ -99,7 +99,6 @@
$errorMessage = "";
foreach( $this->_files as $file ) {
-
// create a new FileUpload object based on the file
$upload = new FileUpload( $file );
@@ -116,6 +115,8 @@
$this->notifyEvent( EVENT_POST_RESOURCE_ADD, Array( "resource" => &$resource ));
}
else {
+ // TODO: some of these error messages don't accept the filename, so should either be
+ // called with tr() or else fix the locale message.
if( $res == GALLERY_ERROR_RESOURCE_FORBIDDEN_EXTENSION )
$errorMessage .= $this->_locale->pr("error_resource_forbidden_extension", $file["name"])."<br/>";
elseif( $res == GALLERY_ERROR_RESOURCE_NOT_WHITELISTED_EXTENSION )
@@ -134,7 +135,10 @@
// clear the cache no matter what happened... we should only clear it if there was at least one
// file uploaded but this way is not that bad after all...
CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
-
+
+ if(!$successMessage && !$errorMessage)
+ $errorMessage .= $this->_locale->tr("error_no_resource_uploaded")."<br/>";
+
if( $successMessage != "" ) $this->_view->setSuccessMessage( $successMessage );
if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );
$this->setCommonData();
More information about the pLog-svn
mailing list