id = $data['id']; } public function processRequest() { $project = id(new PhabricatorProject())->load($this->id); if (!$project) { return new Aphront404Response(); } $profile = id(new PhabricatorProjectProfile())->loadOneWhere( 'projectPHID = %s', $project->getPHID()); if (!$profile) { $profile = new PhabricatorProjectProfile(); } require_celerity_resource('phabricator-profile-css'); $src_phid = $profile->getProfileImagePHID(); $src = PhabricatorFileURI::getViewURIForPHID($src_phid); $picture = phutil_render_tag( 'img', array( 'class' => 'profile-image', 'src' => $src, )); $links = ''; $blurb = nonempty( $profile->getBlurb(), '//Nothing is known about this elusive project.//'); $factory = new DifferentialMarkupEngineFactory(); $engine = $factory->newDifferentialCommentMarkupEngine(); $blurb = $engine->markupText($blurb); $affiliations = id(new PhabricatorProjectAffiliation())->loadAllWhere( 'projectPHID = %s ORDER BY IF(status = "former", 1, 0), dateCreated', $project->getPHID()); $phids = array_merge( array($project->getAuthorPHID()), mpull($affiliations, 'getUserPHID')); $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 = 'Former '.$role.''; } $affiliated[] = '
  • '.$user.' — '.$role.$status.'
  • '; } if ($affiliated) { $affiliated = ''; } else { $affiliated = '

    No one is affiliated with this project.

    '; } $timestamp = phabricator_format_timestamp($project->getDateCreated()); $content = '

    Basic Information

    Creator '.$handles[$project->getAuthorPHID()]->renderLink().'
    Created '.$timestamp.'
    PHID '.phutil_escape_html($project->getPHID()).'
    Blurb '.$blurb.'
    '; $content .= '

    Resources

    '. $affiliated. '
    '; $profile_markup = '
    '. '

    '.phutil_escape_html($project->getName()).'

    '. '
    '. $picture. '
    '. $links. '
    '. '
    '. $content. '
    '; return $this->buildStandardPageResponse( $profile_markup, array( 'title' => $project->getName(), )); } }