]> git.mxchange.org Git - friendica-addons.git/blobdiff - gnot/gnot.php
Issue 3873
[friendica-addons.git] / gnot / gnot.php
index fd8fdfd9b973738b1868f69b641a9c1ceff50223..bbdf9d80ebae83e6db5a175e8f1d278986d2470b 100755 (executable)
@@ -8,6 +8,7 @@
  *
  */
 
+use Friendica\Core\PConfig;
 
 function gnot_install() {
 
@@ -44,7 +45,7 @@ function gnot_settings_post($a,$post) {
        if(! local_user() || (! x($_POST,'gnot-submit')))
                return;
 
-       set_pconfig(local_user(),'gnot','enable',intval($_POST['gnot']));
+       PConfig::set(local_user(),'gnot','enable',intval($_POST['gnot']));
        info( t('Gnot settings updated.') . EOL);
 }
 
@@ -69,7 +70,7 @@ function gnot_settings(&$a,&$s) {
 
        /* Get the current state of our config variable */
 
-       $gnot = intval(get_pconfig(local_user(),'gnot','enable'));
+       $gnot = intval(PConfig::get(local_user(),'gnot','enable'));
 
        $gnot_checked = (($gnot) ? ' checked="checked" ' : '' );
        
@@ -85,13 +86,13 @@ function gnot_settings(&$a,&$s) {
 
        /* provide a submit button */
 
-       $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="gnot-submit" class="settings-submit" value="' . t('Submit') . '" /></div></div>';
+       $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="gnot-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
 
 }
 
 
 function gnot_enotify_mail(&$a,&$b) {
-       if((! $b['uid']) || (! intval(get_pconfig($b['uid'], 'gnot','enable'))))
+       if((! $b['uid']) || (! intval(PConfig::get($b['uid'], 'gnot','enable'))))
                return;
        if($b['type'] == NOTIFY_COMMENT)
                $b['subject'] = sprintf( t('[Friendica:Notify] Comment to conversation #%d'), $b['parent']);