aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-02 11:54:15 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-02 11:54:15 +0000
commit4990faf1ebf89b8f6bda96580fede8d9b17e8872 (patch)
treedcd7b4b726f1b41e07ff9c7fc3d80b6a45214d6f /engine
parentab36344d8e480b7c1b053130f2afc19ed2cf9e6c (diff)
downloadelgg-4990faf1ebf89b8f6bda96580fede8d9b17e8872.tar.gz
elgg-4990faf1ebf89b8f6bda96580fede8d9b17e8872.tar.bz2
added a function for getting current site entity
git-svn-id: http://code.elgg.org/elgg/trunk@7495 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/sites.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index a348d166b..97398d7f2 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -8,6 +8,24 @@
*/
/**
+ * Get an ElggSite entity (default is current site)
+ *
+ * @param int $site_guid Optional. Site GUID.
+ *
+ * @return ElggSite
+ * @since 1.8.0
+ */
+function elgg_get_site_entity($site_guid = 0) {
+ global $CONFIG;
+
+ if ($site_guid == 0) {
+ return $CONFIG->site;
+ }
+
+ return get_entity($site_guid);
+}
+
+/**
* Return the site specific details of a site by a row.
*
* @param int $guid The site GUID