Switches indentation to tabs.

This commit is contained in:
Lars Jung 2012-02-12 22:35:38 +01:00
parent 231ba3013b
commit 20858a1f43
39 changed files with 3437 additions and 3440 deletions

View file

@ -1,52 +1,52 @@
<?php
class Crumb {
private $h5ai, $parts;
private $h5ai, $parts;
public function __construct($h5ai) {
public function __construct($h5ai) {
$this->h5ai = $h5ai;
$this->parts = array();
$this->h5ai = $h5ai;
$this->parts = array();
$href = $h5ai->getAbsHref();
while ($href !== "/" && $href !== "//") {
$this->parts[] = $href;
$href = dirname($href) . "/";
}
$this->parts[] = "/";
$href = $h5ai->getAbsHref();
while ($href !== "/" && $href !== "//") {
$this->parts[] = $href;
$href = dirname($href) . "/";
}
$this->parts[] = "/";
$this->parts = array_reverse($this->parts);
}
$this->parts = array_reverse($this->parts);
}
public function toHtml() {
public function toHtml() {
$html = "";
$idx = 0;
foreach($this->parts as $href) {
$idx++;
$classes = "crumb folder" . ($idx === 1 ? " domain" : "") . ($idx === count($this->parts) ? " current" : "");
$image = $this->h5ai->image($idx === 1 ? "home" : "crumb");
$label = $this->h5ai->getLabel($href);
$hint = "";
$html = "";
$idx = 0;
foreach($this->parts as $href) {
$idx++;
$classes = "crumb folder" . ($idx === 1 ? " domain" : "") . ($idx === count($this->parts) ? " current" : "");
$image = $this->h5ai->image($idx === 1 ? "home" : "crumb");
$label = $this->h5ai->getLabel($href);
$hint = "";
$code = $this->h5ai->getHttpCode($href);
$classes .= " checkedHttpCode";
if ($code !== "h5ai") {
if ($code === 200) {
$hint = "<img class='hint' src='" . $this->h5ai->image("page") . "' alt='page' />";
} else {
$hint = "<span class='hint'>(" . $code . ")</span>";
}
}
$code = $this->h5ai->getHttpCode($href);
$classes .= " checkedHttpCode";
if ($code !== "h5ai") {
if ($code === 200) {
$hint = "<img class='hint' src='" . $this->h5ai->image("page") . "' alt='page' />";
} else {
$hint = "<span class='hint'>(" . $code . ")</span>";
}
}
$html .= "<li class='$classes'>\n";
$html .= "\t<a href='$href'>\n";
$html .= "\t\t<img src='$image' alt='>' /><span>" . $label . "</span>" . $hint . "\n";
$html .= "\t</a>\n";
$html .= "</li>\n";
}
return $html;
}
$html .= "<li class='$classes'>\n";
$html .= "\t<a href='$href'>\n";
$html .= "\t\t<img src='$image' alt='>' /><span>" . $label . "</span>" . $hint . "\n";
$html .= "\t</a>\n";
$html .= "</li>\n";
}
return $html;
}
}
?>