provide an option to toggle the view of locked features so we can use the same list in an admin feature set & lock page.

This commit is contained in:
redmatrix 2016-01-05 20:38:32 -08:00
parent 26139ee06f
commit c076e72cbf
2 changed files with 16 additions and 14 deletions

View File

@ -36,7 +36,7 @@ function get_feature_default($feature) {
} }
function get_features() { function get_features($filtered = true) {
$arr = array( $arr = array(
@ -98,20 +98,22 @@ function get_features() {
// removed any locked features and remove the entire category if this makes it empty // removed any locked features and remove the entire category if this makes it empty
foreach($arr as $k => $x) { if($filtered) {
$has_items = false; foreach($arr as $k => $x) {
for($y = 0; $y < count($arr[$k]); $y ++) { $has_items = false;
if(is_array($arr[$k][$y])) { for($y = 0; $y < count($arr[$k]); $y ++) {
if($arr[$k][$y][4] === false) { if(is_array($arr[$k][$y])) {
$has_items = true; if($arr[$k][$y][4] === false) {
} $has_items = true;
else { }
unset($arr[$k][$y]); else {
unset($arr[$k][$y]);
}
} }
} }
} if(! $has_items) {
if(! $has_items) { unset($arr[$k]);
unset($arr[$k]); }
} }
} }

View File

@ -1 +1 @@
2016-01-04.1268H 2016-01-05.1269H