当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorMarkupEngine::newProfileMarkupEngine方法代码示例

本文整理汇总了PHP中PhabricatorMarkupEngine::newProfileMarkupEngine方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorMarkupEngine::newProfileMarkupEngine方法的具体用法?PHP PhabricatorMarkupEngine::newProfileMarkupEngine怎么用?PHP PhabricatorMarkupEngine::newProfileMarkupEngine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorMarkupEngine的用法示例。


在下文中一共展示了PhabricatorMarkupEngine::newProfileMarkupEngine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderBasicInformation

 private function renderBasicInformation($user, $profile)
 {
     $blurb = nonempty($profile->getBlurb(), '//Nothing is known about this rare specimen.//');
     $engine = PhabricatorMarkupEngine::newProfileMarkupEngine();
     $blurb = $engine->markupText($blurb);
     $content = '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">Basic Information</h1>
     <div class="phabricator-profile-info-pane">
       <table class="phabricator-profile-info-table">
         <tr>
           <th>PHID</th>
           <td>' . phutil_escape_html($user->getPHID()) . '</td>
         </tr>
         <tr>
           <th>User Since</th>
           <td>' . phabricator_format_timestamp($user->getDateCreated()) . '</td>
         </tr>
       </table>
     </div>
   </div>';
     $content .= '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">Flavor Text</h1>
     <div class="phabricator-profile-info-pane">
       <table class="phabricator-profile-info-table">
         <tr>
           <th>Blurb</th>
           <td>' . $blurb . '</td>
         </tr>
       </table>
     </div>
   </div>';
     return $content;
 }
开发者ID:hunterbridges,项目名称:phabricator,代码行数:33,代码来源:PhabricatorPeopleProfileController.php

示例2: renderBasicInformation

 private function renderBasicInformation($project, $profile)
 {
     $blurb = nonempty($profile->getBlurb(), '//Nothing is known about this elusive project.//');
     $engine = PhabricatorMarkupEngine::newProfileMarkupEngine();
     $blurb = $engine->markupText($blurb);
     $affiliations = $project->loadAffiliations();
     $phids = array_merge(array($project->getAuthorPHID()), $project->getSubprojectPHIDs(), mpull($affiliations, 'getUserPHID'));
     $phids = array_unique($phids);
     $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
     $affiliated = array();
     foreach ($affiliations as $affiliation) {
         $user = $handles[$affiliation->getUserPHID()]->renderLink();
         $role = phutil_escape_html($affiliation->getRole());
         $status = null;
         if ($affiliation->getStatus() == 'former') {
             $role = '<em>Former ' . $role . '</em>';
         }
         $affiliated[] = '<li>' . $user . ' &mdash; ' . $role . $status . '</li>';
     }
     if ($affiliated) {
         $affiliated = '<ul>' . implode("\n", $affiliated) . '</ul>';
     } else {
         $affiliated = '<p><em>No one is affiliated with this project.</em></p>';
     }
     if ($project->getSubprojectPHIDs()) {
         $table = $this->renderSubprojectTable($handles, $project->getSubprojectPHIDs());
         $subproject_list = $table->render();
     } else {
         $subproject_list = '<p><em>There are no projects attached for such specie.</em></p>';
     }
     $timestamp = phabricator_format_timestamp($project->getDateCreated());
     $status = PhabricatorProjectStatus::getNameForStatus($project->getStatus());
     $content = '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">Basic Information</h1>
     <div class="phabricator-profile-info-pane">
       <table class="phabricator-profile-info-table">
         <tr>
           <th>Creator</th>
           <td>' . $handles[$project->getAuthorPHID()]->renderLink() . '</td>
         </tr>
         <tr>
           <th>Status</th>
           <td><strong>' . phutil_escape_html($status) . '</strong></td>
         </tr>
         <tr>
           <th>Created</th>
           <td>' . $timestamp . '</td>
         </tr>
         <tr>
           <th>PHID</th>
           <td>' . phutil_escape_html($project->getPHID()) . '</td>
         </tr>
         <tr>
           <th>Blurb</th>
           <td>' . $blurb . '</td>
         </tr>
       </table>
     </div>
   </div>';
     $content .= '<div class="phabricator-profile-info-group">' . '<h1 class="phabricator-profile-info-header">Resources</h1>' . '<div class="phabricator-profile-info-pane">' . $affiliated . '</div>' . '</div>';
     $content .= '<div class="phabricator-profile-info-group">' . '<h1 class="phabricator-profile-info-header">Subprojects</h1>' . '<div class="phabricator-profile-info-pane">' . $subproject_list . '</div>' . '</div>';
     $query = id(new ManiphestTaskQuery())->withProjects(array($project->getPHID()))->withStatus(ManiphestTaskQuery::STATUS_OPEN)->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY)->setLimit(10)->setCalculateRows(true);
     $tasks = $query->execute();
     $count = $query->getRowCount();
     $phids = mpull($tasks, 'getOwnerPHID');
     $phids = array_filter($phids);
     $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
     $task_views = array();
     foreach ($tasks as $task) {
         $view = id(new ManiphestTaskSummaryView())->setTask($task)->setHandles($handles)->setUser($this->getRequest()->getUser());
         $task_views[] = $view->render();
     }
     if (empty($tasks)) {
         $task_views = '<em>No open tasks.</em>';
     } else {
         $task_views = implode('', $task_views);
     }
     $open = number_format($count);
     $more_link = phutil_render_tag('a', array('href' => '/maniphest/view/all/?projects=' . $project->getPHID()), "View All Open Tasks »");
     $content .= '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">' . "Open Tasks ({$open})" . '</h1>' . '<div class="phabricator-profile-info-pane">' . $task_views . '<div class="phabricator-profile-info-pane-more-link">' . $more_link . '</div>' . '</div>
   </div>';
     return $content;
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:84,代码来源:PhabricatorProjectProfileController.php

示例3: renderBasicInformation

 private function renderBasicInformation($user, $profile)
 {
     $blurb = nonempty($profile->getBlurb(), '//Nothing is known about this rare specimen.//');
     $engine = PhabricatorMarkupEngine::newProfileMarkupEngine();
     $blurb = $engine->markupText($blurb);
     $commit_list = phutil_render_tag('a', array('href' => '/diffusion/author/' . phutil_escape_uri($user->getUsername())), 'Recent Commits');
     $content = '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">Basic Information</h1>
     <div class="phabricator-profile-info-pane">
       <table class="phabricator-profile-info-table">
         <tr>
           <th>PHID</th>
           <td>' . phutil_escape_html($user->getPHID()) . '</td>
         </tr>
         <tr>
           <th>User Since</th>
           <td>' . phabricator_format_timestamp($user->getDateCreated()) . '</td>
         </tr>
       </table>
     </div>
   </div>';
     $content .= '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">Flavor Text</h1>
     <div class="phabricator-profile-info-pane">
       <table class="phabricator-profile-info-table">
         <tr>
           <th>Blurb</th>
           <td>' . $blurb . '</td>
         </tr>
       </table>
     </div>
   </div>';
     $content .= '<div class="phabricator-profile-info-group">
     <h1 class="phabricator-profile-info-header">Recent Activities</h1>
     <div class="phabricator-profile-info-pane">
       <table class="phabricator-profile-info-table">
         <tr>
           <th>Commits</th>
           <td>' . $commit_list . '</td>
         </tr>
       </table>
     </div>
   </div>';
     return $content;
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:45,代码来源:PhabricatorPeopleProfileController.php


注:本文中的PhabricatorMarkupEngine::newProfileMarkupEngine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。