Projet

Général

Profil

Révision 2e0f6994

Ajouté par Assos Assos il y a environ 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ckeditor/includes/ckeditor.lib.inc
177 177
      closedir($dh);
178 178
    }
179 179
  }
180
  //oops, we have no information about skins, let's use only default
181
  if (empty($arr)) {
182
    $arr = array(
183
      'moono' => 'Moono',
184
      'kama' => 'Kama'
185
    );
180

  
181
  // If we have no information about skins, use the default for this version.
182
  if (!$arr) {
183
    $version = explode('.', ckeditor_get_version());
184
    if ($version[0] == 3) {
185
      $arr = array('kama' => 'Kama');
186
    }
187
    elseif ($version[0] == 4) {
188
      $arr = ($version[1] <= 5) ? array('moono' => 'Moono') : array('moono-lisa' => 'Moono-lisa');
189
    }
186 190
  }
187 191
  asort($arr);
188 192

  
......
195 199
 * @return string
196 200
 */
197 201
function ckeditor_default_skin() {
198
  $skin_options = ckeditor_load_skin_options();
199
  if (array_key_exists('moono', $skin_options)) {
200
    return 'moono';
202
  // If there is no available list then bail.
203
  if (!$skin_options = ckeditor_load_skin_options()) {
204
    return '';
201 205
  }
202
  if (array_key_exists('kama', $skin_options)) {
203
    return 'kama';
206

  
207
  // Default skins in descending order
208
  $defaults = array(
209
    'moono-lisa' => 'Moono-lisa',
210
    'moono' => 'Moono',
211
    'kama' => 'Kama'
212
  );
213

  
214
  // If there is more than one skin to choose from, use the most current
215
  // default.
216
  if ($skin_options && ($default = array_intersect_key($defaults, $skin_options))) {
217
    return key($default);
204 218
  }
205
  reset($skin_options);
206
  //if any default theme not exists select first from the list
219

  
220
  // If there are no defaults, or only one skin, select the first from the list.
207 221
  return key($skin_options);
208 222
}
209 223

  
......
1084 1098
    $color_paths = variable_get('color_' . $current_theme . '_stylesheets', array());
1085 1099
    if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
1086 1100
      if (!empty($color_paths[1])) {
1087
        $css_files[] = $host . $color_paths[1] . $query_string;
1101
        if (substr($color_paths[0], 0, 9) == 'public://') {
1102
          $css_files[] = file_create_url($color_paths[1]) . $query_string;
1103
        }
1104
        else {
1105
          $css_files[] = $host . $color_paths[1] . $query_string;
1106
        }
1088 1107
      }
1089 1108
    }
1090 1109
    elseif (!empty($color_paths[0])) {
1091
      $css_files[] = $host . $color_paths[0] . $query_string;
1110
      if (substr($color_paths[0], 0, 9) == 'public://') {
1111
        $css_files[] = file_create_url($color_paths[0]) . $query_string;
1112
      }
1113
      else {
1114
        $css_files[] = $host . $color_paths[0] . $query_string;
1115
      }
1092 1116
    }
1093 1117
  }
1094 1118
  else {
......
1303 1327
      drupal_add_js(array('ckeditor' => array('scayt_language' => ckeditor_scayt_langcode($field["#language"]))), 'setting');
1304 1328
    }
1305 1329

  
1330
    // Pass Drupal's JS cache-busting string via settings along to CKEditor.
1331
    drupal_add_js(array('ckeditor' => array('timestamp' => variable_get('css_js_query_string', '0'))), 'setting');
1332

  
1306 1333
    // Remember extra information and reuse it during "Preview"
1307 1334
    $processed_ids[$field['#id']]['suffix'] = $suffix;
1308 1335
    $processed_ids[$field['#id']]['class'] = $class;

Formats disponibles : Unified diff