diff --git a/docs/en/configuring.md b/docs/en/configuring.md index 641a4066..90e5f9a7 100644 --- a/docs/en/configuring.md +++ b/docs/en/configuring.md @@ -39,6 +39,8 @@ php-censor: log: rotate: true max_files: 10 + notifications: + enabled: false # notify.js notifications to browser ssh: strength: 4096 # SSH keys strength (default: 2048) comment: admin@php-censor.info # SSH keys comment (default: admin@php-censor) diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 04293ff3..644d7974 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -164,13 +164,15 @@ var PHPCensor = { error: PHPCensor.handleFailedAjax }); - $.ajax({ - url: APP_URL + 'web-notifications/builds-updated', - success: function (data) { - PHPCensor.showWebNotification(data); - }, - error: PHPCensor.handleFailedAjax - }); + if (NOTIFICATIONS) { + $.ajax({ + url: APP_URL + 'web-notifications/builds-updated', + success: function (data) { + PHPCensor.showWebNotification(data); + }, + error: PHPCensor.handleFailedAjax + }); + } }, getProjectBuilds: function () { diff --git a/public/assets/js/dashboard-widgets/all_projects.js b/public/assets/js/dashboard-widgets/all_projects.js index 1f767a57..938e5ffa 100644 --- a/public/assets/js/dashboard-widgets/all_projects.js +++ b/public/assets/js/dashboard-widgets/all_projects.js @@ -34,15 +34,17 @@ PHPCensor.widgets.allProjects = { error: PHPCensor.handleFailedAjax }); - $.ajax({ - url: APP_URL + + if (NOTIFICATIONS) { + $.ajax({ + url: APP_URL + 'web-notifications/widgets-all-projects-update/' + - projectId, - success: function (data) { - PHPCensor.showWebNotification(data); - }, - error: PHPCensor.handleFailedAjax - }); + projectId, + success: function (data) { + PHPCensor.showWebNotification(data); + }, + error: PHPCensor.handleFailedAjax + }); + } }); } }; diff --git a/src/Command/InstallCommand.php b/src/Command/InstallCommand.php index 326a383f..0c4bd76c 100644 --- a/src/Command/InstallCommand.php +++ b/src/Command/InstallCommand.php @@ -258,13 +258,16 @@ class InstallCommand extends Command 'rotate' => false, 'max_files' => 0, ], + 'notifications' => [ + 'enabled' => false, + ], 'email_settings' => [ - 'from_address' => 'PHP Censor ', - 'smtp_address' => null, - 'smtp_port' => null, - 'smtp_username' => null, - 'smtp_password' => null, - 'smtp_encryption' => false, + 'from_address' => 'PHP Censor ', + 'smtp_address' => null, + 'smtp_port' => null, + 'smtp_username' => null, + 'smtp_password' => null, + 'smtp_encryption' => false, ], 'ssh' => [ 'strength' => 2048, diff --git a/src/View/layout.phtml b/src/View/layout.phtml index ab87d790..6a9f2f65 100644 --- a/src/View/layout.phtml +++ b/src/View/layout.phtml @@ -2,8 +2,20 @@ use PHPCensor\Helper\Lang; +/** + * @var \PHPCensor\Model\User $user + */ $user = $this->getUser(); +/** + * @var string $title + * @var string $subtitle + * @var string $version + * @var string $content + * @var string $skin + * @var bool $notifications + */ + ?> @@ -35,7 +47,8 @@ $user = $this->getUser();