Commit Graph

459 Commits

Author SHA1 Message Date
Julian Seidenberg
22c7bbfcd4 NEW UploadField displays a warning before overwriting files (only relevant if config.yml: Upload:replaceFile = true). 2013-05-25 19:07:06 +12:00
Will Rossiter
cf31114813 Merge pull request #1939 from chillu/pulls/folder-creation
Recursive folder creation in Upload
2013-05-14 02:00:06 -07:00
Sean Harvey
ebac1bf06e BUG Fixing Filesystem::sync breaking subsite pages with same URLSegments
Filesystem::sync() tries to run through all pages, without caring
which subsite the page came from. The problem with this is
code in SiteTree::validURLSegment() will return invalid information,
as it will check if the page exists, thinking it does, return false,
then the page will get a new URLSegment written, e.g. "home-2".

Instead of disabling the subsite filter in Filesystem::sync(), this
fix will just loop through each subsite and sync each subsite's pages
individually before doing the main site.
2013-05-14 09:45:14 +12:00
Ingo Schommer
68af8409a5 Recursive folder creation in Upload 2013-05-13 15:47:34 +02:00
Will Rossiter
1a36bb628e API: Add sync_blacklisted_patterns for configuring files to skip in sync tasks
Fixes http://open.silverstripe.org/ticket/6210.

Replaces the hardcoded file patterns from Folder::syncChildren() with a new static Filesystem::$sync_blacklisted_patterns to describe files and folder names to skip when running Folder::sync().

Added unit test for Folder::sync()

