aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Admin/Features.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-24 09:58:21 +0000
committerMario <mario@mariovavti.com>2024-03-24 09:58:21 +0000
commita0cfe22501dc9daa7dd8cff86803cf494a1f5ec3 (patch)
treee156db21df2251b8c67e61453c8f4af9f9460d2f /Zotlabs/Module/Admin/Features.php
parentecdd9a4d6edd769a3e2c3b0604e4637d94fa1a51 (diff)
parent0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 (diff)
downloadvolse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.tar.gz
volse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.tar.bz2
volse-hubzilla-a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3.zip
Merge branch 'deprecate-include-config-in-core' into 'dev'
Deprecate *_config() functions in core. See merge request hubzilla/core!2114
Diffstat (limited to 'Zotlabs/Module/Admin/Features.php')
-rw-r--r--Zotlabs/Module/Admin/Features.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/Zotlabs/Module/Admin/Features.php b/Zotlabs/Module/Admin/Features.php
index 504caae79..e0b3a3fd4 100644
--- a/Zotlabs/Module/Admin/Features.php
+++ b/Zotlabs/Module/Admin/Features.php
@@ -2,53 +2,53 @@
namespace Zotlabs\Module\Admin;
-
+use Zotlabs\Lib\Config;
class Features {
-
+
function post() {
-
+
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
-
+
logger('postvars: ' . print_r($_POST,true));
-
+
$arr = array();
$features = get_features(false);
-
+
foreach($features as $fname => $fdata) {
foreach(array_slice($fdata,1) as $f) {
$feature = $f[0];
-
+
if(array_key_exists('feature_' . $feature,$_POST))
$val = intval($_POST['feature_' . $feature]);
else
$val = 0;
- set_config('feature',$feature,$val);
-
+ Config::Set('feature',$feature,$val);
+
if(array_key_exists('featurelock_' . $feature,$_POST))
- set_config('feature_lock',$feature,$val);
+ Config::Set('feature_lock',$feature,$val);
else
- del_config('feature_lock',$feature);
+ Config::Delete('feature_lock',$feature);
}
}
-
+
goaway(z_root() . '/admin/features' );
-
+
}
-
+
function get() {
-
+
if((argc() > 1) && (argv(1) === 'features')) {
$arr = array();
$features = get_features(false);
-
+
foreach($features as $fname => $fdata) {
$arr[$fname] = array();
$arr[$fname][0] = $fdata[0];
foreach(array_slice($fdata,1) as $f) {
-
- $set = get_config('feature',$f[0]);
+
+ $set = Config::Get('feature',$f[0]);
if($set === false)
$set = $f[3];
$arr[$fname][1][] = array(
@@ -57,7 +57,7 @@ class Features {
);
}
}
-
+
$tpl = get_markup_template("admin_settings_features.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("admin_manage_features"),
@@ -65,10 +65,10 @@ class Features {
'$features' => $arr,
'$submit' => t('Submit'),
));
-
+
return $o;
}
}
-
-} \ No newline at end of file
+
+}