From 1454fbb1633db4dc44049bde6cc9052bccc4db0d Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sat, 9 Jun 2012 12:33:05 +0200 Subject: Moved global $admin_grp variable to models.php Also added a loader function for this and added some documentation. --- ratatoeskr/sys/models.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'ratatoeskr/sys') 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,9 +42,18 @@ $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 . */ $ratatoeskr_settings = NULL; +/* + * Variable: $admin_grp + * Since the admin group is used often, here is a global variable holding the . + * + * Use ::load_admin_group to load this group. + */ +$admin_grp = NULL; + /* * Constants: ARTICLE_STATUS_ * Possible
::$status values. @@ -508,6 +517,17 @@ class Group extends BySQLRowEnabled return $rv; } + /* + * 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: -- cgit v1.2.3-70-g09d2