Ejemplo n.º 1
0
 protected function initCommentStatuses()
 {
     $status = $this->ui->getWidget('comment_status');
     // open
     $option = new SwatOption(SiteCommentStatus::OPEN, PinholePhoto::getCommentStatusTitle(SiteCommentStatus::OPEN));
     $status->addOption($option);
     $status->addContextNote($option, Pinhole::_('Comments can be added by anyone and are immediately visible with ' . 'this photo.'));
     // moderated
     $option = new SwatOption(SiteCommentStatus::MODERATED, PinholePhoto::getCommentStatusTitle(SiteCommentStatus::MODERATED));
     $status->addOption($option);
     $status->addContextNote($option, Pinhole::_('Comments can be added by anyone but must be approved by a site ' . 'photographer before being visible with this photo.'));
     // locked
     $option = new SwatOption(SiteCommentStatus::LOCKED, PinholePhoto::getCommentStatusTitle(SiteCommentStatus::LOCKED));
     $status->addOption($option);
     $status->addContextNote($option, Pinhole::_('Comments can only be added by a photographer. Existing comments are ' . 'still visible with this photo.'));
     // closed
     $option = new SwatOption(SiteCommentStatus::CLOSED, PinholePhoto::getCommentStatusTitle(SiteCommentStatus::CLOSED));
     $status->addOption($option);
     $status->addContextNote($option, Pinhole::_('Comments can only be added by a photographer. No comments are visible ' . 'with this photo.'));
     if ($this->id === null) {
         switch ($this->app->config->pinhole->default_comment_status) {
             case 'open':
                 $status->value = SiteCommentStatus::OPEN;
                 break;
             case 'moderated':
                 $status->value = SiteCommentStatus::MODERATED;
                 break;
             case 'locked':
                 $status->value = SiteCommentStatus::LOCKED;
                 break;
             case 'closed':
             default:
                 $status->value = SiteCommentStatus::CLOSED;
                 break;
         }
     }
 }