<?php
-
/**
* Theme settings
*/
use Friendica\App;
use Friendica\Core\Config;
-use Friendica\Core\PConfig;
-use Friendica\Core\System;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\DI;
function theme_content(App $a) {
if (!local_user()) {
return;
}
- $align = PConfig::get(local_user(), 'quattro', 'align' );
- $color = PConfig::get(local_user(), 'quattro', 'color' );
- $tfs = PConfig::get(local_user(),"quattro","tfs");
- $pfs = PConfig::get(local_user(),"quattro","pfs");
+ $align = DI::pConfig()->get(local_user(), 'quattro', 'align' );
+ $color = DI::pConfig()->get(local_user(), 'quattro', 'color' );
+ $tfs = DI::pConfig()->get(local_user(),"quattro","tfs");
+ $pfs = DI::pConfig()->get(local_user(),"quattro","pfs");
return quattro_form($a,$align, $color, $tfs, $pfs);
}
}
if (isset($_POST['quattro-settings-submit'])){
- PConfig::set(local_user(), 'quattro', 'align', $_POST['quattro_align']);
- PConfig::set(local_user(), 'quattro', 'color', $_POST['quattro_color']);
- PConfig::set(local_user(), 'quattro', 'tfs', $_POST['quattro_tfs']);
- PConfig::set(local_user(), 'quattro', 'pfs', $_POST['quattro_pfs']);
+ DI::pConfig()->set(local_user(), 'quattro', 'align', $_POST['quattro_align']);
+ DI::pConfig()->set(local_user(), 'quattro', 'color', $_POST['quattro_color']);
+ DI::pConfig()->set(local_user(), 'quattro', 'tfs', $_POST['quattro_tfs']);
+ DI::pConfig()->set(local_user(), 'quattro', 'pfs', $_POST['quattro_pfs']);
}
}
$pfs = "12";
}
- $t = get_markup_template("theme_settings.tpl" );
- $o .= replace_macros($t, [
- '$submit' => t('Submit'),
- '$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$align' => ['quattro_align', t('Alignment'), $align, '', ['left'=>t('Left'), 'center'=>t('Center')]],
- '$color' => ['quattro_color', t('Color scheme'), $color, '', $colors],
- '$pfs' => ['quattro_pfs', t('Posts font size'), $pfs],
- '$tfs' => ['quattro_tfs', t('Textareas font size'), $tfs],
+ $t = Renderer::getMarkupTemplate("theme_settings.tpl" );
+ $o = Renderer::replaceMacros($t, [
+ '$submit' => L10n::t('Submit'),
+ '$title' => L10n::t("Theme settings"),
+ '$align' => ['quattro_align', L10n::t('Alignment'), $align, '', ['left' => L10n::t('Left'), 'center' => L10n::t('Center')]],
+ '$color' => ['quattro_color', L10n::t('Color scheme'), $color, '', $colors],
+ '$pfs' => ['quattro_pfs', L10n::t('Posts font size'), $pfs],
+ '$tfs' => ['quattro_tfs', L10n::t('Textareas font size'), $tfs],
]);
return $o;
}