aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorkevinjardine <kevinjardine@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-24 10:36:23 +0000
committerkevinjardine <kevinjardine@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-24 10:36:23 +0000
commitdea94d966389092be57ea517065c8822242711ae (patch)
tree45d5ec09d704c17099bbf54c5ca33e89c11efa3f /engine/lib/elgglib.php
parentadc58d2bc1807b6c41b012aae7eb74795ac17c67 (diff)
downloadelgg-dea94d966389092be57ea517065c8822242711ae.tar.gz
elgg-dea94d966389092be57ea517065c8822242711ae.tar.bz2
Made icon views work properly for non-default icons, and introduced elgg_view_enable_simplecache and elgg_view_disable_simplecache functions.
git-svn-id: https://code.elgg.org/elgg/trunk@2910 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php43
1 files changed, 42 insertions, 1 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index a14a5feb1..a081837fb 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -454,6 +454,47 @@
}
+ /**
+ * Enables the simple cache.
+ *
+ * @see elgg_view_register_simplecache
+ *
+ */
+
+ function elgg_view_enable_simplecache() {
+ global $CONFIG;
+ if(!$CONFIG->simplecache_enabled) {
+ datalist_set('simplecache_enabled',1);
+ $CONFIG->simplecache_enabled = 1;
+ elgg_view_regenerate_simplecache();
+ }
+ }
+
+ /**
+ * Disables the simple cache.
+ *
+ * @see elgg_view_register_simplecache
+ *
+ */
+
+ function elgg_view_disable_simplecache() {
+ global $CONFIG;
+ if ($CONFIG->simplecache_enabled) {
+ datalist_set('simplecache_enabled',0);
+ $CONFIG->simplecache_enabled = 0;
+
+ // purge simple cache
+ if ($handle = opendir($CONFIG->dataroot.'views_simplecache')) {
+ while (false !== ($file = readdir($handle))) {
+ if ($file != "." && $file != "..") {
+ unlink($CONFIG->dataroot.'views_simplecache/'.$file);
+ }
+ }
+ closedir($handle);
+ }
+ }
+ }
+
/**
* Internal function for retrieving views used by elgg_view_tree
*
@@ -2206,7 +2247,7 @@
/**
* Some useful constant definitions
- */
+ */
define('ACCESS_DEFAULT',-1);
define('ACCESS_PRIVATE',0);
define('ACCESS_LOGGED_IN',1);