X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FAdmin%2FFeatures.php;h=328e7e68b57c1e2d91d5c3fa32df7972a995d6be;hb=3c7e4b474b8f219b7ddacfd2c948d49628aafa81;hp=cb9acf4eb1acdbab8d70dfe66673df18fd8aec2d;hpb=451a06a597fcb1c62bfb2dd61353df15234a8d6b;p=friendica.git diff --git a/src/Module/Admin/Features.php b/src/Module/Admin/Features.php index cb9acf4eb1..328e7e68b5 100644 --- a/src/Module/Admin/Features.php +++ b/src/Module/Admin/Features.php @@ -1,74 +1,74 @@ - $fdata) { - foreach (array_slice($fdata, 1) as $f) { - $feature = $f[0]; - $feature_state = 'feature_' . $feature; - $featurelock = 'featurelock_' . $feature; - - if (!empty($_POST[$feature_state])) { - $val = intval($_POST[$feature_state]); - } else { - $val = 0; - } - Config::set('feature', $feature, $val); - - if (!empty($_POST[$featurelock])) { - Config::set('feature_lock', $feature, $val); - } else { - Config::delete('feature_lock', $feature); - } - } - } - - self::getApp()->internalRedirect('admin/features'); - } - - public static function content() - { - parent::content(); - - $arr = []; - $features = Feature::get(false); - - foreach ($features as $fname => $fdata) { - $arr[$fname] = []; - $arr[$fname][0] = $fdata[0]; - foreach (array_slice($fdata, 1) as $f) { - $set = Config::get('feature', $f[0], $f[3]); - $arr[$fname][1][] = [ - ['feature_' . $f[0], $f[1], $set, $f[2], [L10n::t('Off'), L10n::t('On')]], - ['featurelock_' . $f[0], L10n::t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [L10n::t('Off'), L10n::t('On')]] - ]; - } - } - - $tpl = Renderer::getMarkupTemplate('admin/features.tpl'); - $o = Renderer::replaceMacros($tpl, [ - '$form_security_token' => parent::getFormSecurityToken("admin_manage_features"), - '$title' => L10n::t('Manage Additional Features'), - '$features' => $arr, - '$submit' => L10n::t('Save Settings'), - ]); - - return $o; - } -} \ No newline at end of file + $fdata) { + foreach (array_slice($fdata, 1) as $f) { + $feature = $f[0]; + $feature_state = 'feature_' . $feature; + $featurelock = 'featurelock_' . $feature; + + if (!empty($_POST[$feature_state])) { + $val = intval($_POST[$feature_state]); + } else { + $val = 0; + } + Config::set('feature', $feature, $val); + + if (!empty($_POST[$featurelock])) { + Config::set('feature_lock', $feature, $val); + } else { + Config::delete('feature_lock', $feature); + } + } + } + + self::getApp()->internalRedirect('admin/features'); + } + + public static function content() + { + parent::content(); + + $arr = []; + $features = Feature::get(false); + + foreach ($features as $fname => $fdata) { + $arr[$fname] = []; + $arr[$fname][0] = $fdata[0]; + foreach (array_slice($fdata, 1) as $f) { + $set = Config::get('feature', $f[0], $f[3]); + $arr[$fname][1][] = [ + ['feature_' . $f[0], $f[1], $set, $f[2], [L10n::t('Off'), L10n::t('On')]], + ['featurelock_' . $f[0], L10n::t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [L10n::t('Off'), L10n::t('On')]] + ]; + } + } + + $tpl = Renderer::getMarkupTemplate('admin/features.tpl'); + $o = Renderer::replaceMacros($tpl, [ + '$form_security_token' => parent::getFormSecurityToken("admin_manage_features"), + '$title' => L10n::t('Manage Additional Features'), + '$features' => $arr, + '$submit' => L10n::t('Save Settings'), + ]); + + return $o; + } +}