markdownsettings.php 771 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. if (!defined('GNUSOCIAL')) {
  3. exit(1);
  4. }
  5. class MarkdownSettingsAction extends SettingsAction
  6. {
  7. protected function doPost()
  8. {
  9. $currentUser = common_current_user();
  10. $isEnabled = $this->boolean('enabled', false);
  11. // Let it throw UserNoProfileException if it wants to;
  12. // there's no way for us to handle this anyway.
  13. $currentProfile = $currentProfile = $currentUser->getProfile();
  14. Profile_prefs::setData($currentProfile, MarkdownPlugin::NAME_SPACE, 'enabled', $isEnabled);
  15. return _('Settings saved.');
  16. }
  17. function title()
  18. {
  19. return _m('Markdown Settings');
  20. }
  21. function showContent()
  22. {
  23. $form = new MarkdownSettingsForm($this);
  24. $form->show();
  25. }
  26. }