Page MenuHomePhorge

PhragmentController.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PhragmentController.php

<?php
abstract class PhragmentController extends PhabricatorController {
protected function loadParentFragments($path) {
$components = explode('/', $path);
$combinations = array();
$current = '';
foreach ($components as $component) {
$current .= '/'.$component;
$current = trim($current, '/');
if (trim($current) === '') {
continue;
}
$combinations[] = $current;
}
$fragments = array();
$results = id(new PhragmentFragmentQuery())
->setViewer($this->getRequest()->getUser())
->withPaths($combinations)
->execute();
foreach ($combinations as $combination) {
$found = false;
foreach ($results as $fragment) {
if ($fragment->getPath() === $combination) {
$fragments[] = $fragment;
$found = true;
break;
}
}
if (!$found) {
return null;
}
}
return $fragments;
}
protected function buildApplicationCrumbsWithPath(array $fragments) {
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName('/')
->setHref('/phragment/'));
foreach ($fragments as $parent) {
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName($parent->getName())
->setHref('/phragment/browse/'.$parent->getPath()));
}
return $crumbs;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 3, 2:13 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
58307
Default Alt Text
PhragmentController.php (1 KB)

Event Timeline