You are here

function fckeditor_profile_load in FCKeditor - WYSIWYG HTML editor 6

Same name and namespace in other branches
  1. 5.2 fckeditor.module \fckeditor_profile_load()
  2. 6.2 fckeditor.module \fckeditor_profile_load()

Load all profiles. Just load one profile if $name is passed in.

5 calls to fckeditor_profile_load()
fckeditor_admin in ./fckeditor.module
Controller for FCKeditor administrative settings.
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_process_textarea in ./fckeditor.module
This function create the HTML objects required for the FCKeditor
fckeditor_profile_overview in ./fckeditor.module
Controller for fckeditor profiles.
fckeditor_user_get_profile in ./fckeditor.module

File

./fckeditor.module, line 746
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) {
    $roles = user_roles();
    $result = db_query('SELECT * FROM {fckeditor_settings}');
    while ($data = db_fetch_object($result)) {
      $data->settings = unserialize($data->settings);
      $result2 = db_query("SELECT rid FROM {fckeditor_role} WHERE name = '%s'", $data->name);
      $role = array();
      while ($r = db_fetch_object($result2)) {
        $role[$r->rid] = $roles[$r->rid];
      }
      $data->rids = $role;
      $profiles[$data->name] = $data;
    }
  }
  return $name ? $profiles[$name] : $profiles;
}