Changeset View
Changeset View
Standalone View
Standalone View
src/view/layout/AphrontSideNavFilterView.php
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | public function newLink($key) { | ||||
return $this->getMenuView()->getItem($key); | return $this->getMenuView()->getItem($key); | ||||
} | } | ||||
private function addThing($key, $name, $uri, $type, $icon = null) { | private function addThing($key, $name, $uri, $type, $icon = null) { | ||||
$item = id(new PHUIListItemView()) | $item = id(new PHUIListItemView()) | ||||
->setName($name) | ->setName($name) | ||||
->setType($type); | ->setType($type); | ||||
if (strlen($icon)) { | if (phutil_nonempty_string($icon)) { | ||||
$item->setIcon($icon); | $item->setIcon($icon); | ||||
} | } | ||||
if (strlen($key)) { | if (phutil_nonempty_string($key)) { | ||||
$item->setKey($key); | $item->setKey($key); | ||||
} | } | ||||
if ($uri) { | if ($uri) { | ||||
$item->setHref($uri); | $item->setHref($uri); | ||||
} else { | } else { | ||||
$href = clone $this->baseURI; | $href = clone $this->baseURI; | ||||
$href->setPath(rtrim($href->getPath().$key, '/').'/'); | $href->setPath(rtrim($href->getPath().$key, '/').'/'); | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0