function bueditor_editors in BUEditor 7
Same name and namespace in other branches
- 5 bueditor.module \bueditor_editors()
- 6.2 bueditor.inc \bueditor_editors()
- 6 bueditor.module \bueditor_editors()
Load and return editors by id.
5 calls to bueditor_editors()
- bueditor_admin in admin/
bueditor.admin.inc - Admin main page.
- bueditor_check_page in ./
bueditor.inc - Check if the editor is visible in the page.
- bueditor_editor_options in admin/
bueditor.admin.inc - Editor options.
- bueditor_eop in admin/
bueditor.admin.inc - Prepare and execute if there is any valid editor operation that doesn't require form submission.
- _bueditor_settle in ./
bueditor.inc - Include necessary js and css files for editor settlement.
1 string reference to 'bueditor_editors'
- bueditor_write_editor in admin/
bueditor.admin.inc - Update/insert an editor.
File
- ./
bueditor.inc, line 11 - Implements commonly used functions for bueditor.
Code
function bueditor_editors($eid = 0) {
if (empty($eid)) {
return FALSE;
}
static $editors = array(), $gotall = FALSE;
if ($eid === 'all') {
if (!$gotall) {
$gotall = TRUE;
$result = db_query("SELECT * FROM {bueditor_editors} ORDER BY name");
foreach ($result as $editor) {
$editors[$editor->eid] = $editor;
}
}
return $editors;
}
elseif (!isset($editors[$eid]) && !$gotall && is_numeric($eid) && $eid > 0) {
$editors[$eid] = db_query("SELECT * FROM {bueditor_editors} WHERE eid = :eid", array(
':eid' => $eid,
))
->fetchObject();
}
return isset($editors[$eid]) ? $editors[$eid] : FALSE;
}