protected function buildComments()
 {
     $global_status = $this->app->config->pinhole->global_comment_status;
     if ($global_status === null) {
         $status = $this->photo->comment_status;
     } elseif ($global_status == true) {
         // comments are globally turned on
         $status = $this->app->config->pinhole->default_comment_status;
     } else {
         // comments are globally turned off
         $status = SiteCommentStatus::CLOSED;
     }
     if ($status !== SiteCommentStatus::CLOSED) {
         $comments = $this->photo->getVisibleComments();
         if (count($comments) > 0) {
             $this->ui->getWidget('comments_frame')->visible = true;
             ob_start();
             $div_tag = new SwatHtmlTag('div');
             $div_tag->id = 'comments';
             $div_tag->class = 'photo-comments';
             $div_tag->open();
             $view = SiteViewFactory::get($this->app, 'photo-comment');
             foreach ($comments as $comment) {
                 $view->display($comment);
             }
             $div_tag->close();
             $this->ui->getWidget('comments')->content = ob_get_clean();
         }
         ob_start();
         $this->comment_ui->display();
         $this->ui->getWidget('comments_ui')->content = ob_get_clean();
     }
 }