Пример #1
0
 protected function initCommentStatuses()
 {
     $status = $this->ui->getWidget('blorg_default_comment_status');
     // open
     $option = new SwatOption(SiteCommentStatus::OPEN, BlorgPost::getCommentStatusTitle(SiteCommentStatus::OPEN));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can be added by anyone and are immediately visible on ' . 'this post.'));
     // moderated
     $option = new SwatOption(SiteCommentStatus::MODERATED, BlorgPost::getCommentStatusTitle(SiteCommentStatus::MODERATED));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can be added by anyone but must be approved by a site ' . 'author before being visible on this post.'));
     // locked
     $option = new SwatOption(SiteCommentStatus::LOCKED, BlorgPost::getCommentStatusTitle(SiteCommentStatus::LOCKED));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can only be added by an author. Existing comments are ' . 'still visible on this post.'));
     // closed
     $option = new SwatOption(SiteCommentStatus::CLOSED, BlorgPost::getCommentStatusTitle(SiteCommentStatus::CLOSED));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can only be added by an author. No comments are visible ' . 'on this post.'));
 }
Пример #2
0
 protected function initCommentStatuses()
 {
     $status = $this->ui->getWidget('comment_status');
     // open
     $option = new SwatOption(SiteCommentStatus::OPEN, BlorgPost::getCommentStatusTitle(SiteCommentStatus::OPEN));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can be added by anyone and are immediately visible on ' . 'this post.'));
     // moderated
     $option = new SwatOption(SiteCommentStatus::MODERATED, BlorgPost::getCommentStatusTitle(SiteCommentStatus::MODERATED));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can be added by anyone but must be approved by a site ' . 'author before being visible on this post.'));
     // locked
     $option = new SwatOption(SiteCommentStatus::LOCKED, BlorgPost::getCommentStatusTitle(SiteCommentStatus::LOCKED));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can only be added by an author. Existing comments are ' . 'still visible on this post.'));
     // closed
     $option = new SwatOption(SiteCommentStatus::CLOSED, BlorgPost::getCommentStatusTitle(SiteCommentStatus::CLOSED));
     $status->addOption($option);
     $status->addContextNote($option, Blorg::_('Comments can only be added by an author. No comments are visible ' . 'on this post.'));
     if ($this->id === null) {
         switch ($this->app->config->blorg->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;
         }
     }
 }
Пример #3
0
 protected function buildDetailsBlorgDefaultCommentStatus(SwatDetailsStore $ds)
 {
     switch ($this->app->config->blorg->default_comment_status) {
         case 'open':
             $value = SiteCommentStatus::OPEN;
             break;
         case 'moderated':
             $value = SiteCommentStatus::MODERATED;
             break;
         case 'locked':
             $value = SiteCommentStatus::LOCKED;
             break;
         case 'closed':
         default:
             $value = SiteCommentStatus::CLOSED;
             break;
     }
     $title = BlorgPost::getCommentStatusTitle($value);
     $ds->blorg_default_comment_status = $title;
 }
Пример #4
0
 protected function getPostDetailsStore()
 {
     $store = new SwatDetailsStore($this->post);
     $store->has_modified_date = $this->post->modified_date !== null;
     $store->comment_status_title = BlorgPost::getCommentStatusTitle($this->post->comment_status);
     ob_start();
     $this->displayTags();
     $store->tags_summary = ob_get_clean();
     return $store;
 }