diff --git a/.travis.yml b/.travis.yml index d31c83853..8e6af327e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,14 +7,6 @@ addons: packages: - tidy -env: - global: - - TRAVIS_NODE_VERSION="4" - - ARTIFACTS_REGION=us-east-1 - - ARTIFACTS_BUCKET=silverstripe-travis-artifacts - - secure: "jVR0iLTuvVfA6jKX5+A3AdUEs8Ps+r3SbL0zGR687K8IoSp3a/+JLH12zFCEexOuxwCtOhlMq8zoZsptCEduCDq+0payk5k6GjNVywFaWjJCV573JScdaHAtoumoHMUvua+Pxds0qKAD2XEYAcOR4Qu7S4HLJV6E1QqHg9PRW5s=" # Encrypted ARTIFACTS_KEY - - secure: "SDGv49c2Ee2YBz7dATE3WnHSVSvJiRJ2BVtRasVshdNDNz3NBRzh13C2fDwTGBU1J6PxiQaGTXBy/BGsvbYk2BvdzHVwozkBpHVSaCNdarpCJ5yZZTqKC3mpA1S5353r5tqronwFuMDpftzXnRMfLZGGQ4kYb9hjV55+FPUTFPk=" # Encrypted ARTIFACTS_SECRET - matrix: fast_finish: true include: @@ -76,9 +68,3 @@ branches: - 2.2 - 2.3 - translation-staging - -# global: -# - secure: "AZmjVPtUD8JBA7ag4ULlEwEKXSEZbIUjDHeRBFugaOtdsn5yigGLmwYbzsg2tq7k7UkdbbAlGct0SUbiRJb9F2wPA5+eUd/p49fgDIU6CTSWIlT87H2BwgOrxKwS9sDwxLptPFM6vWQ8JKYSNGmVIepie9kQZbu4L2k5k6B69jQ=" -# - secure: "f3kKpUn9cS5K+p/E52cMqN18cDApol/43LanDmHO6mo3iRAztk3jZLyfNOUq6JASKMqdh8+9kencRpEoaAYbcQnDPoZsT9POResiJ9/ADKB6RwWy+lcFHUp9E2Zf/x2VRh9FmXEguDhpWzkJqzWYJGCSig1IBp/+TjzKnsjQHIY=" -# -# - php ~/travis-support/travis_setup_sauceconnect.php --if-env BEHAT_TEST --username ${SAUCE_USERNAME} --access-key ${SAUCE_ACCESS_KEY} --tunnel-identifier ${TRAVIS_JOB_NUMBER} --base-url http://localhost diff --git a/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Extend_CMS_Interface.md b/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Extend_CMS_Interface.md index 26066c80d..84fbad81e 100644 --- a/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Extend_CMS_Interface.md +++ b/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Extend_CMS_Interface.md @@ -1,6 +1,6 @@ -# How to extend the CMS interface # +# How to extend the CMS interface -## Introduction ## +## Introduction The CMS interface works just like any other part of your website: It consists of PHP controllers, templates, CSS stylesheets and JavaScript. Because it uses the @@ -23,7 +23,7 @@ and have the [Redux Devtools](https://github.com/zalmoxisus/redux-devtools-exten installed on Google Chrome or Firefox, which can be found by searching with your favourite search engine. -## Overload a CMS template ## +## Overload a CMS template If you place a template with an identical name into your application template directory (usually `mysite/templates/`), it'll take priority over the built-in @@ -72,7 +72,7 @@ Load the new CSS file into the CMS, by setting the `LeftAndMain.extra_requiremen extra_requirements_css: - mysite/css/BookmarkedPages.css -## Create a "bookmark" flag on pages ## +## Create a "bookmark" flag on pages Now we'll define which pages are actually bookmarked, a flag that is stored in the database. For this we need to decorate the page record with a diff --git a/lang/en.yml b/lang/en.yml index 577cf14c7..76cd989c2 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -217,15 +217,15 @@ en: MODIFIED: Modified Mp3Type: "MP3 audio file" MpgType: "MPEG video file" - NOFILESIZE: "Filesize is zero bytes." + NOFILESIZE: "File size is zero bytes." NOVALIDUPLOAD: "File is not a valid upload" Name: Name PLURALNAME: Files PdfType: "Adobe Acrobat PDF file" PngType: "PNG image - good general-purpose format" SINGULARNAME: File - TOOLARGE: "Filesize is too large, maximum {size} allowed" - TOOLARGESHORT: "Filesize exceeds {size}" + TOOLARGE: "File size is too large, maximum {size} allowed" + TOOLARGESHORT: "File size exceeds {size}" TiffType: "Tagged image format" Title: Title WavType: "WAV audo file" @@ -390,8 +390,8 @@ en: FROMWEB: "From the web" FindInFolder: "Find in Folder" IMAGEALT: "Alternative text (alt)" - IMAGEALTTEXT: "Alternative text (alt) - shown if image cannot be displayed" - IMAGEALTTEXTDESC: "Shown to screen readers or if image can not be displayed" + IMAGEALTTEXT: "Alternative text (alt) - shown if image can't be displayed" + IMAGEALTTEXTDESC: "Shown to screen readers or if image can't be displayed" IMAGEDIMENSIONS: Dimensions IMAGEHEIGHTPX: Height IMAGETITLE: "Title text (tooltip) - for additional information about the image" @@ -426,13 +426,13 @@ en: CANCEL: Cancel CANT_REORGANISE: "You do not have permission to alter Top level pages. Your change was not saved." DELETED: Deleted. - DropdownBatchActionsDefault: Actions + DropdownBatchActionsDefault: "Choose an action..." HELP: Help - PAGETYPE: "Page type: " + PAGETYPE: "Page type" PERMAGAIN: "You have been logged out of the CMS. If you would like to log in again, enter a username and password below." PERMALREADY: "I'm sorry, but you can't access that part of the CMS. If you want to log in as someone else, do so below." PERMDEFAULT: "You must be logged in to access the administration area; please enter your credentials below." - PLEASESAVE: "Please Save Page: This page could not be upated because it hasn't been saved yet." + PLEASESAVE: "Please Save Page: This page could not be updated because it hasn't been saved yet." PreviewButton: Preview REORGANISATIONSUCCESSFUL: "Reorganised the site tree successfully." SAVEDUP: Saved. @@ -488,7 +488,7 @@ en: SUBJECTPASSWORDRESET: "Your password reset link" SURNAME: Surname TIMEFORMAT: "Time format" - VALIDATIONMEMBEREXISTS: "A member already exists with the same %s" + VALIDATIONMEMBEREXISTS: "A member already exists with the same {identifier}" ValidationIdentifierFailed: "Can't overwrite existing member #{id} with identical identifier ({name} = {value}))" WELCOMEBACK: "Welcome Back, {firstname}" YOUROLDPASSWORD: "Your old password" diff --git a/src/Assets/Image_Backend.php b/src/Assets/Image_Backend.php index f9bd75035..ec259781a 100644 --- a/src/Assets/Image_Backend.php +++ b/src/Assets/Image_Backend.php @@ -131,4 +131,14 @@ interface Image_Backend * @return static */ public function croppedResize($width, $height); + + /** + * Crop's part of image. + * @param int $top y position of left upper corner of crop rectangle + * @param int $left x position of left upper corner of crop rectangle + * @param int $width rectangle width + * @param int $height rectangle height + * @return Image_Backend + */ + public function crop($top, $left, $width, $height); } diff --git a/src/Assets/ImagickBackend.php b/src/Assets/ImagickBackend.php index 4e91673ef..0c16a477e 100644 --- a/src/Assets/ImagickBackend.php +++ b/src/Assets/ImagickBackend.php @@ -257,4 +257,20 @@ class ImagickBackend extends Imagick implements Image_Backend $new->thumbnailImage($width, $height, true); return $new; } + + /** + * Crop's part of image. + * @param int $top y position of left upper corner of crop rectangle + * @param int $left x position of left upper corner of crop rectangle + * @param int $width rectangle width + * @param int $height rectangle height + * @return Image_Backend + */ + public function crop($top, $left, $width, $height) + { + $new = clone $this; + $new->cropImage($width, $height, $left, $top); + + return $new; + } } diff --git a/src/Core/Constants.php b/src/Core/Constants.php index 2cdb6bad6..bc5789a8d 100644 --- a/src/Core/Constants.php +++ b/src/Core/Constants.php @@ -91,9 +91,9 @@ if (!defined('TRUSTED_PROXY')) { $trusted = true; } elseif (isset($_SERVER['REMOTE_ADDR'])) { if (!class_exists('SilverStripe\\Control\\Util\\IPUtils')) { - require_once FRAMEWORK_PATH . '/control/IPUtils.php'; + require_once 'Control/IPUtils.php'; }; - $trusted = IPUtils::checkIP($_SERVER['REMOTE_ADDR'], explode(',', SS_TRUSTED_PROXY_IPS)); + $trusted = SilverStripe\Control\Util\IPUtils::checkIP($_SERVER['REMOTE_ADDR'], explode(',', SS_TRUSTED_PROXY_IPS)); } } } diff --git a/src/Dev/BuildTask.php b/src/Dev/BuildTask.php index ee0077763..b00e3ff6a 100644 --- a/src/Dev/BuildTask.php +++ b/src/Dev/BuildTask.php @@ -50,6 +50,9 @@ abstract class BuildTask extends Object */ abstract public function run($request); + /** + * @return bool + */ public function isEnabled() { return $this->enabled; diff --git a/src/Dev/CsvBulkLoader.php b/src/Dev/CsvBulkLoader.php index db6fa1e37..7d809fa7a 100644 --- a/src/Dev/CsvBulkLoader.php +++ b/src/Dev/CsvBulkLoader.php @@ -77,7 +77,7 @@ class CsvBulkLoader extends BulkLoader foreach ($files as $file) { $last = $file; - $next = $this->processChunk($file, false); + $next = $this->processChunk($file, $preview); if ($result instanceof BulkLoader_Result) { $result->merge($next); diff --git a/src/Dev/TaskRunner.php b/src/Dev/TaskRunner.php index d7903ef23..b98f18072 100644 --- a/src/Dev/TaskRunner.php +++ b/src/Dev/TaskRunner.php @@ -74,6 +74,7 @@ class TaskRunner extends Controller } /** + * Runs a BuildTask * @param HTTPRequest $request */ public function runTask($request) @@ -91,6 +92,7 @@ class TaskRunner extends Controller foreach ($tasks as $task) { if ($task['segment'] == $name) { + /** @var BuildTask $inst */ $inst = Injector::inst()->create($task['class']); $title(sprintf('Running Task %s', $inst->getTitle())); diff --git a/src/Forms/HTMLEditor/HTMLEditorField.php b/src/Forms/HTMLEditor/HTMLEditorField.php index c2169a12c..96d2a3501 100644 --- a/src/Forms/HTMLEditor/HTMLEditorField.php +++ b/src/Forms/HTMLEditor/HTMLEditorField.php @@ -31,6 +31,12 @@ class HTMLEditorField extends TextareaField */ private static $use_gzip = true; + /** + * @config + * @var string Default alignment for Images and Media. Options: leftAlone|center|left|right + */ + private static $media_alignment = 'leftAlone'; + /** * Should we check the valid_elements (& extended_valid_elements) rules from HTMLEditorConfig server side? * diff --git a/src/Forms/HTMLEditor/HTMLEditorField_File.php b/src/Forms/HTMLEditor/HTMLEditorField_File.php index d5fda3d23..afb8d1ba2 100644 --- a/src/Forms/HTMLEditor/HTMLEditorField_File.php +++ b/src/Forms/HTMLEditor/HTMLEditorField_File.php @@ -117,7 +117,8 @@ abstract class HTMLEditorField_File extends ViewableData 'center' => _t('HTMLEditorField.CSSCLASSCENTER', 'Centered, on its own.'), 'left' => _t('HTMLEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'), 'right' => _t('HTMLEditorField.CSSCLASSRIGHT', 'On the right, with text wrapping around.') - ) + ), + HtmlEditorField::config()->get('media_alignment') ), FieldGroup::create( _t('HTMLEditorField.IMAGEDIMENSIONS', 'Dimensions'),