Extended Folder::sync() to report on the number of file / folders skipped.
2013-05-11 16:06:14 +12:00
Ingo Schommer
3b02d22989 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	dev/CsvBulkLoader.php
2013-05-09 10:34:20 +02:00
Ingo Schommer
36906f794b Merge pull request #1845 from a2nt/imagemagick_fix
FIX ImageMagick cropped resize
2013-05-08 00:45:20 -07:00
Tony Air
00b8ffd05f FIX File class typo 2013-05-08 01:27:34 +07:00
a2nt
197516b94f FIX ImageMagick cropped resize 2013-05-07 22:07:58 +07:00
Ingo Schommer
2523dfbe95 Enforcing extension-less file validation (fixes #1767)
By default, File.allowed_extensions contains '' (no extension),
but if you specifically remove it, the validation should pick it up.
2013-04-17 10:21:59 +02:00
g4b0
c8e8b5147d API: used call_user_func_array in order to have an arbitrary number of parameter for getFormattedImage (fixes #1752) 2013-04-11 16:51:36 +02:00
Ingo Schommer
f44d5b311e Added *.gpx and *.kml to allowed_extensions (fixes installer/#33)
Also sorted exensions alphabetically
2013-04-03 10:52:00 +02:00
Ingo Schommer
1916a6e8f4 Fixed config API usage (unknown call to set()) 2013-03-26 00:04:01 +01:00
Ingo Schommer
3334eafcb1 API Marked statics private, use Config API instead (#8317)
See "Static configuration properties are now immutable, you must use Config API." in the 3.1 change log for details.
2013-03-24 17:20:53 +01:00
Ingo Schommer
b282c9f8f3 Fixed deprecated GD usage 2013-03-19 10:51:39 +01:00
Ingo Schommer
83b24285fa Merge pull request #1270 from oddnoc/gd-crop-preserve-alpha
BUG: Preserve alpha channel when cropping
2013-03-12 03:25:23 -07:00
Ingo Schommer
53e988bb09 Merge remote-tracking branch 'origin/3.1.0-beta2' into 3.1 2013-03-12 10:45:44 +01:00
Fred Condo
bb30c1e590 BUG: Preserve alpha channel when cropping
This keeps the alpha channel from turning black.
2013-03-11 15:19:09 -07:00
Zauberfisch
00d01aa6e3 BUGFIX: fixed file icon for uppercase file extensions 2013-03-07 16:13:21 +00:00
Ingo Schommer
af52de97e9 Merge pull request #1161 from chillu/pulls/uploadfield-replacefile
NEW Upload->replaceFile setting
2013-02-27 01:24:27 -08:00
Ingo Schommer
a86e4ee00c Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	tests/injector/InjectorTest.php
	tests/travis/before_script
2013-02-18 14:15:42 +01:00
Simon Welsh
b81386a431 Correct check for File subclass 2013-02-18 17:35:17 +13:00
Ingo Schommer
083b6b2164 NEW Upload->replaceFile setting 2013-02-05 19:28:24 +01:00
Ingo Schommer
86940aa684 Made hyphen escaping clearer in FileNameFilter and URLSegmentFilter
Does not actually change behaviour, but ensures that the hyphen
is not interpreted as a range identifier should it be placed
between two characters which PCRE regards as "rangeable".
2012-12-19 17:30:28 +01:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Simon Welsh
fc5dd2994c Add codesniffer that ensures indentation is with tabs. 2012-12-12 00:12:11 +13:00
Damian Mooyman
65002f6b83 BUG GD::greyscale did not correctly preserve alpha component of images Added test cases to test greyscale operation across various image formats Replaced various magic numbers with IMAGETYPE_XXX definitions 2012-12-04 09:47:26 +01:00
Ingo Schommer
414c006c8e BUG Restore GD class to avoid breaking GD::set_default_quality() calls
Regression from d24b586
2012-11-27 11:20:19 +01:00
Ingo Schommer
c55c7c33f8 Merge branch '3.0'
Conflicts:
	admin/code/CMSProfileController.php
	composer.json
	tests/model/DataObjectTest.php
2012-11-22 23:51:28 +01:00
Sean Harvey
a46838c436 Removed deprecated Folder::findOrMake(), use find_or_make() instead 2012-11-16 14:19:19 +13:00
Sean Harvey
5a98cddd87 Removing deprecated File::TreeTitle(), use File::getTreeTitle() instead 2012-11-15 14:43:14 +13:00
Sean Harvey
e52db56ac8 Removing deprecated validator functions on Upload
Use Upload_Validator instead.
2012-11-15 14:43:14 +13:00
Will Rossiter
af2ac1d8c5 FIX: include ImagickBackend only when Imagick installed 2012-11-11 15:13:36 +13:00
Sean Harvey
68826357cc BUG Fixing non-object on file upload
Upload::load() assumes that a parent Folder always exists for a file
upload, but that's not always the case, and a non-object error is
given if no parent folder.

Check the folder exists first before getting the ID.
2012-11-08 21:28:05 +13:00
Sam Minnée
0238db4182 Merge pull request #898 from TheFrozenFire/feature-ImageBackend
ENHANCEMENT: Enable multiple image manipulation back-ends on the Image class
2012-11-04 20:03:57 -08:00
Sean Harvey
0f55a11a5a Merge pull request #872 from chillu/pulls/file-permission
API File->canEdit() returns TRUE by default (not checking CMS perms)
2012-11-04 19:33:18 -08:00
Justin Martin
d24b586830 NEW: Enable multiple image manipulation back-ends on the Image class 2012-11-03 19:38:09 -07:00
Sean Harvey
1ce279ec9d BUG FileNameFilter should remove any amount of underscores from start of filename
When a user renames a file to "__test.txt" (two underscores or more),
then FileNameFilter will only remove the very first underscore from the
filename. This is not sufficient, as any number of underscores in the
filename will be problematic when Filesystem::sync() is called, it will
remove that File record thinking it's an internal file. This fixes it
so any number of underscores are stripped out at the start of the filename.
2012-10-29 17:07:58 +13:00
Ingo Schommer
a3295e2a37 API File->canEdit() returns TRUE by default (not checking CMS perms)
This is a measure to support form fields and controllers
interacting with files in different contexts,
for example an UploadField used in a ModelAdmin,
or a website frontend. The check for 'CMS_ACCESS_AssetAdmin'
was too restricting. This wasn't a problem in 2.x simply because
the old FileField/Upload classes didn't respect File->can*()
permissions.
2012-10-12 15:42:06 +02:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
jean
70cc688fab NEW 7838 Support for document as a category in File class 2012-09-04 11:08:38 +12:00
Ingo Schommer
0a6a3fa936 i18n for file type descriptors (see #7798) 2012-08-27 00:02:52 +02:00
Nik Rolls
5c5a506878 BUG removed use of deprecated method 2012-08-10 18:32:55 +12:00
Ingo Schommer
712f28bc78 Scoped deprecation messages (fixes #7645) 2012-07-13 11:37:35 +02:00
mightycoco
e2d7352c81 ENHANCEMENT File::get_app_category()
Adding File::get_app_category to be in line with
File::get_file_extension
2012-06-25 17:13:18 +02:00
Will Rossiter
a4bce3fc44 ENHANCEMENT: remove dependencies between framework tests and cms module. 2012-06-20 16:17:29 +02:00
Ingo Schommer
a96659ba8b Merge pull request #532 from halkyon/filesystem_sync_fix
BUGFIX "Sync files" button doesn't work when syncing the root of the assets
2012-06-15 10:27:55 -07:00
Simon Welsh
9bd7765272 API CHANGE Renames Transliterator to SS_Transliterator
The intl extension in PHP 5.4 provides a Transliterator class, which
conflicts with the SilverStripe one. This leads to some really weird
ReflectionExceptions about Transliterator's constructor being
private.
2012-06-15 15:54:47 +12:00
Sean Harvey
72fd0128c4 BUGFIX "Sync files" button doesn't work when syncing the root of the assets folder 2012-06-15 11:28:29 +12:00
Sean Harvey
5462cdaab2 MINOR Removing "." from the end of validation messages 2012-06-01 13:13:06 +12:00
Ingo Schommer
18fa9cd03d MINOR Fixed _t() message in AssetAdmin (fixes #7363) 2012-05-20 10:49:12 +02:00
Ingo Schommer
42bc5ffb47 BUGFIX Returning File->getTreeTitle() with user input XML escaped, mirroring functionality in SiteTree->getTreeTitle() 2012-05-03 17:41:02 +02:00
Ingo Schommer
7b18d9d0da MINOR Switching _t() calls from sprintf() to using injection parameters (#7170) 2012-05-01 22:17:00 +02:00
Normann Lou
92f3d62d70 ENHANCEMENT: add extra <span> DOM with 'jstree-foldericon' class for tree view of folders 2012-04-26 11:17:16 +02:00
Ingo Schommer
473d3a66b8 MINOR Fixed controller contexts in LeftAndMain->SiteTreeAsUL() - needs different context for edit links and determining "current page" (not applicable for CMSPagesController) 2012-04-17 22:33:30 +02:00
Ingo Schommer
d44f6b3e1f MINOR Removed deprecated usage of $priority argument in _t() calls 2012-04-15 17:17:17 +02:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Simon Welsh
3a6341a251 API-CHANGE sapphire folder can now be renamed. 2012-04-15 10:50:19 +12:00
Simon Welsh
f8082e4814 MINOR Add newline to end of files without one 2012-04-15 10:50:19 +12:00
Ingo Schommer
8ba9c3ca6b API CHANGE Removed $params argument to DataObject->getCMSFields(), please use FormScaffolder directly (fixes #7135) 2012-04-13 15:46:47 +02:00
Sam Minnée
d766100335 Merge pull request #304 from halkyon/e_strict_fixes
Enable E_STRICT by default for development, fix all E_STRICT errors affected by tests.
2012-04-11 17:54:18 -07:00
Sean Harvey
a9f95051bc BUGFIX File::ini2bytes() is now declared as static, as it was never an
instance method
2012-04-12 12:03:33 +12:00
Sam Minnée
b435d0a3d2 Merge pull request #288 from jmwohl/patch-1
For png images with transparency, the imagesaveaplpha() needs to be set ...
2012-04-11 16:33:02 -07:00
Sam Minnee
adf658c91f BUGFIX: Removed obsolete field File.Sort 2012-04-11 18:13:13 +12:00
jmwohl
797d526c60 For png images with transparency, the imagesaveaplpha() needs to be set to true on the source image in order for the alpha to be preserved when using the modifier methods. 2012-04-06 11:19:30 -03:00
Ingo Schommer
40d73127ae MINOR Using late static binding instead of Object::create() calls 2012-04-04 17:10:31 +02:00
Ingo Schommer
7c1b40d4a7 MINOR Added 'updateCMSFields' hook to File (fixes #7091) 2012-03-30 16:55:44 +02:00
Sean Harvey
e097f6e1a8 MINOR Fixes to method arguments in core classes for E_STRICT support.
API CHANGE Remove abstract static function and just use static functions
in Authenticator (PHP 5.3+ doesn't support abstract static functions)
2012-03-28 22:41:42 +13:00
Simon Elvery
c9aa0e74b9 ENHANCEMENT: Before preforming an image resize, make sure it's actually required.
This is better from an efficiency point of view and it also eliminates unessesary re-sampling (i.e. reduction in quailty).
2012-03-26 14:21:14 +10:00
Sean Harvey
7f60ced66b ENHANCEMENT Allow disabling of File::updateFilesystem() which is useful
for manually managing the filesystem paths instead. Defaults to on, but
useful to turn off when loading File records in a YAML fixture for test
data.
2012-03-14 15:53:04 +13:00
Andrew O'Neil
5eef837ce8 FEATURE: Add count of backlinks to file details 2012-03-12 23:01:07 +01:00
Hamish Friedlander
686b0207d5 BUGFIX: Cant use combined_static in FileFinder any more - it falls through to Config system, which doesnt yet exist 2012-03-09 18:13:57 +13:00
Sean Harvey
4a52e29620 API CHANGE Removed deprecated File::getLinkedURL() - please use custom code instead. 2012-03-09 14:37:06 +13:00
Ingo Schommer
e4a6dd5850 Merge branch 'integration'
Conflicts:
	forms/gridfield/GridField.php
2012-03-08 20:25:21 +01:00
Julian Seidenberg
550cb7df9c ENHANCEMENT: SSF-30 adding the ability to set the parent folder of a file. 2012-03-07 16:43:12 +13:00
Sam Minnee
adfdd068e2 Merge branch 'ereg-to-preg' of https://github.com/AngryPHPNerd/sapphire
Conflicts:
	model/fieldtypes/Date.php
2012-03-05 13:54:20 +13:00
Sean Harvey
b3d977f0e7 Merge remote-tracking branch 'upstream/master' into file_shortcodes 2012-03-03 10:24:06 +13:00
Ingo Schommer
98e1fed746 ENHANCEMENT File::$app_categories to replace switch statement in File->appCategory(), and expose data to other use cases (such as filter drop downs in AssetAdmin) 2012-03-02 20:46:22 +01:00
Ingo Schommer
ef77b709c2 MINOR Fixed field label in Folder->getCMSFields() 2012-03-02 20:46:22 +01:00
Ingo Schommer
fda7a6aafe API CHANGE Remove custom File::instance_get(), use a custom DataQuery in case you want to exclude large File.Content fields from the query results 2012-03-02 15:22:11 +01:00
Ingo Schommer
fb3c18d6d2 API CHANGE Remove File->uploadMetadataFields(), use new UploadField instead 2012-03-02 15:21:32 +01:00
Sean Harvey
898c8f5497 ENHANCEMENT [file_link id=n] shortcode support for file links in HtmlEditorField 2012-03-01 22:20:58 +13:00
Ingo Schommer
da879da940 MINOR Styling and structural fixes for File/Image->getCMSFields() and relates usage in UploadField/HTMLEditorField. 2012-02-29 21:06:43 +01:00
AngryPHPNerd
2457c4f0bc BUGFIX: Eescape / in RegExp. 2012-02-28 00:44:27 +01:00
Ingo Schommer
bcc73de85e Merge branch '106-add-edit-records-rc'
Conflicts:
	admin/code/LeftAndMain.php
	admin/css/screen.css
	admin/scss/_style.scss
	admin/templates/Includes/LeftAndMain_EditForm.ss
	css/GridField.css
	filesystem/Folder.php
	forms/gridfield/GridField.php
	forms/gridfield/GridFieldDefaultColumns.php
	forms/gridfield/GridFieldPopupForms.php
2012-02-27 23:58:10 +01:00
Ingo Schommer
3b53ed1937 MINOR Moved some CMS-specific template config into GridFieldPopupForms, to make the external API easier to use, and make specific configs less dependent on the instanciation context, and more tuned to the actual execution controller context 2012-02-27 23:52:48 +01:00
Ingo Schommer
ba0d1c60cb MINOR Don't require controller on instanciation of GridFieldPopupForms, as it can't be reliably determined e.g. during a getCMSFields() call. Should use existing FormField/Form API to retrieve controller when its required.
MINOR Renamed GridFieldPopupForms->popupFormName to $name to make it clearer that its the component name (which is optional now).
2012-02-27 23:52:48 +01:00
Julian Seidenberg
550f75408e ENHANCEMENT: File and Image CMSFields styling 2012-02-27 23:52:40 +01:00
AngryPHPNerd
0e2cbb0b88 Replace ereg with preg_* 2012-02-27 22:14:02 +01:00
Ingo Schommer
27cdc40c7a API CHANGE Moved AssetAdmin-specific fields from Folder->getCMSFields() to AssetAdmin->getEditForm(). For modifying those fields via DataExtension, please use AssetAdmin->updateEditForm() instead 2012-02-23 23:29:57 +01:00
Ingo Schommer
cbc2891c80 MINOR Metadata for GridField and Folder->getCMSFields() to allow opening folder references in the UI 2012-02-23 18:39:42 +01:00
Ingo Schommer
abfa16fa70 ENHANCEMENT Using native jQuery UI buttons and icon styling for a less coupled implementation (e.g. assuming that a "constructive" button always has a specific icon, or one at all). All CMS UI buttons switched to use <button> markup, which allows for inline icons and correctly aligned multi-line button labels. 2012-02-17 15:58:32 +01:00
Ingo Schommer
f2717f0788 ENHANCEMENT GridField-based file listing 2012-02-17 13:33:39 +01:00
Ingo Schommer
4f49c452ac BUGFIX Return zero file size for folders (mainly to avoid listing it in AssetAdmin tables, but also because it doesn't make sense for folders) 2012-02-17 13:33:39 +01:00
Sam Minnee
b260c63bab ENHANCEMENT: Use Folder's Form Tabs to provide the top 3 tabs in the CMS. 2012-02-15 14:26:45 +01:00
Ingo Schommer
2c5d71dc29 MINOR New category 'flash' in File->appCategory() (mainly for usage in "insert flash" logic) 2012-02-14 13:53:35 +01:00
Fred Condo
d370423825 Clean up trailing ?> per coding standard
All sapphire but the lang directory
2012-02-12 12:40:16 -08:00
Ingo Schommer
1b4dda491a MINOR Moving File->OwnerID setting to model layer 2012-02-08 01:04:56 +01:00
Felipe Skroski
586ae4ab6e MINOR GridField column header and sorting styles 2012-02-03 15:27:18 +01:00