Merge pull request #12426 from totten/master-container-cache
[civicrm-core.git] / CRM / Admin / Page / CKEditorConfig.php
index 3cb00094dd8fa0b755b6e63b86a0e883542c23b1..a99ae20aeebbf62bfa687e74dee7d4ae40fcae11 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
@@ -96,10 +96,7 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
         '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'));
@@ -207,10 +204,7 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
    */
   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);
@@ -276,7 +270,7 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
       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);
     }
   }