Skip to content

Commit

Permalink
Merge pull request #11774 from colemanw/NFC
Browse files Browse the repository at this point in the history
NFC - Minor code cleanup in CKEditorConfig.php
  • Loading branch information
colemanw authored Mar 7, 2018
2 parents 9a05ea5 + 6aa2790 commit c9995ef
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions CRM/Admin/Page/CKEditorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ public function run() {
'settings' => $settings,
));

$configUrl = self::getConfigUrl($this->preset);
if (!$configUrl) {
$configUrl = self::getConfigUrl('default');
}
$configUrl = self::getConfigUrl($this->preset) ?: self::getConfigUrl('default');

$this->assign('preset', $this->preset);
$this->assign('presets', CRM_Core_OptionGroup::values('wysiwyg_presets', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name'));
Expand Down Expand Up @@ -207,10 +204,7 @@ private function getCKSkins() {
*/
private function getConfigSettings() {
$matches = $result = array();
$file = self::getConfigFile($this->preset);
if (!$file) {
$file = self::getConfigFile('default');
}
$file = self::getConfigFile($this->preset) ?: self::getConfigFile('default');
$result['skin'] = 'moono';
if ($file) {
$contents = file_get_contents($file);
Expand Down Expand Up @@ -276,7 +270,7 @@ public static function setConfigDefault() {
if (!is_dir(Civi::paths()->getPath('[civicrm.files]/persist'))) {
mkdir(Civi::paths()->getPath('[civicrm.files]/persist'));
}
$newFileName = Civi::paths()->getPath('[civicrm.files]/persist/crm-ckeditor-default.js');
$newFileName = Civi::paths()->getPath(self::CONFIG_FILEPATH . 'default.js');
file_put_contents($newFileName, $config);
}
}
Expand Down

0 comments on commit c9995ef

Please sign in to comment.