X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FGNUsocialPhotos%2Factions%2Feditphoto.php;h=8aa63a06d7b0f34924d1a621f3d33715708996a6;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=34f41a275257840cfdf67c2b825b4619e7881749;hpb=3ad3535cd8d12787d1af95969b9576620abce4a9;p=quix0rs-gnu-social.git diff --git a/plugins/GNUsocialPhotos/actions/editphoto.php b/plugins/GNUsocialPhotos/actions/editphoto.php index 34f41a2752..8aa63a06d7 100644 --- a/plugins/GNUsocialPhotos/actions/editphoto.php +++ b/plugins/GNUsocialPhotos/actions/editphoto.php @@ -36,17 +36,17 @@ class EditphotoAction extends Action { var $user = null; - function prepare($args) + function prepare(array $args=array()) { parent::prepare($args); $args = $this->returnToArgs(); $this->user = common_current_user(); $this->photoid = $args[1]['photoid']; - $this->photo = GNUsocialPhoto::staticGet('id', $this->photoid); + $this->photo = GNUsocialPhoto::getKV('id', $this->photoid); return true; } - function handle($args) + function handle(array $args=array()) { parent::handle($args); if($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -166,7 +166,7 @@ class EditphotoAction extends Action $profile_id = $cur->id; - $album = GNUsocialPhotoAlbum::staticGet('album_id', $this->trimmed('album')); + $album = GNUsocialPhotoAlbum::getKV('album_id', $this->trimmed('album')); if ($album->profile_id != $profile_id) { $this->showForm(_('Error: This is not your album!')); return; @@ -179,8 +179,7 @@ class EditphotoAction extends Action return; } common_redirect('/photo/' . $this->photo->id, '303'); - $this->showForm(_('Success!'), true); - + // common_redirect exits } function deletePhoto() @@ -188,17 +187,16 @@ class EditphotoAction extends Action //For redirection $oldalbum = $this->album_id; - $notice = Notice::staticGet('id', $this->photo->notice_id); + $notice = Notice::getKV('id', $this->photo->notice_id); $this->photo->delete(); if (Event::handle('StartDeleteOwnNotice', array($this->user, $notice))) { - $notice->delete(); + $notice->deleteAs($this->scoped); Event::handle('EndDeleteOwnNotice', array($this->user, $notice)); } $this->showForm(_('Success!')); common_redirect('/' . $this->user->nickname . '/photos/' . $oldalbum, '303'); - return; } }