]> git.mxchange.org Git - friendica-addons.git/blobdiff - mailstream/mailstream.php
mailstream: foldable settings
[friendica-addons.git] / mailstream / mailstream.php
index 061b0090232b515265931ecb87316e3fad0e8ee8..5e4767841ee87d710755cb9962c8cfb35b123a1c 100644 (file)
@@ -57,7 +57,7 @@ function mailstream_plugin_admin(&$a,&$o) {
                     t('Email address that stream items will appear to be from.'));
     $o .= replace_macros($template, array(
                              '$frommail' => $config,
-                             '$submit' => t('Submit')));
+                             '$submit' => t('Save Settings')));
 }
 
 function mailstream_plugin_admin_post ($a) {
@@ -74,7 +74,7 @@ function mailstream_generate_id($a, $uri) {
 }
 
 function mailstream_post_remote_hook(&$a, &$item) {
-    if (get_pconfig($item['uid'], 'mailstream', 'enabled') !== 'on') {
+    if (!get_pconfig($item['uid'], 'mailstream', 'enabled')) {
         return;
     }
     if (!$item['uid']) {
@@ -266,7 +266,6 @@ function mailstream_cron($a, $b) {
 
 function mailstream_plugin_settings(&$a,&$s) {
     $enabled = get_pconfig(local_user(), 'mailstream', 'enabled');
-    $enabled_mu = ($enabled === 'on') ? ' checked="true"' : '';
     $address = get_pconfig(local_user(), 'mailstream', 'address');
     $template = get_markup_template('settings.tpl', 'addon/mailstream/');
     $s .= replace_macros($template, array(
@@ -280,18 +279,18 @@ function mailstream_plugin_settings(&$a,&$s) {
                                  t('Enabled'),
                                  $enabled),
                              '$title' => t('Mail Stream Settings'),
-                             '$submit' => t('Submit')));
+                             '$submit' => t('Save Settings')));
 }
 
 function mailstream_plugin_settings_post($a,$post) {
-    if ($_POST['address'] != "") {
-        set_pconfig(local_user(), 'mailstream', 'address', $_POST['address']);
+    if ($_POST['mailstream_address'] != "") {
+        set_pconfig(local_user(), 'mailstream', 'address', $_POST['mailstream_address']);
     }
     else {
         del_pconfig(local_user(), 'mailstream', 'address');
     }
-    if ($_POST['enabled']) {
-        set_pconfig(local_user(), 'mailstream', 'enabled', $_POST['enabled']);
+    if ($_POST['mailstream_enabled']) {
+        set_pconfig(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']);
     }
     else {
         del_pconfig(local_user(), 'mailstream', 'enabled');