X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FBookmark%2Fshowbookmark.php;h=1c562d52a8503e28e3f00aee9aec05ea4e455375;hb=b6cfcfbcaa0459b39c5d581c103bfa031b2e02cd;hp=6bebffb68e2e81710ed96ede63b9752acbae2073;hpb=6455461c196fcb8e7c0047870d480e4a97986709;p=quix0rs-gnu-social.git diff --git a/plugins/Bookmark/showbookmark.php b/plugins/Bookmark/showbookmark.php index 6bebffb68e..1c562d52a8 100644 --- a/plugins/Bookmark/showbookmark.php +++ b/plugins/Bookmark/showbookmark.php @@ -44,53 +44,30 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class ShowbookmarkAction extends ShownoticeAction { protected $bookmark = null; - /** - * For initializing members of the class. - * - * @param array $argarray misc. arguments - * - * @return boolean true - */ - - function prepare($argarray) + function getNotice() { - OwnerDesignAction::prepare($argarray); - $this->id = $this->trimmed('id'); - $this->bookmark = Bookmark::staticGet('id', $this->id); + $this->bookmark = Bookmark::getKV('id', $this->id); if (empty($this->bookmark)) { - throw new ClientException(_('No such bookmark.'), 404); + // TRANS: Client exception thrown when referring to a non-existing bookmark. + throw new ClientException(_m('No such bookmark.'), 404); } - $this->notice = Notice::staticGet('uri', $this->bookmark->uri); + $notice = Notice::getKV('uri', $this->bookmark->uri); - if (empty($this->notice)) { + if (empty($notice)) { // Did we used to have it, and it got deleted? - throw new ClientException(_('No such bookmark.'), 404); - } - - $this->user = User::staticGet('id', $this->bookmark->profile_id); - - if (empty($this->user)) { - throw new ClientException(_('No such user.'), 404); - } - - $this->profile = $this->user->getProfile(); - - if (empty($this->profile)) { - throw new ServerException(_('User without a profile.')); + // TRANS: Client exception thrown when referring to a non-existing bookmark. + throw new ClientException(_m('No such bookmark.'), 404); } - $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); - - return true; + return $notice; } /** @@ -100,10 +77,11 @@ class ShowbookmarkAction extends ShownoticeAction * * @return string page tile */ - function title() { - return sprintf(_('%s\'s bookmark for "%s"'), + // TRANS: Title for bookmark. + // TRANS: %1$s is a user nickname, %2$s is a bookmark title. + return sprintf(_m('%1$s\'s bookmark for "%2$s"'), $this->user->nickname, $this->bookmark->title); } @@ -113,7 +91,6 @@ class ShowbookmarkAction extends ShownoticeAction * * @return void */ - function showPageTitle() { $this->elementStart('h1');