aboutsummaryrefslogtreecommitdiffstats
path: root/include/features.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-01-05 20:38:32 -0800
committerredmatrix <git@macgirvin.com>2016-01-05 20:38:32 -0800
commitc076e72cbf6fe9106956ef1ecf1ec5cf9a8c7fae (patch)
treef3eff123223b2d33573bd65fe0910f9db66c04b7 /include/features.php
parent26139ee06fc47a99c24c3d63096ccba3cb943aeb (diff)
downloadvolse-hubzilla-c076e72cbf6fe9106956ef1ecf1ec5cf9a8c7fae.tar.gz
volse-hubzilla-c076e72cbf6fe9106956ef1ecf1ec5cf9a8c7fae.tar.bz2
volse-hubzilla-c076e72cbf6fe9106956ef1ecf1ec5cf9a8c7fae.zip
provide an option to toggle the view of locked features so we can use the same list in an admin feature set & lock page.
Diffstat (limited to 'include/features.php')
-rw-r--r--include/features.php28
1 files changed, 15 insertions, 13 deletions
diff --git a/include/features.php b/include/features.php
index b02d912cf..3cbbf5b7d 100644
--- a/include/features.php
+++ b/include/features.php
@@ -36,7 +36,7 @@ function get_feature_default($feature) {
}
-function get_features() {
+function get_features($filtered = true) {
$arr = array(
@@ -98,20 +98,22 @@ function get_features() {
// removed any locked features and remove the entire category if this makes it empty
- foreach($arr as $k => $x) {
- $has_items = false;
- for($y = 0; $y < count($arr[$k]); $y ++) {
- if(is_array($arr[$k][$y])) {
- if($arr[$k][$y][4] === false) {
- $has_items = true;
- }
- else {
- unset($arr[$k][$y]);
+ if($filtered) {
+ foreach($arr as $k => $x) {
+ $has_items = false;
+ for($y = 0; $y < count($arr[$k]); $y ++) {
+ if(is_array($arr[$k][$y])) {
+ if($arr[$k][$y][4] === false) {
+ $has_items = true;
+ }
+ else {
+ unset($arr[$k][$y]);
+ }
}
}
- }
- if(! $has_items) {
- unset($arr[$k]);
+ if(! $has_items) {
+ unset($arr[$k]);
+ }
}
}