aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Settings/Features.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-08 20:05:30 -0700
committerzotlabs <mike@macgirvin.com>2018-04-08 20:05:30 -0700
commite0255c0dc45d8c670b865087336b4807d831e0fb (patch)
tree3e68745fcf1d6b7ed1e2a92ee7fa4f39acf4baf4 /Zotlabs/Module/Settings/Features.php
parent6ce3ca1ce02a535938812372ece9377242c2eaa4 (diff)
downloadvolse-hubzilla-e0255c0dc45d8c670b865087336b4807d831e0fb.tar.gz
volse-hubzilla-e0255c0dc45d8c670b865087336b4807d831e0fb.tar.bz2
volse-hubzilla-e0255c0dc45d8c670b865087336b4807d831e0fb.zip
first cut of feature/techlevel merge
Diffstat (limited to 'Zotlabs/Module/Settings/Features.php')
-rw-r--r--Zotlabs/Module/Settings/Features.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Settings/Features.php
index 5b642acc3..3c3205c65 100644
--- a/Zotlabs/Module/Settings/Features.php
+++ b/Zotlabs/Module/Settings/Features.php
@@ -11,7 +11,13 @@ class Features {
// Build list of features and check which are set
// We will not create any settings for features that are above our techlevel
- $features = get_features();
+ if(intval($_REQUEST['techlevel']))
+ $level = intval($_REQUEST['techlevel']);
+ else {
+ $level = get_account_techlevel();
+ }
+
+ $features = get_features(true,$level);
$all_features = array();
foreach($features as $k => $v) {
foreach($v as $f)
@@ -28,9 +34,21 @@ class Features {
}
function get() {
- $arr = array();
- $features = get_features();
-
+
+ $arr = [];
+ if(intval($_REQUEST['techlevel']))
+ $level = intval($_REQUEST['techlevel']);
+ else {
+ $level = get_account_techlevel();
+ }
+
+ $techlevels = \Zotlabs\Lib\Techlevels::levels();
+
+ $def_techlevel = \App::$account['account_level'];
+ $techlock = get_config('system','techlevel_lock');
+
+ $features = get_features(true,$level);
+
foreach($features as $fname => $fdata) {
$arr[$fname] = array();
$arr[$fname][0] = $fdata[0];
@@ -43,6 +61,8 @@ class Features {
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_features"),
'$title' => t('Additional Features'),
+ '$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience and additional features consistent with your comfort level'), $techlevels ],
+ '$techlock' => $techlock,
'$features' => $arr,
'$submit' => t('Submit'),
));