Skip to content

Commit

Permalink
Revert "Address craftcms/cms#3695"
Browse files Browse the repository at this point in the history
This reverts commit 3bef91d.
  • Loading branch information
andris-sevcenko committed Apr 24, 2019
1 parent 13e7ba3 commit 018a67e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 55 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
## Unreleased

### Changed
- Updated Redactor to 3.1.8
- Redactor field now correctly typecasts the `cleanupHtml` and `purifyHtml` boolean values saved to the project config. ([craftcms/cms#3695](https://github.com/craftcms/cms/issues/3695))
- Updated Redactor 3.1.8

### Fixed
- Fixed a bug where linking files or assets would not work as expected. ([#136](https://github.com/craftcms/redactor/issues/136))
Expand Down
94 changes: 41 additions & 53 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,47 +63,6 @@ class Field extends \craft\base\Field
*/
private static $_pluginPaths;

// Properties
// =========================================================================

/**
* @var string|null The Redactor config file to use
*/
public $redactorConfig;

/**
* @var string|null The HTML Purifier config file to use
*/
public $purifierConfig;

/**
* @var bool Whether the HTML should be cleaned up on save
*/
public $cleanupHtml = true;

/**
* @var bool Whether the HTML should be purified on save
*/
public $purifyHtml = true;

/**
* @var string The type of database column the field should have in the content table
*/
public $columnType = Schema::TYPE_TEXT;

/**
* @var string|array|null The volumes that should be available for Image selection.
*/
public $availableVolumes = '*';

/**
* @var string|array|null The transforms available when selecting an image
*/
public $availableTransforms = '*';

// Public Methods
// =========================================================================

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -152,18 +111,6 @@ public function __construct(array $config = [])
parent::__construct($config);
}

/**
* @inheritdocs
*/
public function getSettings(): array
{
$settings = parent::getSettings();
$settings['cleanupHtml'] = (bool)$settings['cleanupHtml'];
$settings['purifyHtml'] = (bool)$settings['purifyHtml'];

return $settings;
}

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -231,6 +178,47 @@ public static function redactorPluginPaths(): array
return self::$_pluginPaths = $event->paths;
}

// Properties
// =========================================================================

/**
* @var string|null The Redactor config file to use
*/
public $redactorConfig;

/**
* @var string|null The HTML Purifier config file to use
*/
public $purifierConfig;

/**
* @var bool Whether the HTML should be cleaned up on save
*/
public $cleanupHtml = true;

/**
* @var bool Whether the HTML should be purified on save
*/
public $purifyHtml = true;

/**
* @var string The type of database column the field should have in the content table
*/
public $columnType = Schema::TYPE_TEXT;

/**
* @var string|array|null The volumes that should be available for Image selection.
*/
public $availableVolumes = '*';

/**
* @var string|array|null The transforms available when selecting an image
*/
public $availableTransforms = '*';

// Public Methods
// =========================================================================

/**
* @inheritdoc
*/
Expand Down

0 comments on commit 018a67e

Please sign in to comment.