public function findAction() { if ($value_id = $this->getRequest()->getParam('value_id') and $comment_id = $this->getRequest()->getParam('comment_id')) { $application = $this->getApplication(); $comment = new Comment_Model_Comment(); $comment->find($comment_id); $option = $this->getCurrentOptionValue(); if ($comment->getId() and $comment->getValueId() == $value_id) { $customer = $comment->getCustomer(); $color = $application->getBlock('background')->getColor(); $cleaned_message = str_replace(array("\n", "\r"), "", html_entity_decode(strip_tags($comment->getText()), ENT_QUOTES, 'UTF-8')); switch ($this->getCurrentOptionValue()->getLayoutId()) { case 2: $data = array("id" => $comment->getId(), "author" => $customer->getFirstname() ? $customer->getFirstname() : $application->getName(), "title" => $comment->getTitle(), "subtitle" => $comment->getSubtitle(), "message" => $comment->getText(), "cleaned_message" => mb_strlen($cleaned_message) > 67 ? mb_substr($cleaned_message, 0, 64) . "..." : $cleaned_message, "picture" => $comment->getImageUrl(), "created_at" => $comment->getFormattedDate($this->_("MM.dd.y")), "code" => $this->getCurrentOptionValue()->getCode(), "social_sharing_active" => $option->getSocialSharingIsActive()); break; case 1: default: $data = array("id" => $comment->getId(), "author" => $customer->getFirstname() ? $customer->getFirstname() : $application->getName(), "message" => $comment->getText(), "cleaned_message" => mb_strlen($cleaned_message) > 67 ? mb_substr($cleaned_message, 0, 64) . "..." : $cleaned_message, "picture" => $comment->getImageUrl(), "icon" => $application->getIcon(74), "can_comment" => true, "created_at" => $this->_durationSince($comment->getCreatedAt()), "number_of_likes" => count($comment->getLikes()), "flag_icon" => $this->_getColorizedImage($this->_getImage("pictos/flag.png"), $color), "code" => $this->getCurrentOptionValue()->getCode(), "social_sharing_active" => $option->getSocialSharingIsActive()); break; } $this->_sendHtml($data); } } }