Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIObjectItemView.php
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | public function getHref() { | ||||
return $this->href; | return $this->href; | ||||
} | } | ||||
public function setHeader($header) { | public function setHeader($header) { | ||||
$this->header = $header; | $this->header = $header; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getHeader() { | |||||
return $this->header; | |||||
} | |||||
public function setSubHead($subhead) { | public function setSubHead($subhead) { | ||||
$this->subhead = $subhead; | $this->subhead = $subhead; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setBadge(PHUIBadgeMiniView $badge) { | public function setBadge(PHUIBadgeMiniView $badge) { | ||||
$this->badge = $badge; | $this->badge = $badge; | ||||
return $this; | return $this; | ||||
Show All 9 Lines | public function setTitleText($title_text) { | ||||
$this->titleText = $title_text; | $this->titleText = $title_text; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getTitleText() { | public function getTitleText() { | ||||
return $this->titleText; | return $this->titleText; | ||||
} | } | ||||
public function getHeader() { | |||||
return $this->header; | |||||
} | |||||
public function addByline($byline) { | public function addByline($byline) { | ||||
$this->bylines[] = $byline; | $this->bylines[] = $byline; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setImageURI($image_uri) { | public function setImageURI($image_uri) { | ||||
$this->imageURI = $image_uri; | $this->imageURI = $image_uri; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 517 Lines • ▼ Show 20 Lines | if ($this->getImageURI()) { | ||||
$image = phutil_tag( | $image = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-oi-image-icon', | 'class' => 'phui-oi-image-icon', | ||||
), | ), | ||||
$this->getImageIcon()); | $this->getImageIcon()); | ||||
} | } | ||||
if ($image && (strlen($this->href) || strlen($this->imageHref))) { | $image_href = $this->href; | ||||
$image_href = ($this->imageHref) ? $this->imageHref : $this->href; | if ($image_href === null || !strlen($image_href)) { | ||||
$image_href = $this->imageHref; | |||||
} | |||||
if ($image && $image_href !== null && strlen($image_href)) { | |||||
$image = phutil_tag( | $image = phutil_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => $image_href, | 'href' => $image_href, | ||||
), | ), | ||||
$image); | $image); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | private function renderStatusIcon($icon, $label) { | ||||
$icon = id(new PHUIIconView()) | $icon = id(new PHUIIconView()) | ||||
->setIcon($icon); | ->setIcon($icon); | ||||
$options = array( | $options = array( | ||||
'class' => 'phui-oi-status-icon', | 'class' => 'phui-oi-status-icon', | ||||
); | ); | ||||
if (strlen($label)) { | if ($label !== null && strlen($label)) { | ||||
$options['sigil'] = 'has-tooltip'; | $options['sigil'] = 'has-tooltip'; | ||||
$options['meta'] = array('tip' => $label, 'size' => 300); | $options['meta'] = array('tip' => $label, 'size' => 300); | ||||
} | } | ||||
return javelin_tag('div', $options, $icon); | return javelin_tag('div', $options, $icon); | ||||
} | } | ||||
Show All 17 Lines |