2011-03-13 01:17:34 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class AphrontCrumbsView extends AphrontView {
|
|
|
|
|
|
|
|
private $crumbs = array();
|
|
|
|
|
|
|
|
public function setCrumbs(array $crumbs) {
|
|
|
|
$this->crumbs = $crumbs;
|
2012-03-20 19:27:19 +01:00
|
|
|
return $this;
|
2011-03-13 01:17:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function render() {
|
|
|
|
|
|
|
|
require_celerity_resource('aphront-crumbs-view-css');
|
|
|
|
|
|
|
|
$out = array();
|
|
|
|
foreach ($this->crumbs as $crumb) {
|
2013-03-09 22:52:41 +01:00
|
|
|
$out[] = $crumb;
|
2011-03-13 01:17:34 +01:00
|
|
|
}
|
2013-02-13 23:50:15 +01:00
|
|
|
$out = phutil_implode_html(
|
|
|
|
hsprintf('<span class="aphront-crumbs-spacer">'."\xC2\xBB".'</span>'),
|
2011-03-13 01:17:34 +01:00
|
|
|
$out);
|
|
|
|
|
2013-02-13 23:50:15 +01:00
|
|
|
return hsprintf(
|
2011-03-13 01:17:34 +01:00
|
|
|
'<div class="aphront-crumbs-view">'.
|
2013-02-13 23:50:15 +01:00
|
|
|
'<div class="aphront-crumbs-content">%s</div>'.
|
|
|
|
'</div>',
|
|
|
|
$out);
|
2011-03-13 01:17:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|