Пример #1
0
 public function findallAction()
 {
     if ($value_id = $this->getRequest()->getParam('value_id')) {
         $application = $this->getApplication();
         $comment = new Comment_Model_Comment();
         $comments = $comment->findLastest($value_id);
         $color = $application->getBlock('background')->getColor();
         $data = array("news" => array(), "application" => array());
         foreach ($comments as $comment) {
             $data['news'][] = array("text" => Core_Model_Lib_String::truncate($comment->getText(), 88), "created_at" => $comments->getFormattedCreatedAt(), "number_of_comments" => count($comment->getAnswers()), "number_of_likes" => count($comment->getLikes()));
         }
         $data['application'] = array("icon_url" => $application->getIconUrl(74), "name" => $application->getName());
         $data['picto'] = array("pencil" => $this->_getColorizedImage($this->getImage("picto/pencil.png"), $color), "comment" => $this->_getColorizedImage($this->getImage("picto/comment.png"), $color), "like" => $this->_getColorizedImage($this->getImage("picto/like.png"), $color));
         $this->_sendHtml($data);
     }
 }