You are here

function ckeditor_load_skin_options in CKEditor - WYSIWYG HTML editor 6

Same name and namespace in other branches
  1. 7 includes/ckeditor.lib.inc \ckeditor_load_skin_options()
3 calls to ckeditor_load_skin_options()
ckeditor_admin_profile_form in includes/ckeditor.admin.inc
Form builder for a normal 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 106
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_local_path = ckeditor_path(TRUE);
  $skin_dir = $editor_local_path . '/skins';
  if (is_dir($skin_dir)) {
    $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);
    }
  }

  //oops, we have no information about skins, let's use only default
  if (empty($arr)) {
    $arr = array(
      'kama' => 'Kama',
    );
  }
  asort($arr);
  return $arr;
}