/** * Set photo's 'is featured' status * * @param array $params * @throws Redirect404Exception * @return array */ public function ajaxSetFeaturedStatus(array $params) { $photoId = $params['photoId']; $status = $params['status']; $isModerator = OW::getUser()->isAuthorized('photo'); if (!$isModerator) { throw new Redirect404Exception(); } $setResult = $this->photoService->updatePhotoFeaturedStatus($photoId, $status); if ($setResult) { $return = array('result' => true, 'msg' => OW::getLanguage()->text('photo', 'status_changed')); } else { $return = array('result' => false, 'error' => OW::getLanguage()->text('photo', 'status_not_changed')); } return $return; }