You are here

function ckeditor_load_skin_options in CKEditor - WYSIWYG HTML editor 7

Same name and namespace in other branches
  1. 6 includes/ckeditor.lib.inc \ckeditor_load_skin_options()

List of installed CKEditor skins

Return value

array

3 calls to ckeditor_load_skin_options()
ckeditor_admin_global_profile_form in includes/ckeditor.admin.inc
Form builder for a global profile
ckeditor_default_skin in includes/ckeditor.lib.inc
Return default skin for CKEditor
ckeditor_profile_overview in includes/ckeditor.admin.inc
Controller for CKEditor profiles.

File

includes/ckeditor.lib.inc, line 162
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function ckeditor_load_skin_options() {
  $arr = array();
  $editor_path = ckeditor_path('relative');
  $editor_local_path = ckeditor_path('local');
  $skin_dir = ckeditor_skins_path('local');
  if (is_dir($skin_dir) && ($editor_local_path != '<URL>' || $editor_path == '<URL>' && $editor_local_path == '<URL>')) {
    $dh = @opendir($skin_dir);
    if (FALSE !== $dh) {
      while (($file = readdir($dh)) !== FALSE) {
        if (in_array($file, array(
          ".",
          "..",
          "CVS",
          ".svn",
        ))) {
          continue;
        }
        if (is_dir($skin_dir . DIRECTORY_SEPARATOR . $file)) {
          $arr[$file] = drupal_ucfirst($file);
        }
      }
      closedir($dh);
    }
  }

  // If we have no information about skins, use the default for this version.
  if (empty($arr)) {
    $arr = array(
      'moono-lisa' => 'Moono-lisa',
      'moono' => 'Moono',
      'kama' => 'Kama',
    );
  }
  asort($arr);
  return $arr;
}