Skip to content

Commit

Permalink
Confirmed v2 compatibility. Fixed up README. Added v3 logoff/on requi…
Browse files Browse the repository at this point in the history
…rement for v3.x
  • Loading branch information
jbrule committed Sep 11, 2017
1 parent f88a9cf commit 5b7263d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
5 changes: 5 additions & 0 deletions AdminNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public function settingsChangedV3($settings){
public function setNotificationV3(){
//Known issue. The alert notification is not updated until login/logout on v3.x.

//2.X Compatibility. This method appears to be getting called in v2.X which I didn't believe would trigger the newer hooks.
if(!class_exists('\Piwik\Settings\Plugin\SystemSettings')){ //If class doesn't exist just get out.
return;
}

$settings = new SystemSettings();
//print_r($settings->enabled->getValue());

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#Piwik AdminNotification Plugin
##Description
# Piwik AdminNotification Plugin
## Description
Adds the ability for Piwik administrators to include an informative message on all users' dashboards. This may be useful for communicating with users in larger shared environments. In our setup we were tracking 1,900 websites with 250 users. This is a solution we wrote to allow us to easily inform our users of maintainance windows.

##Instructions
## Instructions
The easiest way to install is to find the plugin in the [Piwik Marketplace](http://plugins.piwik.org/).

##Changelog
3.0.0 Piwik v3 compatible.
0.1.2 Tested with Piwik v2.15 and included new registerEvents() hook for compatibility with Piwik 3.0
0.1.1 Cleanup. Removed plugin template verbiage from code files.
0.1.0 Initial Release
## Changelog
* 3.0.0 Piwik v3 compatible. Effort was made to maintain backwords compatibility. This should work all the way back to 2.12.x
* 4.0.1.2 Tested with Piwik v2.15 and included new registerEvents() hook for compatibility with Piwik 3.0
* 5.0.1.1 Cleanup. Removed plugin template verbiage from code files.
* 0.1.0 Initial Release

##Known Issues
v3.0.0 Display/Update of notification required logout/login to see change. (Notification API not working as expected during tests)
## Known Issues
* v3.0.0 Display/Update of notification requires logout/login to see change. (Notification API not working as expected during tests)

##License
GPL v3 / fair use

## Support
Please [report any issues](https://github.com/jbrule/piwikplugin-AdminNotification/issues). Pull requests welcome.
Please [report any issues](https://github.com/jbrule/piwikplugin-AdminNotification/issues). Pull requests welcome.
5 changes: 1 addition & 4 deletions SystemSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings
public $messageTitle;

/** @var Setting */
public $description;

/** @var Setting */
public $password;
public $message;

protected function init()
{
Expand Down
2 changes: 1 addition & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"AdminNotification": {
"PluginDescription": "Places a message on all user's dashboards.",
"EnabledSettingTitle": "Enabled",
"EnabledSettingDescription": " If enabled, the provided message will be displayed to users upon login.",
"EnabledSettingDescription": "If enabled, the provided message will be displayed to users upon login. (Logoff/Logon required in v3.x)",
"MessageSettingTitle": "Message",
"MessageSettingDescription": "Message to display to users",
"ContextSettingTitle": "Context",
Expand Down
2 changes: 1 addition & 1 deletion lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"AdminNotification": {
"PluginDescription": "Places a message on all user's dashboards.",
"EnabledSettingTitle": "使用可能",
"EnabledSettingDescription": "If enabled, the provided message will be displayed to users upon login.",
"EnabledSettingDescription": "If enabled, the provided message will be displayed to users upon login. (Logoff/Logon required in v3.x)",
"MessageSettingTitle": "メッセージ",
"MessageSettingDescription": "Message to display to users",
"ContextSettingTitle": "コンテキスト",
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"homepage": "https:\/\/github.com\/jbrule\/piwikplugin-AdminNotification",
"theme": false,
"require": {
"piwik": ">=3.0.4-stable,<4.0.0-b1"
"piwik": ">=2.12.0,<4.0.0-b1"
},
"authors": [
{
Expand Down

0 comments on commit 5b7263d

Please sign in to comment.