Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19649 - Fix wysiwyg defaults #9425

Merged
merged 1 commit into from
Nov 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CRM/Admin/Page/CKEditorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function save($params) {
foreach ($params as $key => $val) {
$val = trim($val);
if (strpos($key, 'config_') === 0 && strlen($val)) {
if ($val != 'true' && $val != 'false' && $val[0] != '{' && $val[0] != '[' && !is_numeric($val)) {
if ($val != 'true' && $val != 'false' && $val != 'null' && $val[0] != '{' && $val[0] != '[' && !is_numeric($val)) {
$val = json_encode($val);
}
$pos = strrpos($config, '};');
Expand Down Expand Up @@ -206,6 +206,9 @@ private function getCKSkins() {
private function getConfigSettings() {
$matches = $result = array();
$file = self::getConfigFile($this->preset);
if (!$file) {
$file = self::getConfigFile('default');
}
$result['skin'] = 'moono';
if ($file) {
$contents = file_get_contents($file);
Expand Down
2 changes: 1 addition & 1 deletion js/wysiwyg/admin.ckeditor-configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
$el.after('<span>&nbsp; = &nbsp;<select class="crm-form-select" name="config_' + name + '"><option value="false">false</option><option value="true">true</option></select></span>');
}
else {
$el.after('<span>&nbsp; = &nbsp;<input class="crm-form-text huge" type="' + (type==='Number' ? 'number' : 'text') + '" name="config_' + name + '" /></span>');
$el.after('<span>&nbsp; = &nbsp;<input class="crm-form-text ' + (type==='Number' ? 'eight" type="number"' : 'huge" type="text"') + ' name="config_' + name + '"/></span>');
}
} else {
$el.closest('div').remove();
Expand Down