bookmarkpopup.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * StatusNet, the distributed open-source microblogging tool
  4. *
  5. * Post a new bookmark in a popup window
  6. *
  7. * PHP version 5
  8. *
  9. * LICENCE: This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. * @category Bookmark
  23. * @package StatusNet
  24. * @author Sarven Capadisli <csarven@status.net>
  25. * @author Evan Prodromou <evan@status.net>
  26. * @copyright 2008-2010 StatusNet, Inc.
  27. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  28. * @link http://status.net/
  29. */
  30. if (!defined('STATUSNET')) {
  31. exit(1);
  32. }
  33. /**
  34. * Action for posting a new bookmark
  35. *
  36. * @category Bookmark
  37. * @package StatusNet
  38. * @author Sarven Capadisli <csarven@status.net>
  39. * @author Evan Prodromou <evan@status.net>
  40. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  41. * @link http://status.net/
  42. */
  43. class BookmarkpopupAction extends NewbookmarkAction
  44. {
  45. /**
  46. * Show the title section of the window
  47. *
  48. * @return void
  49. */
  50. function showTitle()
  51. {
  52. $this->element('title',
  53. // TRANS: Title for mini-posting window loaded from bookmarklet.
  54. // TRANS: %s is the StatusNet site name.
  55. null, sprintf(_m('Bookmark on %s'),
  56. common_config('site', 'name')));
  57. }
  58. /**
  59. * Show the header section of the page
  60. *
  61. * Shows a stub page and the bookmark form.
  62. *
  63. * @return void
  64. */
  65. function showHeader()
  66. {
  67. $this->elementStart('div', array('id' => 'header'));
  68. $this->elementStart('address');
  69. $this->element('a', array('class' => 'url',
  70. 'href' => common_local_url('top')),
  71. '');
  72. $this->elementEnd('address');
  73. if (common_logged_in()) {
  74. $form = new BookmarkForm($this,
  75. $this->title,
  76. $this->url);
  77. $form->show();
  78. }
  79. $this->elementEnd('div');
  80. }
  81. /**
  82. * Hide the core section of the page
  83. *
  84. * @return void
  85. */
  86. function showCore()
  87. {
  88. }
  89. /**
  90. * Hide the footer section of the page
  91. *
  92. * @return void
  93. */
  94. function showFooter()
  95. {
  96. }
  97. function showScripts()
  98. {
  99. parent::showScripts();
  100. $this->script(Plugin::staticPath('Bookmark', 'bookmarkpopup.js'));
  101. }
  102. }