You are here

function fckeditor_load_skin_options in FCKeditor - WYSIWYG HTML editor 6.2

Same name and namespace in other branches
  1. 5.2 fckeditor.module \fckeditor_load_skin_options()
  2. 6 fckeditor.module \fckeditor_load_skin_options()
2 calls to fckeditor_load_skin_options()
fckeditor_admin_profile_form in ./fckeditor.admin.inc
Form builder for a normal profile
fckeditor_user_delegate in ./fckeditor.user.inc
FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben

File

./fckeditor.lib.inc, line 147
FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben

Code

function fckeditor_load_skin_options() {
  $arr = array();
  $editor_local_path = fckeditor_path(TRUE);
  $skin_dir = $editor_local_path . '/editor/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(
      'default' => 'Default',
    );
  }
  asort($arr);
  return $arr;
}