mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 03:02:43 +01:00
ae4e5807d6
Summary: They are same because render() returns safe HTML and raw strings are automatically escaped. Test Plan: None. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4909
45 lines
937 B
PHP
45 lines
937 B
PHP
<?php
|
|
|
|
final class PhabricatorAnchorView extends AphrontView {
|
|
|
|
private $anchorName;
|
|
private $navigationMarker;
|
|
|
|
public function setAnchorName($name) {
|
|
$this->anchorName = $name;
|
|
return $this;
|
|
}
|
|
|
|
public function setNavigationMarker($marker) {
|
|
$this->navigationMarker = $marker;
|
|
return $this;
|
|
}
|
|
|
|
public function render() {
|
|
$marker = null;
|
|
if ($this->navigationMarker) {
|
|
$marker = javelin_tag(
|
|
'legend',
|
|
array(
|
|
'class' => 'phabricator-anchor-navigation-marker',
|
|
'sigil' => 'marker',
|
|
'meta' => array(
|
|
'anchor' => $this->anchorName,
|
|
),
|
|
),
|
|
'');
|
|
}
|
|
|
|
$anchor = phutil_tag(
|
|
'a',
|
|
array(
|
|
'name' => $this->anchorName,
|
|
'id' => $this->anchorName,
|
|
'class' => 'phabricator-anchor-view',
|
|
),
|
|
'');
|
|
|
|
return $this->renderSingleView(array($marker, $anchor));
|
|
}
|
|
|
|
}
|