reformat newnotice.php

This commit is contained in:
Evan Prodromou 2009-08-11 11:18:24 -04:00
parent 2d29800b6f
commit 01dccefccc
1 changed files with 28 additions and 28 deletions

View File

@ -91,8 +91,8 @@ class NewnoticeAction extends Action
// is losts when size is exceeded // is losts when size is exceeded
if (empty($_POST) && $_SERVER['CONTENT_LENGTH']) { if (empty($_POST) && $_SERVER['CONTENT_LENGTH']) {
$this->clientError(sprintf(_('The server was unable to handle ' . $this->clientError(sprintf(_('The server was unable to handle ' .
'that much POST data (%s bytes) due to its current configuration.'), 'that much POST data (%s bytes) due to its current configuration.'),
$_SERVER['CONTENT_LENGTH'])); $_SERVER['CONTENT_LENGTH']));
} }
parent::handle($args); parent::handle($args);
@ -130,7 +130,7 @@ class NewnoticeAction extends Action
$hint = ''; $hint = '';
} }
$this->clientError(sprintf( $this->clientError(sprintf(
_('%s is not a supported filetype on this server.'), $filetype) . $hint); _('%s is not a supported filetype on this server.'), $filetype) . $hint);
} }
function isRespectsQuota($user) { function isRespectsQuota($user) {
@ -190,37 +190,37 @@ class NewnoticeAction extends Action
if (isset($_FILES['attach']['error'])) { if (isset($_FILES['attach']['error'])) {
switch ($_FILES['attach']['error']) { switch ($_FILES['attach']['error']) {
case UPLOAD_ERR_NO_FILE: case UPLOAD_ERR_NO_FILE:
// no file uploaded, nothing to do // no file uploaded, nothing to do
break; break;
case UPLOAD_ERR_OK: case UPLOAD_ERR_OK:
$mimetype = $this->getUploadedFileType(); $mimetype = $this->getUploadedFileType();
if (!$this->isRespectsQuota($user)) { if (!$this->isRespectsQuota($user)) {
die('clientError() should trigger an exception before reaching here.'); die('clientError() should trigger an exception before reaching here.');
} }
break; break;
case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_INI_SIZE:
$this->clientError(_('The uploaded file exceeds the upload_max_filesize directive in php.ini.')); $this->clientError(_('The uploaded file exceeds the upload_max_filesize directive in php.ini.'));
case UPLOAD_ERR_FORM_SIZE: case UPLOAD_ERR_FORM_SIZE:
$this->clientError(_('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.')); $this->clientError(_('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.'));
case UPLOAD_ERR_PARTIAL: case UPLOAD_ERR_PARTIAL:
$this->clientError(_('The uploaded file was only partially uploaded.')); $this->clientError(_('The uploaded file was only partially uploaded.'));
case UPLOAD_ERR_NO_TMP_DIR: case UPLOAD_ERR_NO_TMP_DIR:
$this->clientError(_('Missing a temporary folder.')); $this->clientError(_('Missing a temporary folder.'));
case UPLOAD_ERR_CANT_WRITE: case UPLOAD_ERR_CANT_WRITE:
$this->clientError(_('Failed to write file to disk.')); $this->clientError(_('Failed to write file to disk.'));
case UPLOAD_ERR_EXTENSION: case UPLOAD_ERR_EXTENSION:
$this->clientError(_('File upload stopped by extension.')); $this->clientError(_('File upload stopped by extension.'));
default: default:
die('Should never reach here.'); die('Should never reach here.');
} }
} }
@ -233,7 +233,7 @@ class NewnoticeAction extends Action
$fileRecord = $this->storeFile($filename, $mimetype); $fileRecord = $this->storeFile($filename, $mimetype);
$fileurl = common_local_url('attachment', $fileurl = common_local_url('attachment',
array('attachment' => $fileRecord->id)); array('attachment' => $fileRecord->id));
// not sure this is necessary -- Zach // not sure this is necessary -- Zach
$this->maybeAddRedir($fileRecord->id, $fileurl); $this->maybeAddRedir($fileRecord->id, $fileurl);
@ -367,7 +367,7 @@ class NewnoticeAction extends Action
File_to_post::processNew($filerec->id, $notice->id); File_to_post::processNew($filerec->id, $notice->id);
$this->maybeAddRedir($filerec->id, $this->maybeAddRedir($filerec->id,
common_local_url('file', array('notice' => $notice->id))); common_local_url('file', array('notice' => $notice->id)));
} }
/** /**