-- 2009-08-05 version 5.x-2.x-dev
* #448242 Textarea is not valid
+* #293976 Add parameters to clear static variables in functions
-- 2009-08-02 version 5.x-2.x-dev
* #380146 Image Assist still not working
/**
* Load all profiles. Just load one profile if $name is passed in.
*/
-function fckeditor_profile_load($name = '') {
+function fckeditor_profile_load($name = '', $clear = FALSE) {
static $profiles = array();
- if (!$profiles) {
+ if (empty($profiles) || $clear === TRUE) {
$roles = user_roles();
$result = db_query('SELECT * FROM {fckeditor_settings}');
while ($data = db_fetch_object($result)) {
/**
* sort roles according to precedence settings. previously sorted roles are followed by latest added roles.
*/
-function fckeditor_sorted_roles() {
+function fckeditor_sorted_roles($clear = FALSE) {
static $order;
- if (isset($order)) {
+ if (isset($order) && $clear !== TRUE) {
return $order;
}
$order = array();
return $status;
}
-function fckeditor_user_get_profile($user) {
- static $profile_name;
+function fckeditor_user_get_profile($user, $clear = FALSE) {
+ static $profile_name = null;
+
+ if ($clear === TRUE || $profile_name == null) {
+ $profile_name = array();
+ }
// Since fckeditor_profile_load() makes a db hit, only call it when we're pretty sure
// we're gonna render fckeditor.