Kaldari has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/56536


Change subject: Pref for showing notifications
......................................................................

Pref for showing notifications

Change-Id: If21f3aac51e484c5e077c7f4b5a2218e8b71ed2a
---
M Echo.i18n.php
M Hooks.php
M special/SpecialNotifications.php
3 files changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/36/56536/1

diff --git a/Echo.i18n.php b/Echo.i18n.php
index 395a9e2..43ce264 100644
--- a/Echo.i18n.php
+++ b/Echo.i18n.php
@@ -27,6 +27,7 @@
        'echo-pref-email-frequency-daily' => 'A daily summary of notifications',
        'echo-pref-email-frequency-weekly' => 'A weekly summary of 
notifications',
        'echo-pref-notify-hide-link' => 'Hide the link and badge for 
notifications in my toolbar',
+       'echo-pref-notify-show-link' => 'Show the link and badge for 
notifications in my toolbar',
 
        // Dismiss interface
        'echo-dismiss-button' => 'Dismiss',
@@ -225,6 +226,7 @@
        'echo-pref-email-frequency-daily' => 'Option for users who want to 
receive a daily digest of email notifications',
        'echo-pref-email-frequency-weekly' => 'Option for users who want to 
receive a weekly digest of email notifications',
        'echo-pref-notify-hide-link' => "Label for a preference which disables 
the 'Notifications' link in the header and associated fly-out panel",
+       'echo-pref-notify-show-link' => "Label for a preference which enables 
the 'Notifications' link in the header and associated fly-out panel",
        'echo-dismiss-button' => 'Text for the button that dismisses a 
notification type. Keep this short.
 {{Identical|Dismiss}}',
        'echo-dismiss-message' => 'Message asking the user if they want to turn 
off all notifications of a certain type. Parameters:
diff --git a/Hooks.php b/Hooks.php
index 9c40549..783a15b 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -368,6 +368,13 @@
                        'columns' => $columns,
                        'remove-options' => $removeOptions,
                );
+
+               // Show fly-out display prefs
+               $preferences['echo-notify-show-link'] = array(
+                       'type' => 'toggle',
+                       'label-message' => 'echo-pref-notify-show-link',
+                       'section' => 'echo/displaynotifications',
+               );
                return true;
        }
 
@@ -620,11 +627,13 @@
                global $wgUser, $wgEchoNotifications;
                // If the user has the notifications flyout turned on and is 
receiving
                // notifications for talk page messages, disable the 
yellow-bar-style notice.
-               if ( !$wgUser->getOption( 'echo-notify-hide-link' )
-                       && isset( $wgEchoNotifications['edit-user-talk'] ) )
-               {
+               if ( $wgUser->getOption( 'echo-notify-show-link' )
+                       && isset( $wgEchoNotifications['edit-user-talk'] )
+               ) {
+                       // hide yellow bar
                        return false;
                } else {
+                       // show yellow bar
                        return true;
                }
        }
diff --git a/special/SpecialNotifications.php b/special/SpecialNotifications.php
index 863b9ef..0ce4a64 100644
--- a/special/SpecialNotifications.php
+++ b/special/SpecialNotifications.php
@@ -49,6 +49,7 @@
                        $out->addWikiMsg( 'echo-none' );
                        return;
                }
+               var_dump(!$user->getOption( 'echo-notify-hide-link' ));
 
                // The timestamp and offset to pull next set of data from
                $nextTimestamp = $nextOffset = 0;

-- 
To view, visit https://gerrit.wikimedia.org/r/56536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If21f3aac51e484c5e077c7f4b5a2218e8b71ed2a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to