コード例 #1
0
 private function buildPropertyView(PhameBlog $blog)
 {
     $viewer = $this->getViewer();
     require_celerity_resource('aphront-tooltip-css');
     Javelin::initBehavior('phabricator-tooltips');
     $properties = id(new PHUIPropertyListView())->setUser($viewer);
     $full_domain = $blog->getDomainFullURI();
     if (!$full_domain) {
         $full_domain = phutil_tag('em', array(), pht('No external domain'));
     }
     $properties->addProperty(pht('Full Domain'), $full_domain);
     $parent_site = $blog->getParentSite();
     if (!$parent_site) {
         $parent_site = phutil_tag('em', array(), pht('No parent site'));
     }
     $properties->addProperty(pht('Parent Site'), $parent_site);
     $parent_domain = $blog->getParentDomain();
     if (!$parent_domain) {
         $parent_domain = phutil_tag('em', array(), pht('No parent domain'));
     }
     $properties->addProperty(pht('Parent Domain'), $parent_domain);
     $feed_uri = PhabricatorEnv::getProductionURI($this->getApplicationURI('blog/feed/' . $blog->getID() . '/'));
     $properties->addProperty(pht('Atom URI'), javelin_tag('a', array('href' => $feed_uri, 'sigil' => 'has-tooltip', 'meta' => array('tip' => pht('Atom URI does not support custom domains.'), 'size' => 320)), $feed_uri));
     $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions($viewer, $blog);
     $properties->addProperty(pht('Editable By'), $descriptions[PhabricatorPolicyCapability::CAN_EDIT]);
     $engine = id(new PhabricatorMarkupEngine())->setViewer($viewer)->addObject($blog, PhameBlog::MARKUP_FIELD_DESCRIPTION)->process();
     $description = $blog->getDescription();
     if (strlen($description)) {
         $description = new PHUIRemarkupView($viewer, $description);
         $properties->addSectionHeader(pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
         $properties->addTextContent($description);
     }
     return $properties;
 }