From c11fbe0868016a070468599145728dd31cf66158 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 23 Mar 2019 20:33:43 +0100 Subject: revert accidental moving of Features.php --- Zotlabs/Module/Admin/Features.php | 52 ++++++++++++++++++++++++++++++++++++ Zotlabs/Module/Settings/Features.php | 52 ------------------------------------ 2 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 Zotlabs/Module/Admin/Features.php delete mode 100644 Zotlabs/Module/Settings/Features.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin/Features.php b/Zotlabs/Module/Admin/Features.php new file mode 100644 index 000000000..6a3ab104b --- /dev/null +++ b/Zotlabs/Module/Admin/Features.php @@ -0,0 +1,52 @@ + $fdata) { + foreach(array_slice($fdata,1) as $f) { + $k = $f[0]; + if(array_key_exists("feature_$k",$_POST)) + set_pconfig(local_channel(),'feature',$k, (string) $_POST["feature_$k"]); + else + set_pconfig(local_channel(),'feature', $k, ''); + } + } + build_sync_packet(); + return; + } + + function get() { + + $arr = []; + + $features = get_features(false); + + 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(feature_enabled(local_channel(),$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, + '$baseurl' => z_root(), + '$submit' => t('Submit'), + )); + + return $o; + } + +} diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Settings/Features.php deleted file mode 100644 index 6a3ab104b..000000000 --- a/Zotlabs/Module/Settings/Features.php +++ /dev/null @@ -1,52 +0,0 @@ - $fdata) { - foreach(array_slice($fdata,1) as $f) { - $k = $f[0]; - if(array_key_exists("feature_$k",$_POST)) - set_pconfig(local_channel(),'feature',$k, (string) $_POST["feature_$k"]); - else - set_pconfig(local_channel(),'feature', $k, ''); - } - } - build_sync_packet(); - return; - } - - function get() { - - $arr = []; - - $features = get_features(false); - - 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(feature_enabled(local_channel(),$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, - '$baseurl' => z_root(), - '$submit' => t('Submit'), - )); - - return $o; - } - -} -- cgit v1.2.3