function bueditor_user_eids in BUEditor 6.2
Same name and namespace in other branches
- 6 bueditor.module \bueditor_user_eids()
- 7 bueditor.inc \bueditor_user_eids()
Return the editor ids assigned to the user.
1 call to bueditor_user_eids()
- _bueditor_textarea in ./
bueditor.inc - Integrate the editor into textareas.
File
- ./
bueditor.inc, line 186 - Implements commonly used functions for bueditor.
Code
function bueditor_user_eids($user) {
//user #1
if ($user->uid == 1) {
return array(
variable_get('bueditor_user1', 1),
variable_get('bueditor_user1_alt', 0),
);
}
$roles = variable_get('bueditor_roles', array());
//anonymous user
if (empty($user->uid)) {
$rid = DRUPAL_ANONYMOUS_RID;
return isset($roles[$rid]) ? array(
$roles[$rid]['editor'],
$roles[$rid]['alt'],
) : array(
'',
'',
);
}
//other users
foreach ($roles as $rid => $role) {
if (isset($user->roles[$rid]) && ($role['editor'] || $role['alt'])) {
return array(
$role['editor'],
$role['alt'],
);
}
}
return array(
'',
'',
);
}