Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/view/widget/bars/AphrontGlyphBarView.php b/src/view/widget/bars/AphrontGlyphBarView.php
index d75fc932c4..5b8d606a27 100644
--- a/src/view/widget/bars/AphrontGlyphBarView.php
+++ b/src/view/widget/bars/AphrontGlyphBarView.php
@@ -1,102 +1,102 @@
<?php
final class AphrontGlyphBarView extends AphrontBarView {
const BLACK_STAR = "\xE2\x98\x85";
const WHITE_STAR = "\xE2\x98\x86";
private $value;
private $max = 100;
private $numGlyphs = 5;
private $fgGlyph;
private $bgGlyph;
- public function getDefaultColor() {
+ protected function getDefaultColor() {
return AphrontBarView::COLOR_AUTO_GOODNESS;
}
public function setValue($value) {
$this->value = $value;
return $this;
}
public function setMax($max) {
$this->max = $max;
return $this;
}
public function setNumGlyphs($nn) {
$this->numGlyphs = $nn;
return $this;
}
public function setGlyph(PhutilSafeHTML $fg_glyph) {
$this->fgGlyph = $fg_glyph;
return $this;
}
public function setBackgroundGlyph(PhutilSafeHTML $bg_glyph) {
$this->bgGlyph = $bg_glyph;
return $this;
}
protected function getRatio() {
return min($this->value, $this->max) / $this->max;
}
public function render() {
require_celerity_resource('aphront-bars');
$ratio = $this->getRatio();
$percentage = 100 * $ratio;
$is_star = false;
if ($this->fgGlyph) {
$fg_glyph = $this->fgGlyph;
if ($this->bgGlyph) {
$bg_glyph = $this->bgGlyph;
} else {
$bg_glyph = $fg_glyph;
}
} else {
$is_star = true;
$fg_glyph = self::BLACK_STAR;
$bg_glyph = self::WHITE_STAR;
}
$fg_glyphs = array_fill(0, $this->numGlyphs, $fg_glyph);
$bg_glyphs = array_fill(0, $this->numGlyphs, $bg_glyph);
$color = $this->getColor();
return phutil_tag(
'div',
array(
'class' => "aphront-bar glyph color-{$color}",
),
array(
phutil_tag(
'div',
array(
'class' => 'glyphs'.($is_star ? ' starstar' : ''),
),
array(
phutil_tag(
'div',
array(
'class' => 'fg',
'style' => "width: {$percentage}%;",
),
$fg_glyphs),
phutil_tag(
'div',
array(),
$bg_glyphs),
)),
phutil_tag(
'div',
array('class' => 'caption'),
$this->getCaption()),
));
}
}
diff --git a/src/view/widget/bars/AphrontProgressBarView.php b/src/view/widget/bars/AphrontProgressBarView.php
index 9987c68955..7117435aa5 100644
--- a/src/view/widget/bars/AphrontProgressBarView.php
+++ b/src/view/widget/bars/AphrontProgressBarView.php
@@ -1,58 +1,58 @@
<?php
final class AphrontProgressBarView extends AphrontBarView {
const WIDTH = 100;
private $value;
private $max = 100;
private $alt = '';
- public function getDefaultColor() {
+ protected function getDefaultColor() {
return AphrontBarView::COLOR_AUTO_BADNESS;
}
public function setValue($value) {
$this->value = $value;
return $this;
}
public function setMax($max) {
$this->max = $max;
return $this;
}
public function setAlt($text) {
$this->alt = $text;
return $this;
}
protected function getRatio() {
return min($this->value, $this->max) / $this->max;
}
public function render() {
require_celerity_resource('aphront-bars');
$ratio = $this->getRatio();
$width = self::WIDTH * $ratio;
$color = $this->getColor();
return phutil_tag_div(
"aphront-bar progress color-{$color}",
array(
phutil_tag(
'div',
array('title' => $this->alt),
phutil_tag(
'div',
array('style' => "width: {$width}px;"),
'')),
phutil_tag(
'span',
array(),
$this->getCaption()),
));
}
}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Apr 30, 11:54 PM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
108811
Default Alt Text
(4 KB)

Event Timeline