mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #5465 from frankmullenger/4917-renaming
MINOR: Renaming classes with 'Html' camel cased.
This commit is contained in:
commit
459fb4ec80
@ -1,5 +1,5 @@
|
||||
Injector:
|
||||
HTMLValue:
|
||||
class: SS_HTML4Value
|
||||
HtmlEditorConfig:
|
||||
HTMLEditorConfig:
|
||||
class: TinyMCEConfig
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
// Default CMS HTMLEditorConfig
|
||||
HtmlEditorConfig::get('cms')->setOptions(array(
|
||||
HTMLEditorConfig::get('cms')->setOptions(array(
|
||||
'friendly_name' => 'Default CMS',
|
||||
'priority' => '50',
|
||||
|
||||
@ -28,7 +28,7 @@ HtmlEditorConfig::get('cms')->setOptions(array(
|
||||
. "object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]"
|
||||
));
|
||||
|
||||
HtmlEditorConfig::get('cms')
|
||||
HTMLEditorConfig::get('cms')
|
||||
->enablePlugins(array(
|
||||
'contextmenu' => null,
|
||||
'image' => null,
|
||||
|
@ -427,12 +427,12 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
|
||||
// Set the members html editor config
|
||||
if(Member::currentUser()) {
|
||||
HtmlEditorConfig::set_active_identifier(Member::currentUser()->getHtmlEditorConfigForCMS());
|
||||
HTMLEditorConfig::set_active_identifier(Member::currentUser()->getHtmlEditorConfigForCMS());
|
||||
}
|
||||
|
||||
// Set default values in the config if missing. These things can't be defined in the config
|
||||
// file because insufficient information exists when that is being processed
|
||||
$htmlEditorConfig = HtmlEditorConfig::get_active();
|
||||
$htmlEditorConfig = HTMLEditorConfig::get_active();
|
||||
$htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
|
||||
if(!$htmlEditorConfig->getOption('content_css')) {
|
||||
$cssFiles = array();
|
||||
@ -1564,7 +1564,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
||||
* Return the CMS's HTML-editor toolbar
|
||||
*/
|
||||
public function EditorToolbar() {
|
||||
return HtmlEditorField_Toolbar::create($this, "EditorToolbar");
|
||||
return HTMLEditorField_Toolbar::create($this, "EditorToolbar");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,7 @@
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorSanitiser {
|
||||
class HTMLEditorSanitiser {
|
||||
|
||||
/** @var [stdClass] - $element => $rule hash for whitelist element rules where the element name isn't a pattern */
|
||||
protected $elements = array();
|
||||
@ -21,14 +21,14 @@ class HtmlEditorSanitiser {
|
||||
protected $globalAttributes = array();
|
||||
|
||||
/**
|
||||
* Construct a sanitiser from a given HtmlEditorConfig
|
||||
* Construct a sanitiser from a given HTMLEditorConfig
|
||||
*
|
||||
* Note that we build data structures from the current state of HtmlEditorConfig - later changes to
|
||||
* Note that we build data structures from the current state of HTMLEditorConfig - later changes to
|
||||
* the passed instance won't cause this instance to update it's whitelist
|
||||
*
|
||||
* @param HtmlEditorConfig $config
|
||||
* @param HTMLEditorConfig $config
|
||||
*/
|
||||
public function __construct(HtmlEditorConfig $config) {
|
||||
public function __construct(HTMLEditorConfig $config) {
|
||||
$valid = $config->getOption('valid_elements');
|
||||
if ($valid) $this->addValidElements($valid);
|
||||
|
@ -1601,7 +1601,7 @@ class UploadField_SelectHandler extends RequestHandler {
|
||||
*/
|
||||
protected function getListField($folderID) {
|
||||
// Generate the folder selection field.
|
||||
$folderField = new TreeDropdownField('ParentID', _t('HtmlEditorField.FOLDER', 'Folder'), 'Folder');
|
||||
$folderField = new TreeDropdownField('ParentID', _t('HTMLEditorField.FOLDER', 'Folder'), 'Folder');
|
||||
$folderField->setValue($folderID);
|
||||
|
||||
// Generate the file list field.
|
||||
|
@ -3,29 +3,29 @@
|
||||
/**
|
||||
* A PHP version of TinyMCE's configuration, to allow various parameters to be configured on a site or section basis
|
||||
*
|
||||
* There can be multiple HtmlEditorConfig's, which should always be created / accessed using HtmlEditorConfig::get.
|
||||
* There can be multiple HTMLEditorConfig's, which should always be created / accessed using HTMLEditorConfig::get.
|
||||
* You can then set the currently active config using set_active.
|
||||
* The order of precendence for which config is used is (lowest to highest):
|
||||
*
|
||||
* - default_config config setting
|
||||
* - Active config assigned
|
||||
* - Config name assigned to HtmlEditorField
|
||||
* - Config instance assigned to HtmlEditorField
|
||||
* - Config name assigned to HTMLEditorField
|
||||
* - Config instance assigned to HTMLEditorField
|
||||
*
|
||||
* Typically global config changes should set the active config.
|
||||
*
|
||||
* The defaut config class can be changed via dependency injection to replace HtmlEditorConfig.
|
||||
* The defaut config class can be changed via dependency injection to replace HTMLEditorConfig.
|
||||
*
|
||||
* @author "Hamish Friedlander" <hamish@silverstripe.com>
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
abstract class HtmlEditorConfig extends Object {
|
||||
abstract class HTMLEditorConfig extends Object {
|
||||
|
||||
/**
|
||||
* Array of registered configurations
|
||||
*
|
||||
* @var HtmlEditorConfig[]
|
||||
* @var HTMLEditorConfig[]
|
||||
*/
|
||||
protected static $configs = array();
|
||||
|
||||
@ -46,11 +46,11 @@ abstract class HtmlEditorConfig extends Object {
|
||||
private static $default_config = 'default';
|
||||
|
||||
/**
|
||||
* Get the HtmlEditorConfig object for the given identifier. This is a correct way to get an HtmlEditorConfig
|
||||
* Get the HTMLEditorConfig object for the given identifier. This is a correct way to get an HTMLEditorConfig
|
||||
* instance - do not call 'new'
|
||||
*
|
||||
* @param string $identifier The identifier for the config set. If omitted, the active config is returned.
|
||||
* @return HtmlEditorConfig The configuration object.
|
||||
* @return HTMLEditorConfig The configuration object.
|
||||
* This will be created if it does not yet exist for that identifier
|
||||
*/
|
||||
public static function get($identifier = null) {
|
||||
@ -68,10 +68,10 @@ abstract class HtmlEditorConfig extends Object {
|
||||
* Assign a new config for the given identifier
|
||||
*
|
||||
* @param string $identifier A specific identifier
|
||||
* @param HtmlEditorConfig $config
|
||||
* @return HtmlEditorConfig The assigned config
|
||||
* @param HTMLEditorConfig $config
|
||||
* @return HTMLEditorConfig The assigned config
|
||||
*/
|
||||
public static function set_config($identifier, HtmlEditorConfig $config) {
|
||||
public static function set_config($identifier, HTMLEditorConfig $config) {
|
||||
self::$configs[$identifier] = $config;
|
||||
return $config;
|
||||
}
|
||||
@ -100,7 +100,7 @@ abstract class HtmlEditorConfig extends Object {
|
||||
/**
|
||||
* Get the currently active configuration object
|
||||
*
|
||||
* @return HtmlEditorConfig The active configuration object
|
||||
* @return HTMLEditorConfig The active configuration object
|
||||
*/
|
||||
public static function get_active() {
|
||||
$identifier = self::get_active_identifier();
|
||||
@ -110,10 +110,10 @@ abstract class HtmlEditorConfig extends Object {
|
||||
/**
|
||||
* Assigns the currently active config an explicit instance
|
||||
*
|
||||
* @param HtmlEditorConfig $config
|
||||
* @return HtmlEditorConfig The given config
|
||||
* @param HTMLEditorConfig $config
|
||||
* @return HTMLEditorConfig The given config
|
||||
*/
|
||||
public static function set_active(HtmlEditorConfig $config) {
|
||||
public static function set_active(HTMLEditorConfig $config) {
|
||||
$identifier = static::get_active_identifier();
|
||||
return static::set_config($identifier, $config);
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField extends TextareaField {
|
||||
class HTMLEditorField extends TextareaField {
|
||||
|
||||
/**
|
||||
* Use TinyMCE's GZIP compressor
|
||||
@ -17,7 +17,7 @@ class HtmlEditorField extends TextareaField {
|
||||
private static $use_gzip = true;
|
||||
|
||||
/**
|
||||
* 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?
|
||||
*
|
||||
* @config
|
||||
* @var bool
|
||||
@ -35,29 +35,29 @@ class HtmlEditorField extends TextareaField {
|
||||
/**
|
||||
* ID or instance of editorconfig
|
||||
*
|
||||
* @var string|HtmlEditorConfig
|
||||
* @var string|HTMLEditorConfig
|
||||
*/
|
||||
protected $editorConfig = null;
|
||||
|
||||
/**
|
||||
* Gets the HtmlEditorConfig instance
|
||||
* Gets the HTMLEditorConfig instance
|
||||
*
|
||||
* @return HtmlEditorConfig
|
||||
* @return HTMLEditorConfig
|
||||
*/
|
||||
public function getEditorConfig() {
|
||||
// Instance override
|
||||
if($this->editorConfig instanceof HtmlEditorConfig) {
|
||||
if($this->editorConfig instanceof HTMLEditorConfig) {
|
||||
return $this->editorConfig;
|
||||
}
|
||||
|
||||
// Get named / active config
|
||||
return HtmlEditorConfig::get($this->editorConfig);
|
||||
return HTMLEditorConfig::get($this->editorConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a new configuration instance or identifier
|
||||
*
|
||||
* @param string|HtmlEditorConfig $config
|
||||
* @param string|HTMLEditorConfig $config
|
||||
* @return $this
|
||||
*/
|
||||
public function setEditorConfig($config) {
|
||||
@ -72,7 +72,7 @@ class HtmlEditorField extends TextareaField {
|
||||
* @param string $name The internal field name, passed to forms.
|
||||
* @param string $title The human-readable field label.
|
||||
* @param mixed $value The value of the field.
|
||||
* @param string $config HtmlEditorConfig identifier to be used. Default to the active one.
|
||||
* @param string $config HTMLEditorConfig identifier to be used. Default to the active one.
|
||||
*/
|
||||
public function __construct($name, $title = null, $value = '', $config = null) {
|
||||
parent::__construct($name, $title, $value);
|
||||
@ -94,14 +94,14 @@ class HtmlEditorField extends TextareaField {
|
||||
public function saveInto(DataObjectInterface $record) {
|
||||
if($record->hasField($this->name) && $record->escapeTypeForField($this->name) != 'xml') {
|
||||
throw new Exception (
|
||||
'HtmlEditorField->saveInto(): This field should save into a HTMLText or HTMLVarchar field.'
|
||||
'HTMLEditorField->saveInto(): This field should save into a HTMLText or HTMLVarchar field.'
|
||||
);
|
||||
}
|
||||
|
||||
// Sanitise if requested
|
||||
$htmlValue = Injector::inst()->create('HTMLValue', $this->Value());
|
||||
if($this->config()->sanitise_server_side) {
|
||||
$santiser = Injector::inst()->create('HtmlEditorSanitiser', HtmlEditorConfig::get_active());
|
||||
$santiser = Injector::inst()->create('HTMLEditorSanitiser', HTMLEditorConfig::get_active());
|
||||
$santiser->sanitise($htmlValue);
|
||||
}
|
||||
|
||||
@ -119,10 +119,10 @@ class HtmlEditorField extends TextareaField {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HtmlEditorField_Readonly
|
||||
* @return HTMLEditorField_Readonly
|
||||
*/
|
||||
public function performReadonlyTransformation() {
|
||||
$field = $this->castedCopy('HtmlEditorField_Readonly');
|
||||
$field = $this->castedCopy('HTMLEditorField_Readonly');
|
||||
$field->dontEscape = true;
|
||||
|
||||
return $field;
|
||||
@ -144,7 +144,7 @@ class HtmlEditorField extends TextareaField {
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_Readonly extends ReadonlyField {
|
||||
class HTMLEditorField_Readonly extends ReadonlyField {
|
||||
public function Field($properties = array()) {
|
||||
$valforInput = $this->value ? Convert::raw2att($this->value) : "";
|
||||
return "<span class=\"readonly typography\" id=\"" . $this->id() . "\">"
|
||||
@ -163,7 +163,7 @@ class HtmlEditorField_Readonly extends ReadonlyField {
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
class HTMLEditorField_Toolbar extends RequestHandler {
|
||||
|
||||
private static $allowed_actions = array(
|
||||
'LinkForm',
|
||||
@ -175,7 +175,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $templateViewFile = 'HtmlEditorField_viewfile';
|
||||
protected $templateViewFile = 'HTMLEditorField_viewfile';
|
||||
|
||||
protected $controller, $name;
|
||||
|
||||
@ -213,7 +213,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
* @return Form
|
||||
*/
|
||||
public function LinkForm() {
|
||||
$siteTree = TreeDropdownField::create('internal', _t('HtmlEditorField.PAGE', "Page"),
|
||||
$siteTree = TreeDropdownField::create('internal', _t('HTMLEditorField.PAGE', "Page"),
|
||||
'SiteTree', 'ID', 'MenuTitle', true);
|
||||
// mimic the SiteTree::getMenuTitle(), which is bypassed when the search is performed
|
||||
$siteTree->setSearchFunction(array($this, 'siteTreeSearchCallback'));
|
||||
@ -228,35 +228,35 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
new LiteralField(
|
||||
'Heading',
|
||||
sprintf('<h3 class="htmleditorfield-mediaform-heading insert">%s</h3>',
|
||||
_t('HtmlEditorField.LINK', 'Insert Link'))
|
||||
_t('HTMLEditorField.LINK', 'Insert Link'))
|
||||
)
|
||||
),
|
||||
$contentComposite = new CompositeField(
|
||||
OptionsetField::create(
|
||||
'LinkType',
|
||||
sprintf($numericLabelTmpl, '1', _t('HtmlEditorField.LINKTO', 'Link to')),
|
||||
sprintf($numericLabelTmpl, '1', _t('HTMLEditorField.LINKTO', 'Link to')),
|
||||
array(
|
||||
'internal' => _t('HtmlEditorField.LINKINTERNAL', 'Page on the site'),
|
||||
'external' => _t('HtmlEditorField.LINKEXTERNAL', 'Another website'),
|
||||
'anchor' => _t('HtmlEditorField.LINKANCHOR', 'Anchor on this page'),
|
||||
'email' => _t('HtmlEditorField.LINKEMAIL', 'Email address'),
|
||||
'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'),
|
||||
'internal' => _t('HTMLEditorField.LINKINTERNAL', 'Page on the site'),
|
||||
'external' => _t('HTMLEditorField.LINKEXTERNAL', 'Another website'),
|
||||
'anchor' => _t('HTMLEditorField.LINKANCHOR', 'Anchor on this page'),
|
||||
'email' => _t('HTMLEditorField.LINKEMAIL', 'Email address'),
|
||||
'file' => _t('HTMLEditorField.LINKFILE', 'Download a file'),
|
||||
),
|
||||
'internal'
|
||||
),
|
||||
LiteralField::create('Step2',
|
||||
'<div class="step2">'
|
||||
. sprintf($numericLabelTmpl, '2', _t('HtmlEditorField.DETAILS', 'Details')) . '</div>'
|
||||
. sprintf($numericLabelTmpl, '2', _t('HTMLEditorField.DETAILS', 'Details')) . '</div>'
|
||||
),
|
||||
$siteTree,
|
||||
TextField::create('external', _t('HtmlEditorField.URL', 'URL'), 'http://'),
|
||||
EmailField::create('email', _t('HtmlEditorField.EMAIL', 'Email address')),
|
||||
$fileField = UploadField::create('file', _t('HtmlEditorField.FILE', 'File')),
|
||||
TextField::create('Anchor', _t('HtmlEditorField.ANCHORVALUE', 'Anchor')),
|
||||
TextField::create('Subject', _t('HtmlEditorField.SUBJECT', 'Email subject')),
|
||||
TextField::create('Description', _t('HtmlEditorField.LINKDESCR', 'Link description')),
|
||||
TextField::create('external', _t('HTMLEditorField.URL', 'URL'), 'http://'),
|
||||
EmailField::create('email', _t('HTMLEditorField.EMAIL', 'Email address')),
|
||||
$fileField = UploadField::create('file', _t('HTMLEditorField.FILE', 'File')),
|
||||
TextField::create('Anchor', _t('HTMLEditorField.ANCHORVALUE', 'Anchor')),
|
||||
TextField::create('Subject', _t('HTMLEditorField.SUBJECT', 'Email subject')),
|
||||
TextField::create('Description', _t('HTMLEditorField.LINKDESCR', 'Link description')),
|
||||
CheckboxField::create('TargetBlank',
|
||||
_t('HtmlEditorField.LINKOPENNEWWIN', 'Open link in a new window?')),
|
||||
_t('HTMLEditorField.LINKOPENNEWWIN', 'Open link in a new window?')),
|
||||
HiddenField::create('Locale', null, $this->controller->Locale)
|
||||
)
|
||||
),
|
||||
@ -333,13 +333,13 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$select->addExtraClass('content-select');
|
||||
|
||||
|
||||
$URLDescription = _t('HtmlEditorField.URLDESCRIPTION', 'Insert videos and images from the web into your page simply by entering the URL of the file. Make sure you have the rights or permissions before sharing media directly from the web.<br /><br />Please note that files are not added to the file store of the CMS but embeds the file from its original location, if for some reason the file is no longer available in its original location it will no longer be viewable on this page.');
|
||||
$URLDescription = _t('HTMLEditorField.URLDESCRIPTION', 'Insert videos and images from the web into your page simply by entering the URL of the file. Make sure you have the rights or permissions before sharing media directly from the web.<br /><br />Please note that files are not added to the file store of the CMS but embeds the file from its original location, if for some reason the file is no longer available in its original location it will no longer be viewable on this page.');
|
||||
$fromWeb = new CompositeField(
|
||||
$description = new LiteralField('URLDescription', '<div class="url-description">' . $URLDescription . '</div>'),
|
||||
$remoteURL = new TextField('RemoteURL', 'http://'),
|
||||
new LiteralField('addURLImage',
|
||||
'<button type="button" class="action ui-action-constructive ui-button field font-icon-plus add-url">' .
|
||||
_t('HtmlEditorField.BUTTONADDURL', 'Add url').'</button>')
|
||||
_t('HTMLEditorField.BUTTONADDURL', 'Add url').'</button>')
|
||||
);
|
||||
|
||||
$remoteURL->addExtraClass('remoteurl');
|
||||
@ -351,7 +351,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$computerUploadField->setConfig('previewMaxHeight', 30);
|
||||
$computerUploadField->addExtraClass('ss-assetuploadfield htmleditorfield-from-computer');
|
||||
$computerUploadField->removeExtraClass('ss-uploadfield');
|
||||
$computerUploadField->setTemplate('HtmlEditorField_UploadField');
|
||||
$computerUploadField->setTemplate('HTMLEditorField_UploadField');
|
||||
$computerUploadField->setFolderName(Config::inst()->get('Upload', 'uploads_folder'));
|
||||
|
||||
$defaultPanel = new CompositeField(
|
||||
@ -380,9 +380,9 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
new LiteralField(
|
||||
'Heading',
|
||||
sprintf('<h3 class="htmleditorfield-mediaform-heading insert">%s</h3>',
|
||||
_t('HtmlEditorField.INSERTMEDIA', 'Insert media from')).
|
||||
_t('HTMLEditorField.INSERTMEDIA', 'Insert media from')).
|
||||
sprintf('<h3 class="htmleditorfield-mediaform-heading update">%s</h3>',
|
||||
_t('HtmlEditorField.UpdateMEDIA', 'Update media'))
|
||||
_t('HTMLEditorField.UpdateMEDIA', 'Update media'))
|
||||
)
|
||||
);
|
||||
|
||||
@ -454,7 +454,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
protected function viewfile_getRemoteFileByURL($fileUrl) {
|
||||
if(!Director::is_absolute_url($fileUrl)) {
|
||||
throw $this->getErrorFor(_t(
|
||||
"HtmlEditorField_Toolbar.ERROR_ABSOLUTE",
|
||||
"HTMLEditorField_Toolbar.ERROR_ABSOLUTE",
|
||||
"Only absolute urls can be embedded"
|
||||
));
|
||||
}
|
||||
@ -462,7 +462,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$allowed_schemes = self::config()->fileurl_scheme_whitelist;
|
||||
if (!$scheme || ($allowed_schemes && !in_array($scheme, $allowed_schemes))) {
|
||||
throw $this->getErrorFor(_t(
|
||||
"HtmlEditorField_Toolbar.ERROR_SCHEME",
|
||||
"HTMLEditorField_Toolbar.ERROR_SCHEME",
|
||||
"This file scheme is not included in the whitelist"
|
||||
));
|
||||
}
|
||||
@ -470,7 +470,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$allowed_domains = self::config()->fileurl_domain_whitelist;
|
||||
if (!$domain || ($allowed_domains && !in_array($domain, $allowed_domains))) {
|
||||
throw $this->getErrorFor(_t(
|
||||
"HtmlEditorField_Toolbar.ERROR_HOSTNAME",
|
||||
"HTMLEditorField_Toolbar.ERROR_HOSTNAME",
|
||||
"This file hostname is not included in the whitelist"
|
||||
));
|
||||
}
|
||||
@ -510,7 +510,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
} else {
|
||||
// Or we could have been passed nothing, in which case panic
|
||||
throw $this->getErrorFor(_t(
|
||||
"HtmlEditorField_Toolbar.ERROR_ID",
|
||||
"HTMLEditorField_Toolbar.ERROR_ID",
|
||||
'Need either "ID" or "FileURL" parameter to identify the file'
|
||||
));
|
||||
}
|
||||
@ -518,7 +518,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
// Validate file exists
|
||||
if(!$url) {
|
||||
throw $this->getErrorFor(_t(
|
||||
"HtmlEditorField_Toolbar.ERROR_NOTFOUND",
|
||||
"HTMLEditorField_Toolbar.ERROR_NOTFOUND",
|
||||
'Unable to find file to view'
|
||||
));
|
||||
}
|
||||
@ -530,23 +530,23 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
switch($fileCategory) {
|
||||
case 'image':
|
||||
case 'image/supported':
|
||||
$fileWrapper = new HtmlEditorField_Image($url, $file);
|
||||
$fileWrapper = new HTMLEditorField_Image($url, $file);
|
||||
break;
|
||||
case 'flash':
|
||||
$fileWrapper = new HtmlEditorField_Flash($url, $file);
|
||||
$fileWrapper = new HTMLEditorField_Flash($url, $file);
|
||||
break;
|
||||
default:
|
||||
// Only remote files can be linked via o-embed
|
||||
// {@see HtmlEditorField_Toolbar::getAllowedExtensions())
|
||||
// {@see HTMLEditorField_Toolbar::getAllowedExtensions())
|
||||
if($file) {
|
||||
throw $this->getErrorFor(_t(
|
||||
"HtmlEditorField_Toolbar.ERROR_OEMBED_REMOTE",
|
||||
"HTMLEditorField_Toolbar.ERROR_OEMBED_REMOTE",
|
||||
"Oembed is only compatible with remote files"
|
||||
));
|
||||
}
|
||||
|
||||
// Other files should fallback to oembed
|
||||
$fileWrapper = new HtmlEditorField_Embed($url, $file);
|
||||
$fileWrapper = new HTMLEditorField_Embed($url, $file);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -588,14 +588,14 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
if (!$page->canView()) {
|
||||
throw new SS_HTTPResponse_Exception(
|
||||
_t(
|
||||
'HtmlEditorField.ANCHORSCANNOTACCESSPAGE',
|
||||
'HTMLEditorField.ANCHORSCANNOTACCESSPAGE',
|
||||
'You are not permitted to access the content of the target page.'
|
||||
),
|
||||
403
|
||||
);
|
||||
}
|
||||
|
||||
// Similar to the regex found in HtmlEditorField.js / getAnchors method.
|
||||
// Similar to the regex found in HTMLEditorField.js / getAnchors method.
|
||||
if (preg_match_all(
|
||||
"/\\s+(name|id)\\s*=\\s*([\"'])([^\\2\\s>]*?)\\2|\\s+(name|id)\\s*=\\s*([^\"']+)[\\s +>]/im",
|
||||
$page->Content,
|
||||
@ -608,7 +608,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
|
||||
} else {
|
||||
throw new SS_HTTPResponse_Exception(
|
||||
_t('HtmlEditorField.ANCHORSPAGENOTFOUND', 'Target page not found.'),
|
||||
_t('HTMLEditorField.ANCHORSPAGENOTFOUND', 'Target page not found.'),
|
||||
404
|
||||
);
|
||||
}
|
||||
@ -622,10 +622,10 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
* not the "master record" in the database - hence there's no form or saving logic.
|
||||
*
|
||||
* @param string $url Abolute URL to asset
|
||||
* @param HtmlEditorField_File $file Asset wrapper
|
||||
* @param HTMLEditorField_File $file Asset wrapper
|
||||
* @return FieldList
|
||||
*/
|
||||
protected function getFieldsForFile($url, HtmlEditorField_File $file) {
|
||||
protected function getFieldsForFile($url, HTMLEditorField_File $file) {
|
||||
$fields = $this->extend('getFieldsForFile', $url, $file);
|
||||
if(!$fields) {
|
||||
$fields = $file->getFields();
|
||||
@ -677,7 +677,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
abstract class HtmlEditorField_File extends ViewableData {
|
||||
abstract class HTMLEditorField_File extends ViewableData {
|
||||
|
||||
/**
|
||||
* Default insertion width for Images and Media
|
||||
@ -758,26 +758,26 @@ abstract class HtmlEditorField_File extends ViewableData {
|
||||
)
|
||||
->setName("FilePreview")
|
||||
->addExtraClass('cms-file-info'),
|
||||
TextField::create('CaptionText', _t('HtmlEditorField.CAPTIONTEXT', 'Caption text')),
|
||||
TextField::create('CaptionText', _t('HTMLEditorField.CAPTIONTEXT', 'Caption text')),
|
||||
DropdownField::create(
|
||||
'CSSClass',
|
||||
_t('HtmlEditorField.CSSCLASS', 'Alignment / style'),
|
||||
_t('HTMLEditorField.CSSCLASS', 'Alignment / style'),
|
||||
array(
|
||||
'leftAlone' => _t('HtmlEditorField.CSSCLASSLEFTALONE', 'On the left, on its own.'),
|
||||
'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.')
|
||||
'leftAlone' => _t('HTMLEditorField.CSSCLASSLEFTALONE', 'On the left, on its own.'),
|
||||
'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.')
|
||||
)
|
||||
),
|
||||
FieldGroup::create(_t('HtmlEditorField.IMAGEDIMENSIONS', 'Dimensions'),
|
||||
FieldGroup::create(_t('HTMLEditorField.IMAGEDIMENSIONS', 'Dimensions'),
|
||||
TextField::create(
|
||||
'Width',
|
||||
_t('HtmlEditorField.IMAGEWIDTHPX', 'Width'),
|
||||
_t('HTMLEditorField.IMAGEWIDTHPX', 'Width'),
|
||||
$this->getInsertWidth()
|
||||
)->setMaxLength(5),
|
||||
TextField::create(
|
||||
'Height',
|
||||
" x " . _t('HtmlEditorField.IMAGEHEIGHTPX', 'Height'),
|
||||
" x " . _t('HTMLEditorField.IMAGEHEIGHTPX', 'Height'),
|
||||
$this->getInsertHeight()
|
||||
)->setMaxLength(5)
|
||||
)->addExtraClass('dimensions last'),
|
||||
@ -1037,7 +1037,7 @@ abstract class HtmlEditorField_File extends ViewableData {
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_Embed extends HtmlEditorField_File {
|
||||
class HTMLEditorField_Embed extends HTMLEditorField_File {
|
||||
|
||||
private static $casting = array(
|
||||
'Type' => 'Varchar',
|
||||
@ -1059,7 +1059,7 @@ class HtmlEditorField_Embed extends HtmlEditorField_File {
|
||||
$response = $controller->getResponse();
|
||||
$response->addHeader('X-Status',
|
||||
rawurlencode(_t(
|
||||
'HtmlEditorField.URLNOTANOEMBEDRESOURCE',
|
||||
'HTMLEditorField.URLNOTANOEMBEDRESOURCE',
|
||||
"The URL '{url}' could not be turned into a media resource.",
|
||||
"The given URL is not a valid Oembed resource; the embed element couldn't be created.",
|
||||
array('url' => $url)
|
||||
@ -1080,13 +1080,13 @@ class HtmlEditorField_Embed extends HtmlEditorField_File {
|
||||
if($this->Type === 'photo') {
|
||||
$fields->insertBefore('CaptionText', new TextField(
|
||||
'AltText',
|
||||
_t('HtmlEditorField.IMAGEALTTEXT', 'Alternative text (alt) - shown if image can\'t be displayed'),
|
||||
_t('HTMLEditorField.IMAGEALTTEXT', 'Alternative text (alt) - shown if image can\'t be displayed'),
|
||||
$this->Title,
|
||||
80
|
||||
));
|
||||
$fields->insertBefore('CaptionText', new TextField(
|
||||
'Title',
|
||||
_t('HtmlEditorField.IMAGETITLE', 'Title text (tooltip) - for additional information about the image')
|
||||
_t('HTMLEditorField.IMAGETITLE', 'Title text (tooltip) - for additional information about the image')
|
||||
));
|
||||
}
|
||||
return $fields;
|
||||
@ -1174,7 +1174,7 @@ class HtmlEditorField_Embed extends HtmlEditorField_File {
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_Image extends HtmlEditorField_File {
|
||||
class HTMLEditorField_Image extends HTMLEditorField_File {
|
||||
|
||||
/**
|
||||
* @var int
|
||||
@ -1222,11 +1222,11 @@ class HtmlEditorField_Image extends HtmlEditorField_File {
|
||||
'CaptionText',
|
||||
TextField::create(
|
||||
'AltText',
|
||||
_t('HtmlEditorField.IMAGEALT', 'Alternative text (alt)'),
|
||||
_t('HTMLEditorField.IMAGEALT', 'Alternative text (alt)'),
|
||||
$this->Title,
|
||||
80
|
||||
)->setDescription(
|
||||
_t('HtmlEditorField.IMAGEALTTEXTDESC', 'Shown to screen readers or if image can\'t be displayed')
|
||||
_t('HTMLEditorField.IMAGEALTTEXTDESC', 'Shown to screen readers or if image can\'t be displayed')
|
||||
)
|
||||
);
|
||||
|
||||
@ -1235,9 +1235,9 @@ class HtmlEditorField_Image extends HtmlEditorField_File {
|
||||
'AltText',
|
||||
TextField::create(
|
||||
'Title',
|
||||
_t('HtmlEditorField.IMAGETITLETEXT', 'Title text (tooltip)')
|
||||
_t('HTMLEditorField.IMAGETITLETEXT', 'Title text (tooltip)')
|
||||
)->setDescription(
|
||||
_t('HtmlEditorField.IMAGETITLETEXTDESC', 'For additional information about the image')
|
||||
_t('HTMLEditorField.IMAGETITLETEXTDESC', 'For additional information about the image')
|
||||
)
|
||||
);
|
||||
|
||||
@ -1366,7 +1366,7 @@ class HtmlEditorField_Image extends HtmlEditorField_File {
|
||||
/**
|
||||
* Generate flash file embed
|
||||
*/
|
||||
class HtmlEditorField_Flash extends HtmlEditorField_File {
|
||||
class HTMLEditorField_Flash extends HTMLEditorField_File {
|
||||
|
||||
public function getFields() {
|
||||
$fields = parent::getFields();
|
@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Default configuration for HtmlEditor specific to tinymce
|
||||
*/
|
||||
class TinyMCEConfig extends HtmlEditorConfig {
|
||||
class TinyMCEConfig extends HTMLEditorConfig {
|
||||
|
||||
/**
|
||||
* Location of module relative to BASE_DIR. This must contain the following dirs
|
||||
@ -440,7 +440,7 @@ class TinyMCEConfig extends HtmlEditorConfig {
|
||||
*/
|
||||
public function getScriptURL() {
|
||||
// If gzip is disabled just return core script url
|
||||
$useGzip = Config::inst()->get('HtmlEditorField', 'use_gzip');
|
||||
$useGzip = Config::inst()->get('HTMLEditorField', 'use_gzip');
|
||||
if(!$useGzip) {
|
||||
return THIRDPARTY_DIR . '/tinymce/tinymce.min.js';
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ af:
|
||||
Help1: '<p> Voer een of meer groepe in <em>CSV</em>formaat (komma geskeide waardes).<small> <a href="#" class="toggle-advanced">Wys gevorderde gebruike</a></small></p>'
|
||||
ResultDeleted: 'Verwyderde %d groepe'
|
||||
ResultUpdated: '%d Groepe was opgedateer'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Voeg URL by'
|
||||
ANCHORVALUE: Anker
|
||||
BUTTONINSERT: Plaas in
|
||||
|
@ -237,7 +237,7 @@ ar:
|
||||
ResultUpdated: 'تحديث مجموعات %d '
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'العثور على حلقة لا نهائية ضمن "{نوع}" التسلسل الهرمي . الرجاء تغيير الأصل لحل هذه'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'أضف رابط الموقع URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'التفاصيل & و الأبعاد'
|
||||
ANCHORVALUE: رابط
|
||||
|
@ -84,7 +84,7 @@ az:
|
||||
Sort: 'Sıralama'
|
||||
has_many_Permissions: Səlahiyyətlər
|
||||
many_many_Members: Üzvlər
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Ankor
|
||||
BUTTONINSERTLINK: 'Link əlavə et'
|
||||
BUTTONREMOVELINK: 'Linki sil'
|
||||
|
@ -167,7 +167,7 @@ bg:
|
||||
ResultCreated: 'Бяха създадени {count} група/и'
|
||||
ResultDeleted: 'Бяха изтрити %d групи'
|
||||
ResultUpdated: 'Бяха обновени %d групи'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Добави URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Детайли и размери'
|
||||
ANCHORVALUE: Котва
|
||||
|
@ -80,7 +80,7 @@ bs:
|
||||
NONE: ništa
|
||||
GridFieldDetailForm:
|
||||
Create: Kreiraj
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Sidro
|
||||
BUTTONINSERTLINK: 'Ubaci link'
|
||||
BUTTONREMOVELINK: 'Ukloni link'
|
||||
|
@ -91,7 +91,7 @@ ca:
|
||||
Sort: 'Ordre'
|
||||
has_many_Permissions: Permisos
|
||||
many_many_Members: Membres
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Ancla
|
||||
BUTTONINSERTLINK: 'Insereix un enllaç'
|
||||
BUTTONREMOVELINK: 'Suprimeix un enllaç'
|
||||
|
@ -275,7 +275,7 @@ cs:
|
||||
ResultUpdated: 'Aktualizováno %d skupin'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Nekonečná smyčka se nachází v "{type}" hierarchii. Prosím změňte rodiče pro vyřešení tohoto problému'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Přidat URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detaily & rozměry'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Nemáte povolen přístup k obsahu cílové stránky.'
|
||||
|
@ -274,7 +274,7 @@ de:
|
||||
ResultUpdated: '%d Gruppe(n) aktualisiert'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Es wurde eine Endlosschleife innerhalb der "{type}"-Hierarchie gefunden. Bitte ändern Sie die übergeordnete Seite, um den Fehler zu beheben'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'URL hinzufügen'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Details & Dimensionen'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Sie haben keine Berechtigungen, den Inhalt dieser Seite zu sehen.'
|
||||
|
@ -278,7 +278,7 @@ en:
|
||||
ResultUpdated: 'Updated %d groups'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Infinite loop found within the "{type}" hierarchy. Please change the parent to resolve this'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Add URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Details & dimensions'
|
||||
ANCHORSCANNOTACCESSPAGE: 'You are not permitted to access the content of the target page.'
|
||||
|
@ -11,7 +11,7 @@ en_GB:
|
||||
NOFILESIZE: 'File size is zero bytes.'
|
||||
ForgotPasswordEmail_ss:
|
||||
HELLO: Hello
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
CSSCLASSCENTER: 'Centred, on its own.'
|
||||
LINK: 'Link'
|
||||
LeftAndMain:
|
||||
|
@ -267,7 +267,7 @@ eo:
|
||||
ResultUpdated: 'Aktualigis %d grupojn'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Senfina iteracio troviĝis en la "{type}"-hierarkio. Bonvole ŝanĝu la patron por solvi tion.'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Aldoni je URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detaloj kaj dimensioj'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Vi ne rajtas aliri la enhavon de la cela paĝo.'
|
||||
|
@ -275,7 +275,7 @@ es:
|
||||
ResultUpdated: 'Actualizados grupos %d'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Bucle infinito encontrado dentro de la jerarquía "{type}". Por favor, cambie el padre para resolver el problema'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Añadir URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detalles & dimensiones'
|
||||
ANCHORSCANNOTACCESSPAGE: 'No se le permite acceder al contenido de la página destino.'
|
||||
|
@ -102,7 +102,7 @@ es_AR:
|
||||
Help1: '<p>Importar uno o más grupos en <em>formato CSV</em> (valores separados por comas). <small><a href="#" class="toggle-advanced">Mostrar uso avanzado</a></small></p>'
|
||||
ResultDeleted: 'Se eliminaron %d grupos'
|
||||
ResultUpdated: 'Se actualizaron %d grupos'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Anclar
|
||||
BUTTONINSERTLINK: 'Insertar enlace'
|
||||
BUTTONREMOVELINK: 'Quitar enlace'
|
||||
|
@ -147,7 +147,7 @@ es_MX:
|
||||
Help1: '<p>Importar usuarios en <em>formato CSV</em> (valores separados por comas). <small><a href="#" class="toggle-advanced">Mostrar uso avanzado</a></small></p>\n'
|
||||
ResultDeleted: '%d grupos eliminados'
|
||||
ResultUpdated: '%d grupos actualizados'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Anclar
|
||||
BUTTONINSERT: Insertar
|
||||
BUTTONINSERTLINK: 'Insertar enlace'
|
||||
|
@ -224,7 +224,7 @@ et_EE:
|
||||
ResultCreated: '{count} gruppi on loodud'
|
||||
ResultDeleted: '%d gruppi on kustutatud'
|
||||
ResultUpdated: '%d gruppi on uuendatud'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Lisa URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Üksikasjad ja mõõtmed'
|
||||
ANCHORVALUE: Link
|
||||
|
@ -272,7 +272,7 @@ fa_IR:
|
||||
ResultCreated: '{count} گروه ایجاد شده'
|
||||
ResultDeleted: 'گروههای %d حذف شد'
|
||||
ResultUpdated: 'گروههای %d بهروز شد'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'افزودن URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'جزئیات و ابعاد'
|
||||
ANCHORSCANNOTACCESSPAGE: 'شما مجاز به دسترسی به محتوای صفحه مورد نظر نیستید.'
|
||||
|
@ -275,7 +275,7 @@ fi:
|
||||
ResultUpdated: 'Päivitetty %d ryhmää'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: '"{type}" -hierarkiasta löytyi loputon silmukka. Ole hyvä ja muuta isäntää korjataksesi ongelman.'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Lisää URL-osoite'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Tarkat tiedot & mitat'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Sinulla ei ole oikeuksia tarkastella tämän sivun sisältöä.'
|
||||
|
@ -67,7 +67,7 @@ fo:
|
||||
Sort: 'Raða eftir'
|
||||
has_many_Permissions: Loyvir
|
||||
many_many_Members: Limir
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'Stovna leinku'
|
||||
BUTTONREMOVELINK: 'Strika leinku'
|
||||
CSSCLASSCENTER: 'Í miðuni, einsamalt.'
|
||||
|
@ -238,7 +238,7 @@ fr:
|
||||
ResultUpdated: '%d groupes mises à jour'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Une boucle infinie s’est produite dans la hiérarchie « {type} ». Modifiez le parent pour le résoudre.'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Ajouter URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Détails & dimensions'
|
||||
ANCHORVALUE: Ancre
|
||||
|
@ -122,7 +122,7 @@ gl_ES:
|
||||
Help1: '<p>Importar un ou máis grupos no formato <em>CSV</em> (valores separados por comas). <small><a href="#" class="toggle-advanced">Amosar uso avanzado</a></small></p>'
|
||||
ResultDeleted: 'Eliminados %d grupos'
|
||||
ResultUpdated: 'Actualizados %d grupos'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Áncora
|
||||
BUTTONINSERT: Inserir
|
||||
BUTTONINSERTLINK: 'Inserir ligazón'
|
||||
|
@ -44,7 +44,7 @@ he_IL:
|
||||
Parent: 'קבוצת אב'
|
||||
has_many_Permissions: הרשאות
|
||||
many_many_Members: חברים רשומים
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'הכנס קישור'
|
||||
BUTTONREMOVELINK: 'הסר קישור'
|
||||
CSSCLASS: 'יישור/סגנון'
|
||||
|
@ -88,7 +88,7 @@ hr:
|
||||
Parent: 'Roditeljska grupa'
|
||||
has_many_Permissions: Dozvole
|
||||
many_many_Members: Članovi
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'Ubaci vezu'
|
||||
BUTTONREMOVELINK: 'Obriši vezu'
|
||||
CSSCLASS: 'Poravnanje / Stil'
|
||||
|
@ -41,7 +41,7 @@ hu:
|
||||
Parent: 'Szülő csoport'
|
||||
has_many_Permissions: Jogosultságok
|
||||
many_many_Members: Tagok
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'Link beszúrása'
|
||||
BUTTONREMOVELINK: 'Link eltávolítása'
|
||||
CSSCLASS: 'Elhelyezkedés / stílus'
|
||||
|
@ -263,7 +263,7 @@ id:
|
||||
ResultUpdated: '%d kelompok diperbarui'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Putaran berulang ditemukan pada hirarki "{type}". Mohon ganti induk untuk mengatasi masalah ini'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Tambah URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Rincian & dimensi'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Anda tidak dijinkan mengakses konten laman yang diminta.'
|
||||
|
@ -263,7 +263,7 @@ id_ID:
|
||||
ResultUpdated: '%d kelompok diperbarui'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Putaran berulang ditemukan pada hirarki "{type}". Mohon ganti induk untuk mengatasi masalah ini'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Tambah URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Rincian & dimensi'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Anda tidak dijinkan mengakses konten laman yang diminta.'
|
||||
|
@ -84,7 +84,7 @@ is:
|
||||
Sort: 'Röðun'
|
||||
has_many_Permissions: Leyfi
|
||||
many_many_Members: Félagar
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Markstikla
|
||||
BUTTONINSERTLINK: 'Bæta við hlekk'
|
||||
BUTTONREMOVELINK: 'Fjarlægja hlekk'
|
||||
|
@ -273,7 +273,7 @@ it:
|
||||
ResultUpdated: 'Aggiornati %d gruppi'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Trovato loop infinito nella gerarchia di "{type}". Cambia il padre per risolvere il problema'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Aggiungi URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Dettagli e dimensioni'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Non ti è consentito accedere al contenuto della pagina di destinazione.'
|
||||
|
@ -236,7 +236,7 @@ ja:
|
||||
ResultUpdated: '%dグループを更新しました'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: '無限ループが"{型}"階層内で見つかりました。 これを解決するために親を変更してください。'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'URLを追加'
|
||||
ADJUSTDETAILSDIMENSIONS: '詳細 & 大きさ'
|
||||
ANCHORVALUE: アンカー
|
||||
|
@ -275,7 +275,7 @@ lt:
|
||||
ResultUpdated: 'Atnaujinta %d grupių'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Rastas begalinis sąryšis "{type}" hierarchijoje. Prašome patikrinti tėvinius sąryšius'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Pridėti URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detalesnė inf. ir matmenys'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Neturite teisių pasiekti pasirinkto puslapio turinį.'
|
||||
|
@ -88,7 +88,7 @@ lv:
|
||||
Sort: 'Kārtošanas secība'
|
||||
has_many_Permissions: Atļaujas
|
||||
many_many_Members: Dalībnieki
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Enkurs
|
||||
BUTTONINSERTLINK: 'Ievietot saiti'
|
||||
BUTTONREMOVELINK: 'Noņemt saiti'
|
||||
|
@ -238,7 +238,7 @@ mi:
|
||||
ResultUpdated: 'Kua whakahōutia e %d ngā rōpū'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Kua kitea he koromeke mutunga kore i roto i te aroākapanga "{type}". Hurihia te matua hei whakaea i tēnei'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Tāpiri PRO'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Ngā taipitopito & ngā rahinga'
|
||||
ANCHORVALUE: Punga
|
||||
|
@ -40,7 +40,7 @@ ms:
|
||||
Parent: 'Kumpulan Induk'
|
||||
has_many_Permissions: Keizinan
|
||||
many_many_Members: Ahli-ahli
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'Masukkan pautan'
|
||||
BUTTONREMOVELINK: 'Hapuskan pautan'
|
||||
CSSCLASS: 'Penjajaran / gaya'
|
||||
|
@ -239,7 +239,7 @@ nb:
|
||||
ResultUpdated: 'Oppdaterte %d grupper'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Uendelig løkke ble funnet i hierarkiet til "{type}". Vennligst skift ut overordnet type for å løse dette.'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Legg til nettadresse'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detaljer og dimensjoner'
|
||||
ANCHORVALUE: Lenke
|
||||
|
@ -15,7 +15,7 @@ ne:
|
||||
VALIDATIONNOTUNIQUE: 'लेखिएको मान भिन्न छैन '
|
||||
VALIDATIONPASSWORDSDONTMATCH: 'पासओडहरु मिल्दैन्नन'
|
||||
VALIDATIONPASSWORDSNOTEMPTY: 'पासओडहरु खालि छोड्न मिल्दैन'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'लिन्क राखनुहोस्'
|
||||
BUTTONREMOVELINK: 'लिन्क हटाउनुहोस्'
|
||||
CSSCLASS: 'समरेखिन / स्टाईल'
|
||||
|
@ -240,7 +240,7 @@ nl:
|
||||
ResultUpdated: '%d groepen aangepast'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Oneindige lus gevonden in "{type}" hiërarchie. Wijzig het hogere niveau om dit op te lossen'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Voeg URL toe'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Details en afmetingen'
|
||||
ANCHORVALUE: Anker
|
||||
|
@ -12,7 +12,7 @@ pa:
|
||||
Form:
|
||||
VALIDATIONPASSWORDSDONTMATCH: 'Passwords ਮੇਲ ਨਹੀ ਖਾਦੇ '
|
||||
VALIDATIONPASSWORDSNOTEMPTY: 'Passwords ਖ਼ਾਲੀ ਨਹੀ ਹੋ ਸਕਦੇ '
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'ਿਲੰਕ ਪਾਉ'
|
||||
BUTTONREMOVELINK: 'ਿਲੰਕ ਕੱਟੋਂ'
|
||||
EMAIL: 'ਈਮੇਲ ਪਤਾ'
|
||||
|
@ -239,7 +239,7 @@ pl:
|
||||
ResultUpdated: 'Zaktualizowano grup: %d'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Znaleziono nieskończoną pętlę wewnątrz hierarchii "{type}". Proszę zmień rodzica by to rozwiązać.'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Dodaj adres URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Szczegóły i rozmiar'
|
||||
ANCHORVALUE: Odnośnik
|
||||
|
@ -110,7 +110,7 @@ pt:
|
||||
many_many_Members: Membros
|
||||
GroupImportForm:
|
||||
ResultDeleted: 'Apagados %d grupos'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Âncora
|
||||
BUTTONINSERT: Inserir
|
||||
BUTTONINSERTLINK: 'Inserir link'
|
||||
|
@ -90,7 +90,7 @@ pt_BR:
|
||||
Sort: 'Ordenação'
|
||||
has_many_Permissions: Permissões
|
||||
many_many_Members: Membros
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Âncora
|
||||
BUTTONINSERTLINK: 'Inserir link'
|
||||
BUTTONREMOVELINK: 'Remover link'
|
||||
|
@ -84,7 +84,7 @@ ro:
|
||||
Parent: 'Grup de Baza'
|
||||
has_many_Permissions: Permisiuni
|
||||
many_many_Members: Membri
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'Insereaza link'
|
||||
BUTTONREMOVELINK: 'Indeparteaza link'
|
||||
CSSCLASS: 'Aliniere / stil'
|
||||
|
@ -239,7 +239,7 @@ ru:
|
||||
ResultUpdated: 'Обновлено %d групп'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Обнаружен бесконечный цикл в иерархической структуре "{type}". Для исправления ошибки измените страницу, находящуюся уровнем выше'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Добавить URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Дополнительные сведения и размеры'
|
||||
ANCHORVALUE: Якорь
|
||||
|
@ -53,7 +53,7 @@ si:
|
||||
Parent: 'මවු කාන්ඩය'
|
||||
has_many_Permissions: අවසර
|
||||
many_many_Members: සාමාජිකයින්
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: 'බැදීමක් යොදන්න'
|
||||
BUTTONREMOVELINK: 'බැදීම ගලවන්න'
|
||||
CSSCLASS: 'අලයින්මන්ට් / ස්ටයිල්'
|
||||
|
@ -275,7 +275,7 @@ sk:
|
||||
ResultUpdated: 'Aktualizované %d skupiny'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Nekonečná smyčka sa nachádza v {type} hierarchii. Prosím zmeňte rodiča pre vyriešenie tohto problému'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Pridať URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detaily & rozmery'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Nemáte povolený prístup k obsahu cieľovej stránky.'
|
||||
|
@ -230,7 +230,7 @@ sl:
|
||||
ResultCreated: 'Ustvarjenih je {count} skupin'
|
||||
ResultDeleted: 'Število izbrisanih skupin %d'
|
||||
ResultUpdated: 'Število ponastavljenih skupin %d'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Dodaj URL'
|
||||
ANCHORVALUE: Sidro
|
||||
BUTTONADDURL: 'Dodaj url'
|
||||
|
@ -239,7 +239,7 @@ sr:
|
||||
ResultUpdated: 'Ажурирано %d група'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Откривена је бесконачна петља у оквиру "{type}" хијерархије. Промените родитеља да би сте разрешили ситуацију'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Додај URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Детаљи & димензије'
|
||||
ANCHORVALUE: Сидро
|
||||
|
@ -239,7 +239,7 @@ sr@latin:
|
||||
ResultUpdated: 'Ažurirano %d grupa'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Otkrivena je beskonačna petlja u okviru "{type}" hijerarhije. Promenite roditelja da bi ste razrešili situaciju'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Dodaj URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detalji & dimenzije'
|
||||
ANCHORVALUE: Sidro
|
||||
|
@ -239,7 +239,7 @@ sr_RS:
|
||||
ResultUpdated: 'Ажурирано %d група'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Откривена је бесконачна петља у оквиру "{type}" хијерархије. Промените родитеља да би сте разрешили ситуацију'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Додај URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Детаљи & димензије'
|
||||
ANCHORVALUE: Сидро
|
||||
|
@ -239,7 +239,7 @@ sr_RS@latin:
|
||||
ResultUpdated: 'Ažurirano %d grupa'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Otkrivena je beskonačna petlja u okviru "{type}" hijerarhije. Promenite roditelja da bi ste razrešili situaciju'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Dodaj URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detalji & dimenzije'
|
||||
ANCHORVALUE: Sidro
|
||||
|
@ -267,7 +267,7 @@ sv:
|
||||
ResultUpdated: 'Uppdaterade %d grupper'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: 'Oändlig loop hittades i hierarkin "{type}". Var vänlig ändra föräldern för att lösa detta'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'Lägg till URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'Detaljer & dimensioner'
|
||||
ANCHORSCANNOTACCESSPAGE: 'Du har inte tillåtelse att se innehållet på sidan'
|
||||
|
@ -161,7 +161,7 @@ th:
|
||||
ResultCreated: 'สร้างกลุ่มแล้ว {count} กลุ่ม'
|
||||
ResultDeleted: 'ลบกลุ่มแล้ว %d กลุ่ม'
|
||||
ResultUpdated: 'อัพเดทแล้ว %d กลุ่ม'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: 'เพิ่ม URL'
|
||||
ADJUSTDETAILSDIMENSIONS: 'รายละเอียด & ขนาดสัดส่วน'
|
||||
BUTTONINSERT: แทรก
|
||||
|
@ -109,7 +109,7 @@ tr:
|
||||
Sort: 'Sırala'
|
||||
has_many_Permissions: İzinler
|
||||
many_many_Members: Üyeler
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Çapa
|
||||
BUTTONINSERTLINK: 'Bağlantı ekle'
|
||||
BUTTONREMOVELINK: 'Bağlantıyı sil'
|
||||
|
@ -101,7 +101,7 @@ uk:
|
||||
RolesAddEditLink: 'Керувати ролями'
|
||||
has_many_Permissions: Права
|
||||
many_many_Members: Члени
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ANCHORVALUE: Якір
|
||||
BUTTONINSERTLINK: 'Вставити посилання'
|
||||
BUTTONREMOVELINK: 'Вмдалити посилання'
|
||||
|
@ -262,7 +262,7 @@ zh:
|
||||
ResultUpdated: '已更新 %d 小组'
|
||||
Hierarchy:
|
||||
InfiniteLoopNotAllowed: '"{type}" 层次结构中发现无限循环。请更改父类型来解决此问题'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
ADDURL: '添加网址'
|
||||
ADJUSTDETAILSDIMENSIONS: '详情 &amp; 体积'
|
||||
ANCHORSCANNOTACCESSPAGE: '您不允许访问该页面的内容。'
|
||||
|
@ -42,7 +42,7 @@ zh_CN:
|
||||
Parent: '主团队'
|
||||
has_many_Permissions: 权限
|
||||
many_many_Members: 成员
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: '插入链接'
|
||||
BUTTONREMOVELINK: '删除链接'
|
||||
CSSCLASS: '对齐/样式'
|
||||
|
@ -28,7 +28,7 @@ zh_TW:
|
||||
VALIDATIONNOTUNIQUE: '您輸入的數值並不是獨特的。'
|
||||
VALIDATIONPASSWORDSDONTMATCH: '密碼不相配'
|
||||
VALIDATIONPASSWORDSNOTEMPTY: '密碼不能是空的'
|
||||
HtmlEditorField:
|
||||
HTMLEditorField:
|
||||
BUTTONINSERTLINK: '插入連結'
|
||||
BUTTONREMOVELINK: '移除連結'
|
||||
CSSCLASS: '對齊/樣式'
|
||||
|
@ -6,7 +6,7 @@ use Injector;
|
||||
use HTTP;
|
||||
use ShortcodeParser;
|
||||
use DOMDocument;
|
||||
use HtmlEditorField;
|
||||
use HTMLEditorField;
|
||||
use TextField;
|
||||
use Exception;
|
||||
|
||||
@ -264,7 +264,7 @@ class DBHTMLText extends DBText {
|
||||
}
|
||||
|
||||
public function scaffoldFormField($title = null, $params = null) {
|
||||
return new HtmlEditorField($this->name, $title);
|
||||
return new HTMLEditorField($this->name, $title);
|
||||
}
|
||||
|
||||
public function scaffoldSearchField($title = null, $params = null) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace SilverStripe\Model\FieldType;
|
||||
|
||||
use ShortcodeParser;
|
||||
use HtmlEditorField;
|
||||
use HTMLEditorField;
|
||||
use TextField;
|
||||
|
||||
/**
|
||||
@ -41,7 +41,7 @@ class DBHTMLVarchar extends DBVarchar {
|
||||
}
|
||||
|
||||
public function scaffoldFormField($title = null, $params = null) {
|
||||
return new HtmlEditorField($this->name, $title, 1);
|
||||
return new HTMLEditorField($this->name, $title, 1);
|
||||
}
|
||||
|
||||
public function scaffoldSearchField($title = null) {
|
||||
|
@ -141,7 +141,7 @@ class Group extends DataObject {
|
||||
|
||||
// Only add a dropdown for HTML editor configurations if more than one is available.
|
||||
// Otherwise Member->getHtmlEditorConfigForCMS() will default to the 'cms' configuration.
|
||||
$editorConfigMap = HtmlEditorConfig::get_available_configs_map();
|
||||
$editorConfigMap = HTMLEditorConfig::get_available_configs_map();
|
||||
if(count($editorConfigMap) > 1) {
|
||||
$fields->addFieldToTab('Root.Permissions',
|
||||
new DropdownField(
|
||||
|
@ -1647,7 +1647,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
||||
foreach($this->Groups() as $group) {
|
||||
$configName = $group->HtmlEditorConfig;
|
||||
if($configName) {
|
||||
$config = HtmlEditorConfig::get($group->HtmlEditorConfig);
|
||||
$config = HTMLEditorConfig::get($group->HtmlEditorConfig);
|
||||
if($config && $config->getOption('priority') > $currentPriority) {
|
||||
$currentName = $configName;
|
||||
$currentPriority = $config->getOption('priority');
|
||||
|
@ -89,7 +89,7 @@ class FormScaffolderTest extends SapphireTest {
|
||||
$article1 = $this->objFromFixture('FormScaffolderTest_Article', 'article1');
|
||||
|
||||
$fields = $article1->scaffoldFormFields(array(
|
||||
'fieldClasses' => array('Title' => 'HtmlEditorField')
|
||||
'fieldClasses' => array('Title' => 'HTMLEditorField')
|
||||
));
|
||||
$form = new Form(new Controller(), 'TestForm', $fields, new FieldList());
|
||||
$form->loadDataFrom($article1);
|
||||
@ -99,7 +99,7 @@ class FormScaffolderTest extends SapphireTest {
|
||||
);
|
||||
$this->assertEquals(
|
||||
get_class($fields->dataFieldByName('Title')),
|
||||
'HtmlEditorField',
|
||||
'HTMLEditorField',
|
||||
'getCMSFields() doesnt include fields left out in a "restrictFields" definition'
|
||||
);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @package framework
|
||||
* @subpackage tests
|
||||
*/
|
||||
class HtmlEditorConfigTest extends SapphireTest {
|
||||
class HTMLEditorConfigTest extends SapphireTest {
|
||||
|
||||
public function testEnablePluginsByString() {
|
||||
$c = new TinyMCEConfig();
|
||||
@ -75,14 +75,14 @@ class HtmlEditorConfigTest extends SapphireTest {
|
||||
$this->assertEquals(['plugin4', 'plugin5'], $c->getInternalPlugins());
|
||||
|
||||
// Test plugins included via gzip compresser
|
||||
Config::inst()->update('HtmlEditorField', 'use_gzip', true);
|
||||
Config::inst()->update('HTMLEditorField', 'use_gzip', true);
|
||||
$this->assertEquals(
|
||||
'framework/thirdparty/tinymce/tiny_mce_gzip.php?js=1&plugins=plugin4,plugin5&themes=modern&languages=es&diskcache=true&src=true',
|
||||
$c->getScriptURL()
|
||||
);
|
||||
|
||||
// If gzip is disabled only the core plugin is loaded
|
||||
Config::inst()->remove('HtmlEditorField', 'use_gzip');
|
||||
Config::inst()->remove('HTMLEditorField', 'use_gzip');
|
||||
$this->assertEquals(
|
||||
'framework/thirdparty/tinymce/tinymce.min.js',
|
||||
$c->getScriptURL()
|
||||
@ -122,8 +122,8 @@ class HtmlEditorConfigTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testRequireJSIncludesAllConfigs() {
|
||||
$a = HtmlEditorConfig::get('configA');
|
||||
$c = HtmlEditorConfig::get('configB');
|
||||
$a = HTMLEditorConfig::get('configA');
|
||||
$c = HTMLEditorConfig::get('configB');
|
||||
|
||||
$aAttributes = $a->getAttributes();
|
||||
$cAttributes = $c->getAttributes();
|
@ -6,23 +6,23 @@ use Filesystem as SS_Filesystem;
|
||||
* @package framework
|
||||
* @subpackage tests
|
||||
*/
|
||||
class HtmlEditorFieldTest extends FunctionalTest {
|
||||
class HTMLEditorFieldTest extends FunctionalTest {
|
||||
|
||||
protected static $fixture_file = 'HtmlEditorFieldTest.yml';
|
||||
protected static $fixture_file = 'HTMLEditorFieldTest.yml';
|
||||
|
||||
protected static $use_draft_site = true;
|
||||
|
||||
protected $requiredExtensions = array(
|
||||
'HtmlEditorField_Toolbar' => array('HtmlEditorFieldTest_DummyMediaFormFieldExtension')
|
||||
'HTMLEditorField_Toolbar' => array('HTMLEditorFieldTest_DummyMediaFormFieldExtension')
|
||||
);
|
||||
|
||||
protected $extraDataObjects = array('HtmlEditorFieldTest_Object');
|
||||
protected $extraDataObjects = array('HTMLEditorFieldTest_Object');
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Set backend root to /HtmlEditorFieldTest
|
||||
AssetStoreTest_SpyStore::activate('HtmlEditorFieldTest');
|
||||
// Set backend root to /HTMLEditorFieldTest
|
||||
AssetStoreTest_SpyStore::activate('HTMLEditorFieldTest');
|
||||
|
||||
// Create a test files for each of the fixture references
|
||||
$files = File::get()->exclude('ClassName', 'Folder');
|
||||
@ -40,8 +40,8 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
||||
}
|
||||
|
||||
public function testBasicSaving() {
|
||||
$obj = new HtmlEditorFieldTest_Object();
|
||||
$editor = new HtmlEditorField('Content');
|
||||
$obj = new HTMLEditorFieldTest_Object();
|
||||
$editor = new HTMLEditorField('Content');
|
||||
|
||||
$editor->setValue('<p class="foo">Simple Content</p>');
|
||||
$editor->saveInto($obj);
|
||||
@ -53,8 +53,8 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
||||
}
|
||||
|
||||
public function testNullSaving() {
|
||||
$obj = new HtmlEditorFieldTest_Object();
|
||||
$editor = new HtmlEditorField('Content');
|
||||
$obj = new HTMLEditorFieldTest_Object();
|
||||
$editor = new HTMLEditorField('Content');
|
||||
|
||||
$editor->setValue(null);
|
||||
$editor->saveInto($obj);
|
||||
@ -62,8 +62,8 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
||||
}
|
||||
|
||||
public function testResizedImageInsertion() {
|
||||
$obj = new HtmlEditorFieldTest_Object();
|
||||
$editor = new HtmlEditorField('Content');
|
||||
$obj = new HTMLEditorFieldTest_Object();
|
||||
$editor = new HTMLEditorField('Content');
|
||||
|
||||
$fileID = $this->idFromFixture('Image', 'example_image');
|
||||
$editor->setValue(sprintf(
|
||||
@ -84,7 +84,7 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
||||
$this->assertEquals(20, (int)$xml[0]['height'], 'Height tag of resized image is set.');
|
||||
|
||||
$neededFilename
|
||||
= '/assets/HtmlEditorFieldTest/f5c7c2f814/HTMLEditorFieldTest-example__ResizedImageWyIxMCIsIjIwIl0.jpg';
|
||||
= '/assets/HTMLEditorFieldTest/f5c7c2f814/HTMLEditorFieldTest-example__ResizedImageWyIxMCIsIjIwIl0.jpg';
|
||||
|
||||
$this->assertEquals($neededFilename, (string)$xml[0]['src'], 'Correct URL of resized image is set.');
|
||||
$this->assertTrue(file_exists(BASE_PATH.DIRECTORY_SEPARATOR.$neededFilename), 'File for resized image exists');
|
||||
@ -92,16 +92,16 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
||||
}
|
||||
|
||||
public function testMultiLineSaving() {
|
||||
$obj = $this->objFromFixture('HtmlEditorFieldTest_Object', 'home');
|
||||
$editor = new HtmlEditorField('Content');
|
||||
$obj = $this->objFromFixture('HTMLEditorFieldTest_Object', 'home');
|
||||
$editor = new HTMLEditorField('Content');
|
||||
$editor->setValue('<p>First Paragraph</p><p>Second Paragraph</p>');
|
||||
$editor->saveInto($obj);
|
||||
$this->assertEquals('<p>First Paragraph</p><p>Second Paragraph</p>', $obj->Content);
|
||||
}
|
||||
|
||||
public function testSavingLinksWithoutHref() {
|
||||
$obj = $this->objFromFixture('HtmlEditorFieldTest_Object', 'home');
|
||||
$editor = new HtmlEditorField('Content');
|
||||
$obj = $this->objFromFixture('HTMLEditorFieldTest_Object', 'home');
|
||||
$editor = new HTMLEditorField('Content');
|
||||
|
||||
$editor->setValue('<p><a name="example-anchor"></a></p>');
|
||||
$editor->saveInto($obj);
|
||||
@ -140,24 +140,24 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
||||
'PageID' => $page->ID,
|
||||
));
|
||||
|
||||
$toolBar = new HtmlEditorField_Toolbar(new Controller(), 'test');
|
||||
$toolBar = new HTMLEditorField_Toolbar(new Controller(), 'test');
|
||||
$toolBar->setRequest($request);
|
||||
|
||||
$results = json_decode($toolBar->getanchors(), true);
|
||||
$this->assertEquals($expected, $results);
|
||||
}
|
||||
|
||||
public function testHtmlEditorFieldFileLocal() {
|
||||
$file = new HtmlEditorField_Image('http://domain.com/folder/my_image.jpg?foo=bar');
|
||||
public function testHTMLEditorFieldFileLocal() {
|
||||
$file = new HTMLEditorField_Image('http://domain.com/folder/my_image.jpg?foo=bar');
|
||||
$this->assertEquals('http://domain.com/folder/my_image.jpg?foo=bar', $file->URL);
|
||||
$this->assertEquals('my_image.jpg', $file->Name);
|
||||
$this->assertEquals('jpg', $file->Extension);
|
||||
// TODO Can't easily test remote file dimensions
|
||||
}
|
||||
|
||||
public function testHtmlEditorFieldFileRemote() {
|
||||
public function testHTMLEditorFieldFileRemote() {
|
||||
$fileFixture = new File(array('Name' => 'my_local_image.jpg', 'Filename' => 'folder/my_local_image.jpg'));
|
||||
$file = new HtmlEditorField_Image('http://localdomain.com/folder/my_local_image.jpg', $fileFixture);
|
||||
$file = new HTMLEditorField_Image('http://localdomain.com/folder/my_local_image.jpg', $fileFixture);
|
||||
$this->assertEquals('http://localdomain.com/folder/my_local_image.jpg', $file->URL);
|
||||
$this->assertEquals('my_local_image.jpg', $file->Name);
|
||||
$this->assertEquals('jpg', $file->Extension);
|
||||
@ -168,7 +168,7 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
||||
* @package framework
|
||||
* @subpackage tests
|
||||
*/
|
||||
class HtmlEditorFieldTest_DummyMediaFormFieldExtension extends Extension implements TestOnly {
|
||||
class HTMLEditorFieldTest_DummyMediaFormFieldExtension extends Extension implements TestOnly {
|
||||
public static $fields = null;
|
||||
public static $update_called = false;
|
||||
|
||||
@ -178,7 +178,7 @@ class HtmlEditorFieldTest_DummyMediaFormFieldExtension extends Extension impleme
|
||||
}
|
||||
}
|
||||
|
||||
class HtmlEditorFieldTest_Object extends DataObject implements TestOnly {
|
||||
class HTMLEditorFieldTest_Object extends DataObject implements TestOnly {
|
||||
private static $db = array(
|
||||
'Title' => 'Varchar',
|
||||
'Content' => 'HTMLText',
|
@ -4,7 +4,7 @@ Image:
|
||||
FileHash: f5c7c2f814b0f20ceb30b72edbac220d6eff65ed
|
||||
Name: HTMLEditorFieldTest_example.jpg
|
||||
|
||||
HtmlEditorFieldTest_Object:
|
||||
HTMLEditorFieldTest_Object:
|
||||
home:
|
||||
Title: Home Page
|
||||
about:
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class HtmlEditorFieldToolbarTest_Toolbar extends HtmlEditorField_Toolbar {
|
||||
class HTMLEditorFieldToolbarTest_Toolbar extends HTMLEditorField_Toolbar {
|
||||
public function viewfile_getLocalFileByID($id) {
|
||||
return parent::viewfile_getLocalFileByID($id);
|
||||
}
|
||||
@ -10,22 +10,22 @@ class HtmlEditorFieldToolbarTest_Toolbar extends HtmlEditorField_Toolbar {
|
||||
}
|
||||
}
|
||||
|
||||
class HtmlEditorFieldToolbarTest extends SapphireTest {
|
||||
class HTMLEditorFieldToolbarTest extends SapphireTest {
|
||||
|
||||
protected static $fixture_file = 'HtmlEditorFieldToolbarTest.yml';
|
||||
protected static $fixture_file = 'HTMLEditorFieldToolbarTest.yml';
|
||||
|
||||
/**
|
||||
* @return HtmlEditorFieldToolbarTest_Toolbar
|
||||
* @return HTMLEditorFieldToolbarTest_Toolbar
|
||||
*/
|
||||
protected function getToolbar() {
|
||||
return new HtmlEditorFieldToolbarTest_Toolbar(null, '/');
|
||||
return new HTMLEditorFieldToolbarTest_Toolbar(null, '/');
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
Config::inst()->update('HtmlEditorField_Toolbar', 'fileurl_scheme_whitelist', array('http'));
|
||||
Config::inst()->update('HtmlEditorField_Toolbar', 'fileurl_domain_whitelist', array('example.com'));
|
||||
Config::inst()->update('HTMLEditorField_Toolbar', 'fileurl_scheme_whitelist', array('http'));
|
||||
Config::inst()->update('HTMLEditorField_Toolbar', 'fileurl_domain_whitelist', array('example.com'));
|
||||
|
||||
// Filesystem mock
|
||||
AssetStoreTest_SpyStore::activate(__CLASS__);
|
||||
@ -49,7 +49,7 @@ class HtmlEditorFieldToolbarTest extends SapphireTest {
|
||||
/** @var File $exampleFile */
|
||||
$exampleFile = $this->objFromFixture('File', 'example_file');
|
||||
$expectedUrl = $exampleFile->AbsoluteLink();
|
||||
Config::inst()->update('HtmlEditorField_Toolbar', 'fileurl_domain_whitelist', array(
|
||||
Config::inst()->update('HTMLEditorField_Toolbar', 'fileurl_domain_whitelist', array(
|
||||
'example.com',
|
||||
strtolower(parse_url($expectedUrl, PHP_URL_HOST))
|
||||
));
|
@ -3,7 +3,7 @@
|
||||
* @package framework
|
||||
* @subpackage tests
|
||||
*/
|
||||
class HtmlEditorSanitiserTest extends FunctionalTest {
|
||||
class HTMLEditorSanitiserTest extends FunctionalTest {
|
||||
|
||||
public function testSanitisation() {
|
||||
$tests = array(
|
||||
@ -39,7 +39,7 @@ class HtmlEditorSanitiserTest extends FunctionalTest {
|
||||
)
|
||||
);
|
||||
|
||||
$config = HtmlEditorConfig::get('htmleditorsanitisertest');
|
||||
$config = HTMLEditorConfig::get('htmleditorsanitisertest');
|
||||
|
||||
foreach($tests as $test) {
|
||||
list($validElements, $input, $output, $desc) = $test;
|
Loading…
Reference in New Issue
Block a user