mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 15:00:58 +01:00
61f82bb97b
Summary: This opens up the new action column to have specialized rendering and behavior. Briefly: - Converted applications (right now, only Paste) render a `CurtainView` to build the column content. - This view uses new extensions to build panels (projects, subscribers, tokens). - The panel extension code and rendering can be changed without breaking old stuff. Minor changes: - Token awards now load their tokens, for consistency/simplicity. - Removed the rest of the "fork of" / "forked from" UI in Paste -- I essentially removed these features a while ago, and no one has complained. Test Plan: UI is a bit rough, but works, and it's going to get changed now anyway: {F1160550} {F1160551} Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D15414
63 lines
1.1 KiB
PHP
63 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class PHUICurtainPanelView extends AphrontTagView {
|
|
|
|
private $order = 0;
|
|
private $headerText;
|
|
|
|
public function setHeaderText($header_text) {
|
|
$this->headerText = $header_text;
|
|
return $this;
|
|
}
|
|
|
|
public function getHeaderText() {
|
|
return $this->headerText;
|
|
}
|
|
|
|
public function setOrder($order) {
|
|
$this->order = $order;
|
|
return $this;
|
|
}
|
|
|
|
public function getOrder() {
|
|
return $this->order;
|
|
}
|
|
|
|
public function getOrderVector() {
|
|
return id(new PhutilSortVector())
|
|
->addInt($this->getOrder());
|
|
}
|
|
|
|
protected function getTagAttributes() {
|
|
return array(
|
|
'class' => 'phui-curtain-panel',
|
|
);
|
|
}
|
|
|
|
protected function getTagContent() {
|
|
$header = null;
|
|
|
|
$header_text = $this->getHeaderText();
|
|
if (strlen($header_text)) {
|
|
$header = phutil_tag(
|
|
'div',
|
|
array(
|
|
'class' => 'phui-curtain-panel-header',
|
|
),
|
|
$header_text);
|
|
}
|
|
|
|
$body = phutil_tag(
|
|
'div',
|
|
array(
|
|
'class' => 'phui-curtain-panel-body',
|
|
),
|
|
$this->renderChildren());
|
|
|
|
return array(
|
|
$header,
|
|
$body,
|
|
);
|
|
}
|
|
|
|
}
|