class = idx($data, 'class'); } public function processRequest() { $classes = id(new PhutilSymbolLoader()) ->setAncestorClass('PhabricatorUIExample') ->selectAndLoadSymbols(); $classes = ipull($classes, 'name', 'name'); $selected = null; foreach ($classes as $class => $ignored) { $classes[$class] = newv($class, array()); if ($this->class == $classes[$class]->getName()) { $selected = $class; } } if (!$selected) { $selected = head_key($classes); } $nav = new AphrontSideNavView(); foreach ($classes as $class => $obj) { $name = $obj->getName(); $nav->addNavItem( phutil_render_tag( 'a', array( 'href' => '/uiexample/view/'.$name.'/', 'class' => ($selected == $class) ? 'aphront-side-nav-selected' : null, ), phutil_escape_html($obj->getName()))); } require_celerity_resource('phabricator-ui-example-css'); $example = $classes[$selected]; $example->setRequest($this->getRequest()); $nav->appendChild( '
'. '

'. phutil_escape_html($example->getName()). ' ('.get_class($example).')'. '

'. '

' .$example->getDescription(). '

'. '
'); $nav->appendChild($example->renderExample()); return $this->buildStandardPageResponse( $nav, array( 'title' => 'UI Example', )); } }