X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fsettings.php;h=7cfdbb1cd5f60e580b9cf22ecaf6851321a37e1f;hb=6f6b1f95c855eb1e06aa73aaab8ddefd8eb970da;hp=a7b2791a92fe9321a071e77bc8c6a6ca9d983958;hpb=40cfcdad2da8c5176b9a025e9e1fbe614e1c867b;p=friendica.git diff --git a/mod/settings.php b/mod/settings.php index a7b2791a92..7cfdbb1cd5 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -31,6 +31,11 @@ function settings_init(&$a) { 'url' => $a->get_baseurl(true).'/settings', 'selected' => (($a->argc == 1)?'active':''), ), + array( + 'label' => t('Additional features'), + 'url' => $a->get_baseurl(true).'/settings/features', + 'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''), + ), array( 'label' => t('Display settings'), 'url' => $a->get_baseurl(true).'/settings/display', @@ -204,6 +209,7 @@ function settings_post(&$a) { intval($mail_pubmail), intval(local_user()) ); + logger("mail: updating mailaccount. Response: ".print_r($r, true)); $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1", intval(local_user()) ); @@ -231,7 +237,18 @@ function settings_post(&$a) { return; } - if(($a->argc > 1) && ($a->argv[1] == 'display')) { + if(($a->argc > 1) && ($a->argv[1] === 'features')) { + check_form_security_token_redirectOnErr('/settings/features', 'settings_features'); + foreach($_POST as $k => $v) { + if(strpos($k,'feature_') === 0) { + set_pconfig(local_user(),'feature',substr($k,8),((intval($v)) ? 1 : 0)); + } + } + info( t('Features updated') . EOL); + return; + } + + if(($a->argc > 1) && ($a->argv[1] === 'display')) { check_form_security_token_redirectOnErr('/settings/display', 'settings_display'); @@ -612,6 +629,7 @@ function settings_content(&$a) { return $o; } + if(($a->argc > 1) && ($a->argv[1] === 'addon')) { $settings_addons = ""; @@ -631,6 +649,30 @@ function settings_content(&$a) { return $o; } + if(($a->argc > 1) && ($a->argv[1] === 'features')) { + + $arr = array(); + $features = get_features(); + foreach($features as $fname => $fdata) { + $arr[$fname] = array(); + $arr[$fname][0] = $fdata[0]; + foreach(array_slice($fdata,1) as $f) { + $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(get_pconfig(local_user(),'feature',$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); + } + } + + + $tpl = get_markup_template("settings_features.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("settings_features"), + '$title' => t('Additional Features'), + '$features' => $arr, + '$submit' => t('Submit'), + '$field_yesno' => 'field_yesno.tpl', + )); + return $o; + } + if(($a->argc > 1) && ($a->argv[1] === 'connectors')) { $settings_connectors = ""; @@ -690,9 +732,9 @@ function settings_content(&$a) { '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( 'notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')), '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''), '$mail_pass' => array('mail_pass', t('Email password:'), '', ''), - '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'), + '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), $mail_replyto, 'Optional'), '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''), - '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), 1=>t('Delete'), 2=>t('Mark as seen'), 3=>t('Move to folder'))), + '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), /*1=>t('Delete'),*/ 2=>t('Mark as seen'), 3=>t('Move to folder'))), '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''), '$submit' => t('Submit'), @@ -770,8 +812,8 @@ function settings_content(&$a) { '$baseurl' => $a->get_baseurl(true), '$uid' => local_user(), - '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, 'preview'), - '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, ''), + '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true), + '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false), '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), '$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')), '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''),