browsernotificationssettings.php 660 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. defined('GNUSOCIAL') || die();
  3. class BrowserNotificationsSettingsAction extends SettingsAction
  4. {
  5. protected function doPost()
  6. {
  7. $settings = array(
  8. 'enabled' => $this->boolean('enabled', false),
  9. 'mentions_only' => $this->boolean('mentions_only', false)
  10. );
  11. BrowserNotificationSettings::save(common_current_user(), $settings);
  12. return _m('Settings saved.');
  13. }
  14. public function title()
  15. {
  16. return _m('Browser Notifications Settings');
  17. }
  18. public function showContent()
  19. {
  20. $form = new BrowserNotificationsSettingsForm($this);
  21. $form->show();
  22. }
  23. }