diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Settings.php | 23 | ||||
-rwxr-xr-x | Zotlabs/Render/SmartyTemplate.php | 1 |
3 files changed, 24 insertions, 3 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index eee3b2a4f..f50b9680e 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -246,10 +246,11 @@ class ThreadItem { } $server_role = get_config('system','server_role'); + $has_bookmarks = false; if(is_array($item['term'])) { foreach($item['term'] as $t) { - if(($server_role != 'basic') && ($t['ttype'] == TERM_BOOKMARK)) + if((get_account_techlevel() > 0) && ($t['ttype'] == TERM_BOOKMARK)) $has_bookmarks = true; } } diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php index bd16b930e..81c24e02b 100644 --- a/Zotlabs/Module/Settings.php +++ b/Zotlabs/Module/Settings.php @@ -306,6 +306,8 @@ class Settings extends \Zotlabs\Web\Controller { $errs = array(); $email = ((x($_POST,'email')) ? trim(notags($_POST['email'])) : ''); + $techlevel = ((array_key_exists('techlevel',$_POST)) ? intval($_POST['techlevel']) : 0); + $account = \App::get_account(); if($email != $account['account_email']) { if(! valid_email($email)) @@ -324,6 +326,13 @@ class Settings extends \Zotlabs\Web\Controller { $errs[] = t('System failure storing new email. Please try again.'); } } + if($techlevel != $account['account_level']) { + $r = q("update account set account_level = %d where account_id = %d", + intval($techlevel), + intval($account['account_id']) + ); + info( t('Technical skill level updated') . EOL); + } if($errs) { foreach($errs as $err) @@ -783,8 +792,17 @@ class Settings extends \Zotlabs\Web\Controller { call_hooks('account_settings', $account_settings); $email = \App::$account['account_email']; - - + + $techlevels = [ + '0' => t('Beginner/Basic'), + '1' => t('Novice - not skilled but willing to learn'), + '2' => t('Intermediate - somewhat comfortable'), + '3' => t('Advanced - very comfortable'), + '4' => t('Expert - I can write computer code'), + '5' => t('Wizard - I probably know more than you do') + ]; + + $tpl = get_markup_template("settings_account.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_account"), @@ -792,6 +810,7 @@ class Settings extends \Zotlabs\Web\Controller { '$origpass' => array('origpass', t('Current Password'), ' ',''), '$password1'=> array('npassword', t('Enter New Password'), '', ''), '$password2'=> array('confirm', t('Confirm New Password'), '', t('Leave password fields blank unless changing')), + '$techlevel' => [ 'techlevel', t('Your technical skill level'), \App::$account['account_level'], t('Used to provide a member experience matched to your comfort level'), $techlevels ], '$submit' => t('Submit'), '$email' => array('email', t('Email Address:'), $email, ''), '$removeme' => t('Remove Account'), diff --git a/Zotlabs/Render/SmartyTemplate.php b/Zotlabs/Render/SmartyTemplate.php index 7abe0731c..ffe58e286 100755 --- a/Zotlabs/Render/SmartyTemplate.php +++ b/Zotlabs/Render/SmartyTemplate.php @@ -35,6 +35,7 @@ class SmartyTemplate implements TemplateEngine { $r['$z_baseurl'] = z_root(); $r['$z_server_role'] = \Zotlabs\Lib\System::get_server_role(); + $r['$z_techlevel'] = get_account_techlevel(); if(gettype($s) === 'string') { $template = $s; |