1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 03:12:41 +01:00
phorge-phorge/src/view/phui/PHUIBoxView.php
Chad Little 65a3aa0cc7 Remove phui-box-inner
Summary: When we removed the shadow, we no longer needed two containers.

Test Plan: Browsed Box example, a diff, a task, and other random pages. Grep for phui-box-inner, not used elsewhere.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D8281
2014-02-19 23:05:42 -08:00

47 lines
1,003 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);
}
public function getTagName() {
return 'div';
}
public function getTagContent() {
return $this->renderChildren();
}
}