Merge branch '3'

This commit is contained in:
Daniel Hensby 2016-12-15 12:20:29 +00:00
commit ba39e552a2
No known key found for this signature in database
GPG Key ID: 229831A941962E26
11 changed files with 55 additions and 31 deletions

View File

@ -7,14 +7,6 @@ addons:
packages: packages:
- tidy - 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: matrix:
fast_finish: true fast_finish: true
include: include:
@ -76,9 +68,3 @@ branches:
- 2.2 - 2.2
- 2.3 - 2.3
- translation-staging - 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

View File

@ -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 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 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 installed on Google Chrome or Firefox, which can be found by searching with your favourite search
engine. engine.
## Overload a CMS template ## ## Overload a CMS template
If you place a template with an identical name into your application 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 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: extra_requirements_css:
- mysite/css/BookmarkedPages.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 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 the database. For this we need to decorate the page record with a

View File

@ -217,15 +217,15 @@ en:
MODIFIED: Modified MODIFIED: Modified
Mp3Type: "MP3 audio file" Mp3Type: "MP3 audio file"
MpgType: "MPEG video file" MpgType: "MPEG video file"
NOFILESIZE: "Filesize is zero bytes." NOFILESIZE: "File size is zero bytes."
NOVALIDUPLOAD: "File is not a valid upload" NOVALIDUPLOAD: "File is not a valid upload"
Name: Name Name: Name
PLURALNAME: Files PLURALNAME: Files
PdfType: "Adobe Acrobat PDF file" PdfType: "Adobe Acrobat PDF file"
PngType: "PNG image - good general-purpose format" PngType: "PNG image - good general-purpose format"
SINGULARNAME: File SINGULARNAME: File
TOOLARGE: "Filesize is too large, maximum {size} allowed" TOOLARGE: "File size is too large, maximum {size} allowed"
TOOLARGESHORT: "Filesize exceeds {size}" TOOLARGESHORT: "File size exceeds {size}"
TiffType: "Tagged image format" TiffType: "Tagged image format"
Title: Title Title: Title
WavType: "WAV audo file" WavType: "WAV audo file"
@ -390,8 +390,8 @@ en:
FROMWEB: "From the web" FROMWEB: "From the web"
FindInFolder: "Find in Folder" FindInFolder: "Find in Folder"
IMAGEALT: "Alternative text (alt)" IMAGEALT: "Alternative text (alt)"
IMAGEALTTEXT: "Alternative text (alt) - shown if image cannot be displayed" IMAGEALTTEXT: "Alternative text (alt) - shown if image can't be displayed"
IMAGEALTTEXTDESC: "Shown to screen readers or if image can not be displayed" IMAGEALTTEXTDESC: "Shown to screen readers or if image can't be displayed"
IMAGEDIMENSIONS: Dimensions IMAGEDIMENSIONS: Dimensions
IMAGEHEIGHTPX: Height IMAGEHEIGHTPX: Height
IMAGETITLE: "Title text (tooltip) - for additional information about the image" IMAGETITLE: "Title text (tooltip) - for additional information about the image"
@ -426,13 +426,13 @@ en:
CANCEL: Cancel CANCEL: Cancel
CANT_REORGANISE: "You do not have permission to alter Top level pages. Your change was not saved." CANT_REORGANISE: "You do not have permission to alter Top level pages. Your change was not saved."
DELETED: Deleted. DELETED: Deleted.
DropdownBatchActionsDefault: Actions DropdownBatchActionsDefault: "Choose an action..."
HELP: Help 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." 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." 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." 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 PreviewButton: Preview
REORGANISATIONSUCCESSFUL: "Reorganised the site tree successfully." REORGANISATIONSUCCESSFUL: "Reorganised the site tree successfully."
SAVEDUP: Saved. SAVEDUP: Saved.
@ -488,7 +488,7 @@ en:
SUBJECTPASSWORDRESET: "Your password reset link" SUBJECTPASSWORDRESET: "Your password reset link"
SURNAME: Surname SURNAME: Surname
TIMEFORMAT: "Time format" 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}))" ValidationIdentifierFailed: "Can't overwrite existing member #{id} with identical identifier ({name} = {value}))"
WELCOMEBACK: "Welcome Back, {firstname}" WELCOMEBACK: "Welcome Back, {firstname}"
YOUROLDPASSWORD: "Your old password" YOUROLDPASSWORD: "Your old password"

View File

@ -131,4 +131,14 @@ interface Image_Backend
* @return static * @return static
*/ */
public function croppedResize($width, $height); 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);
} }

View File

@ -257,4 +257,20 @@ class ImagickBackend extends Imagick implements Image_Backend
$new->thumbnailImage($width, $height, true); $new->thumbnailImage($width, $height, true);
return $new; 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;
}
} }

View File

@ -91,9 +91,9 @@ if (!defined('TRUSTED_PROXY')) {
$trusted = true; $trusted = true;
} elseif (isset($_SERVER['REMOTE_ADDR'])) { } elseif (isset($_SERVER['REMOTE_ADDR'])) {
if (!class_exists('SilverStripe\\Control\\Util\\IPUtils')) { 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));
} }
} }
} }

View File

@ -50,6 +50,9 @@ abstract class BuildTask extends Object
*/ */
abstract public function run($request); abstract public function run($request);
/**
* @return bool
*/
public function isEnabled() public function isEnabled()
{ {
return $this->enabled; return $this->enabled;

View File

@ -77,7 +77,7 @@ class CsvBulkLoader extends BulkLoader
foreach ($files as $file) { foreach ($files as $file) {
$last = $file; $last = $file;
$next = $this->processChunk($file, false); $next = $this->processChunk($file, $preview);
if ($result instanceof BulkLoader_Result) { if ($result instanceof BulkLoader_Result) {
$result->merge($next); $result->merge($next);

View File

@ -74,6 +74,7 @@ class TaskRunner extends Controller
} }
/** /**
* Runs a BuildTask
* @param HTTPRequest $request * @param HTTPRequest $request
*/ */
public function runTask($request) public function runTask($request)
@ -91,6 +92,7 @@ class TaskRunner extends Controller
foreach ($tasks as $task) { foreach ($tasks as $task) {
if ($task['segment'] == $name) { if ($task['segment'] == $name) {
/** @var BuildTask $inst */
$inst = Injector::inst()->create($task['class']); $inst = Injector::inst()->create($task['class']);
$title(sprintf('Running Task %s', $inst->getTitle())); $title(sprintf('Running Task %s', $inst->getTitle()));

View File

@ -31,6 +31,12 @@ class HTMLEditorField extends TextareaField
*/ */
private static $use_gzip = true; 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? * Should we check the valid_elements (& extended_valid_elements) rules from HTMLEditorConfig server side?
* *

View File

@ -117,7 +117,8 @@ abstract class HTMLEditorField_File extends ViewableData
'center' => _t('HTMLEditorField.CSSCLASSCENTER', 'Centered, on its own.'), 'center' => _t('HTMLEditorField.CSSCLASSCENTER', 'Centered, on its own.'),
'left' => _t('HTMLEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'), 'left' => _t('HTMLEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'),
'right' => _t('HTMLEditorField.CSSCLASSRIGHT', 'On the right, with text wrapping around.') 'right' => _t('HTMLEditorField.CSSCLASSRIGHT', 'On the right, with text wrapping around.')
) ),
HtmlEditorField::config()->get('media_alignment')
), ),
FieldGroup::create( FieldGroup::create(
_t('HTMLEditorField.IMAGEDIMENSIONS', 'Dimensions'), _t('HTMLEditorField.IMAGEDIMENSIONS', 'Dimensions'),