- Patch #440778 by brianV: coding style fixes and documentation improvements.
parent
1c079c3d32
commit
4d6924dc00
|
@ -1,6 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* This file creates the administration form for the upload module.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form API callback to validate the upload settings form.
|
* Form API callback to validate the upload settings form.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
* Install, update and uninstall functions for the upload module.
|
* Install, update and uninstall functions for the upload module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* This is the install file for the upload module.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -407,7 +407,7 @@ function upload_node_delete($node) {
|
||||||
if (!is_array($node->files)) {
|
if (!is_array($node->files)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach($node->files as $file) {
|
foreach ($node->files as $file) {
|
||||||
file_delete($file);
|
file_delete($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -560,16 +560,16 @@ function _upload_form($node) {
|
||||||
if (user_access('upload files')) {
|
if (user_access('upload files')) {
|
||||||
$limits = _upload_file_limits($user);
|
$limits = _upload_file_limits($user);
|
||||||
|
|
||||||
$limit_description = t('The maximum size of file uploads is %filesize. ', array('%filesize' => format_size($limits['file_size'])));
|
$limit_description = t('The maximum size of file uploads is %filesize.', array('%filesize' => format_size($limits['file_size']))) . ' ';
|
||||||
if (!empty($limits['resolution'])) {
|
if (!empty($limits['resolution'])) {
|
||||||
if (image_get_toolkit()) {
|
if (image_get_toolkit()) {
|
||||||
$limit_description .= t('Images larger than %resolution will be resized. ', array('%resolution' => $limits['resolution']));
|
$limit_description .= t('Images larger than %resolution will be resized.', array('%resolution' => $limits['resolution'])) . ' ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$limit_description .= t('Images may not be larger than %resolution. ', array('%resolution' => $limits['resolution']));
|
$limit_description .= t('Images may not be larger than %resolution.', array('%resolution' => $limits['resolution'])) . ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$limit_description .= t('Only files with the following extensions may be uploaded: %extensions. ', array('%extensions' => $limits['extensions']));
|
$limit_description .= t('Only files with the following extensions may be uploaded: %extensions.', array('%extensions' => $limits['extensions'])) . ' ';
|
||||||
|
|
||||||
$form['new']['#weight'] = 10;
|
$form['new']['#weight'] = 10;
|
||||||
$form['new']['upload'] = array(
|
$form['new']['upload'] = array(
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* This file contains tests for the upload module.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
class UploadTestCase extends DrupalWebTestCase {
|
class UploadTestCase extends DrupalWebTestCase {
|
||||||
public static function getInfo() {
|
public static function getInfo() {
|
||||||
return array(
|
return array(
|
||||||
|
@ -125,7 +131,7 @@ class UploadTestCase extends DrupalWebTestCase {
|
||||||
// extension.
|
// extension.
|
||||||
$html_file = $html_files[1]->filepath;
|
$html_file = $html_files[1]->filepath;
|
||||||
$this->uploadFile($node, $html_file);
|
$this->uploadFile($node, $html_file);
|
||||||
$this->assertNoRaw(t('The specified file %name could not be uploaded.', array('%name' => basename($html_file))), t('File '. $html_file . ' was allowed to be uploaded'));
|
$this->assertNoRaw(t('The specified file %name could not be uploaded.', array('%name' => basename($html_file))), t('File ' . $html_file . ' was allowed to be uploaded'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue