You are here

function ckeditor_get_profile in CKEditor - WYSIWYG HTML editor 7

Return CKEditor profile by input format

Parameters

string $input_format:

Return value

object|boolean

1 call to ckeditor_get_profile()
ckeditor_load_by_field in includes/ckeditor.lib.inc
Load CKEditor for field ID

File

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

Code

function ckeditor_get_profile($input_format) {
  $select = db_select('ckeditor_settings', 's');
  $select
    ->join('ckeditor_input_format', 'f', 'f.name = s.name');
  $result = $select
    ->fields('s', array(
    "name",
  ))
    ->condition('f.format', $input_format)
    ->condition('f.name', 'CKEditor Global Profile', '<>')
    ->range(0, 1)
    ->execute()
    ->fetchAssoc();
  if ($result && ($profile = ckeditor_profile_load($result['name']))) {
    return $profile;
  }
  return FALSE;
}