summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--fckeditor.module16
2 files changed, 11 insertions, 6 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 49f941d..1059b86 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,6 +2,7 @@ $Id$
-- 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
diff --git a/fckeditor.module b/fckeditor.module
index f53a7e3..9e36e82 100644
--- a/fckeditor.module
+++ b/fckeditor.module
@@ -750,10 +750,10 @@ function fckeditor_profile_overview() {
/**
* 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)) {
@@ -1462,9 +1462,9 @@ function fckeditor_load_lang_options() {
/**
* 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();
@@ -2215,8 +2215,12 @@ function fckeditor_user_get_setting($user, $profile, $setting) {
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.