]> git.mxchange.org Git - friendica-addons.git/blobdiff - notimeline/notimeline.php
Merge pull request #478 from friendica/revert-477-revert-475-task/4041-fix-register
[friendica-addons.git] / notimeline / notimeline.php
index 7e26bf92ab4832255fd092a6aa2db05f0381ca9e..dcf9693542f38cd065a8932ad9695bb9b98d0b22 100644 (file)
@@ -8,6 +8,7 @@
  *
  */
 
+use Friendica\Core\PConfig;
 
 function notimeline_install() {
 
@@ -28,14 +29,15 @@ function notimeline_settings_post($a,$post) {
        if(! local_user() || (! x($_POST,'notimeline-submit')))
                return;
 
-       set_pconfig(local_user(),'system','no_wall_archive_widget',intval($_POST['notimeline']));
+       PConfig::set(local_user(),'system','no_wall_archive_widget',intval($_POST['notimeline']));
        info( t('No Timeline settings updated.') . EOL);
 }
 
-function notimeline_settings(&$a,&$s) {
-
-       if(! local_user())
+function notimeline_settings(&$a, &$s)
+{
+       if (! local_user()) {
                return;
+       }
 
        /* Add our stylesheet to the page so we can make our settings look nice */
 
@@ -43,9 +45,7 @@ function notimeline_settings(&$a,&$s) {
 
        /* Get the current state of our config variable */
 
-       $notimeline = get_pconfig(local_user(),'system','no_wall_archive_widget');
-       if($notimeline === false)
-               $notimeline = false;
+       $notimeline = PConfig::get(local_user(), 'system', 'no_wall_archive_widget', false);
 
        $notimeline_checked = (($notimeline) ? ' checked="checked" ' : '');
 
@@ -61,6 +61,5 @@ function notimeline_settings(&$a,&$s) {
 
        /* provide a submit button */
 
-       $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="notimeline-submit" class="settings-submit" value="' . t('Submit') . '" /></div></div>';
-
+       $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="notimeline-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
 }