mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-13 10:22:42 +01:00
f2cec9f973
Summary: Wanted to pull this out in case we don't use it in Maniphest, still useful perhaps in the future. Creates a sidebar that wraps when on mobile. Test Plan: Tested UIExample Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5321
56 lines
1 KiB
PHP
56 lines
1 KiB
PHP
<?php
|
|
|
|
final class AphrontTwoColumnView extends AphrontView {
|
|
|
|
private $mainColumn;
|
|
private $sideColumn;
|
|
private $padding = true;
|
|
|
|
public function setMainColumn($main) {
|
|
$this->mainColumn = $main;
|
|
return $this;
|
|
}
|
|
|
|
public function setSideColumn($side) {
|
|
$this->sideColumn = $side;
|
|
return $this;
|
|
}
|
|
|
|
public function setNoPadding($padding) {
|
|
$this->padding = $padding;
|
|
return $this;
|
|
}
|
|
|
|
public function render() {
|
|
require_celerity_resource('aphront-two-column-view-css');
|
|
|
|
$main = phutil_tag(
|
|
'div',
|
|
array(
|
|
'class' => 'aphront-main-column'
|
|
),
|
|
$this->mainColumn);
|
|
|
|
$side = phutil_tag(
|
|
'div',
|
|
array(
|
|
'class' => 'aphront-side-column'
|
|
),
|
|
$this->sideColumn);
|
|
|
|
$classes = array('aphront-two-column');
|
|
if ($this->padding) {
|
|
$classes[] = 'aphront-two-column-padded';
|
|
}
|
|
|
|
return phutil_tag(
|
|
'div',
|
|
array(
|
|
'class' => implode(' ', $classes)
|
|
),
|
|
array(
|
|
$main,
|
|
$side,
|
|
));
|
|
}
|
|
}
|