/** * @param PROJECT_ENTRY $entry * @return string */ public function comp_name_for($entry) { if (!$entry->component_id) { return '(no component)'; } if (!isset($this->_components)) { /** @var PROJECT $folder */ $folder = $entry->parent_folder(); $component_query = $folder->component_query(); $this->_components = $component_query->indexed_objects(); } $component = $this->_components[$entry->component_id]; return $this->context->get_icon_with_text($component->icon_url, Thirty_two_px, $component->title_as_link()); }
/** * Draw the "path" to the entry. * Takes the visibility properties into account to determine whether to show * the component/project/release/branch. * @param PROJECT_ENTRY $obj * @param PROJECT_ENTRY_BRANCH_INFO $branch_info */ protected function _draw_context_in_project_for($obj, $branch_info) { if ($this->show_folder || $this->show_branch || $this->show_release || $this->show_component) { $menu = $this->context->make_menu(); $menu->renderer->separator_class = $this->app->display_options->object_class; if ($this->show_folder) { $folder = $obj->parent_folder(); $menu->append($folder->title_as_link()); } if ($this->show_component && $obj->component_id) { $comp = $obj->component(); $menu->append($comp->title_as_link()); } if ($this->show_branch) { $branch = $obj->main_branch(); $menu->append($branch->title_as_link()); } if ($this->show_release) { $rel = $branch_info->release(); if (isset($rel)) { $menu->append($rel->title_as_link()); } } $menu->display(); } }