1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-02 09:58:24 +01:00
phorge-phorge/src/applications/dashboard/layoutconfig/PhabricatorDashboardHalfLayoutMode.php
epriestley 0381eed6e6 Modularize dashboard layout modes (one column, two columns, etc)
Summary:
Depends on D20405. Ref T13272. Currently, the `PhabricatorDashboardLayoutConfig` class uses a lot of `switch()` statements to define layout modes.

Although I'm not planning to add thousands of new layout modes, this (and upcoming changes) can be made substantially cleaner by using a standard modular approach.

(This doesn't fully remove `PhabricatorDashboardLayoutConfig` yet, but that will happen soon.)

Test Plan: Edited a dashboard, saw the same layout modes as before.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13272

Differential Revision: https://secure.phabricator.com/D20406
2019-04-14 10:22:59 -07:00

27 lines
542 B
PHP

<?php
final class PhabricatorDashboardHalfLayoutMode
extends PhabricatorDashboardLayoutMode {
const LAYOUTMODE = 'layout-mode-half-and-half';
public function getLayoutModeOrder() {
return 500;
}
public function getLayoutModeName() {
return pht('Two Columns: 50%%/50%%');
}
public function getLayoutModeColumns() {
return array(
$this->newColumn()
->setColumnKey('left')
->addClass('half'),
$this->newColumn()
->setColumnKey('right')
->addClass('half'),
);
}
}