mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 03:12:41 +01:00
8434143795
Summary: Ref T6822. Test Plan: `grep` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6822 Differential Revision: https://secure.phabricator.com/D11368
47 lines
1,009 B
PHP
47 lines
1,009 B
PHP
<?php
|
|
|
|
final class PHUIBoxView extends AphrontTagView {
|
|
|
|
private $margin = array();
|
|
private $padding = array();
|
|
private $border = false;
|
|
|
|
public function addMargin($margin) {
|
|
$this->margin[] = $margin;
|
|
return $this;
|
|
}
|
|
|
|
public function addPadding($padding) {
|
|
$this->padding[] = $padding;
|
|
return $this;
|
|
}
|
|
|
|
public function setBorder($border) {
|
|
$this->border = $border;
|
|
return $this;
|
|
}
|
|
|
|
protected function getTagAttributes() {
|
|
require_celerity_resource('phui-box-css');
|
|
$outer_classes = array();
|
|
$outer_classes[] = 'phui-box';
|
|
if ($this->border) {
|
|
$outer_classes[] = 'phui-box-border';
|
|
}
|
|
foreach ($this->margin as $margin) {
|
|
$outer_classes[] = $margin;
|
|
}
|
|
foreach ($this->padding as $padding) {
|
|
$outer_classes[] = $padding;
|
|
}
|
|
return array('class' => $outer_classes);
|
|
}
|
|
|
|
protected function getTagName() {
|
|
return 'div';
|
|
}
|
|
|
|
protected function getTagContent() {
|
|
return $this->renderChildren();
|
|
}
|
|
}
|