function fckeditor_profile_load in FCKeditor - WYSIWYG HTML editor 6.2
Same name and namespace in other branches
- 5.2 fckeditor.module \fckeditor_profile_load()
- 6 fckeditor.module \fckeditor_profile_load()
Load all profiles. Just load one profile if $name is passed in.
9 calls to fckeditor_profile_load()
- fckeditor_admin_global_profile_form in ./fckeditor.admin.inc 
- fckeditor_admin_profile_form in ./fckeditor.admin.inc 
- Form builder for a normal profile
- fckeditor_admin_profile_form_validate in ./fckeditor.admin.inc 
- Profile validation.
- fckeditor_file_download in ./fckeditor.module 
- Implementation of hook_file_download(). Support for private downloads. FCKeditor does not implement any kind of potection on private files.
- fckeditor_path in ./fckeditor.module 
- Read FCKeditor path from Global profile
File
- ./fckeditor.module, line 459 
- FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben
Code
function fckeditor_profile_load($name = '', $clear = FALSE) {
  static $profiles = array();
  if (empty($profiles) || $clear === TRUE) {
    $result = db_query("SELECT * FROM {fckeditor_settings}");
    while ($data = db_fetch_object($result)) {
      $data->settings = unserialize($data->settings);
      $data->rids = array();
      $profiles[$data->name] = $data;
    }
    $roles = user_roles();
    $result = db_query("SELECT name, rid FROM {fckeditor_role}");
    while ($data = db_fetch_object($result)) {
      $profiles[$data->name]->rids[$data->rid] = $roles[$data->rid];
    }
  }
  return $name ? isset($profiles[urldecode($name)]) ? $profiles[urldecode($name)] : FALSE : $profiles;
}