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/PHUITwoColumnView.php
Chad Little efb6bb3dcf Add "Blogs" section to PhameHome
Summary: Ref T9927. Adds a "Blogs" section to PhameHome. Removes "New Post" Controller. Adds flipped layout for PHUITwoColumnView

Test Plan:
Test PhameHome, Ponder, New Post, etc. Mobile and Desktop states.

{F1022080}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: johnny-bit, Korvin

Maniphest Tasks: T9927

Differential Revision: https://secure.phabricator.com/D14744
2015-12-12 01:23:09 +00:00

71 lines
1.4 KiB
PHP

<?php
final class PHUITwoColumnView extends AphrontTagView {
private $mainColumn;
private $sideColumn;
private $display;
const DISPLAY_LEFT = 'phui-side-column-left';
const DISPLAY_RIGHT = 'phui-side-column-right';
public function setMainColumn($main) {
$this->mainColumn = $main;
return $this;
}
public function setSideColumn($side) {
$this->sideColumn = $side;
return $this;
}
public function setDisplay($display) {
$this->display = $display;
return $this;
}
public function getDisplay() {
if ($this->display) {
return $this->display;
} else {
return self::DISPLAY_RIGHT;
}
}
protected function getTagAttributes() {
$classes = array();
$classes[] = 'phui-two-column-view';
$classes[] = 'grouped';
$classes[] = $this->getDisplay();
return array(
'class' => implode(' ', $classes),
);
}
protected function getTagContent() {
require_celerity_resource('phui-two-column-view-css');
$main = phutil_tag(
'div',
array(
'class' => 'phui-main-column',
),
$this->mainColumn);
$side = phutil_tag(
'div',
array(
'class' => 'phui-side-column',
),
$this->sideColumn);
if ($this->getDisplay() == self::DISPLAY_LEFT) {
$order = array($side, $main);
} else {
$order = array($main, $side);
}
return phutil_tag_div('phui-two-column-row', $order);
}
}