profiledetail.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * StatusNet - the distributed open-source microblogging tool
  4. * Copyright (C) 2011, StatusNet, Inc.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. if (!defined('STATUSNET')) {
  20. exit(1);
  21. }
  22. class ProfileDetailAction extends ShowstreamAction
  23. {
  24. function isReadOnly($args)
  25. {
  26. return true;
  27. }
  28. function title()
  29. {
  30. return $this->profile->getFancyName();
  31. }
  32. function showStylesheets() {
  33. parent::showStylesheets();
  34. $this->cssLink('plugins/ExtendedProfile/css/profiledetail.css');
  35. return true;
  36. }
  37. function showContent()
  38. {
  39. $cur = common_current_user();
  40. if ($cur && $cur->id == $this->profile->id) { // your own page
  41. $this->elementStart('div', 'entity_actions');
  42. $this->elementStart('ul');
  43. $this->elementStart('li', 'entity_edit');
  44. $this->element('a', array('href' => common_local_url('profiledetailsettings'),
  45. // TRANS: Link title for link on user profile.
  46. 'title' => _m('Edit extended profile settings')),
  47. // TRANS: Link text for link on user profile.
  48. _m('Edit'));
  49. $this->elementEnd('li');
  50. $this->elementEnd('ul');
  51. $this->elementEnd('div');
  52. }
  53. $widget = new ExtendedProfileWidget($this, $this->profile);
  54. $widget->show();
  55. }
  56. }