aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/sys/models.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2012-06-09 12:33:05 +0200
committerKevin Chabowski <kevin@kch42.de>2012-06-09 12:33:05 +0200
commit1454fbb1633db4dc44049bde6cc9052bccc4db0d (patch)
tree5f6f66e5085382693f0acaa245aee7b6b8136d99 /ratatoeskr/sys/models.php
parent1dda842bb80414c6d373e7fb41c63d4d31e035b6 (diff)
downloadratatoeskr-cms-1454fbb1633db4dc44049bde6cc9052bccc4db0d.tar.gz
ratatoeskr-cms-1454fbb1633db4dc44049bde6cc9052bccc4db0d.tar.bz2
ratatoeskr-cms-1454fbb1633db4dc44049bde6cc9052bccc4db0d.zip
Moved global $admin_grp variable to models.php
Also added a loader function for this and added some documentation.
Diffstat (limited to 'ratatoeskr/sys/models.php')
-rw-r--r--ratatoeskr/sys/models.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php
index 44367dd..17afa67 100644
--- a/ratatoeskr/sys/models.php
+++ b/ratatoeskr/sys/models.php
@@ -42,10 +42,19 @@ $imagetype_file_extensions = array(
* "comment_textprocessor" - The textprocessor to be used for comments.
* "languages" - Array of activated languages.
* "last_db_cleanup" - Timestamp of the last database cleanup.
+ * "debugmode" - If the debug mode is enabled (can be overwritten by <config.php>.
*/
$ratatoeskr_settings = NULL;
/*
+ * Variable: $admin_grp
+ * Since the admin group is used often, here is a global variable holding the <Group>.
+ *
+ * Use <Group>::load_admin_group to load this group.
+ */
+$admin_grp = NULL;
+
+/*
* Constants: ARTICLE_STATUS_
* Possible <Article>::$status values.
*
@@ -509,6 +518,17 @@ class Group extends BySQLRowEnabled
}
/*
+ * Function: load_admin_group
+ * Will load the admin group into the global <$admin_grp> variable, if not already done.
+ */
+ public static function load_admin_group()
+ {
+ global $admin_grp;
+ if($admin_grp === NULL)
+ $admin_grp = Group::by_name("admins");
+ }
+
+ /*
* Function: get_id
* Returns:
* The group ID.