Changeset View
Changeset View
Standalone View
Standalone View
src/view/formation/PHUIFormationView.php
| <?php | <?php | ||||
| final class PHUIFormationView | final class PHUIFormationView | ||||
| extends AphrontView { | extends AphrontAutoIDView { | ||||
| private $items = array(); | private $items = array(); | ||||
| public function newFlankColumn() { | public function newFlankColumn() { | ||||
| $item = $this->newItem(new PHUIFormationFlankView()); | $item = $this->newItem(new PHUIFormationFlankView()); | ||||
| return $item->getColumn(); | return $item->getColumn(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | foreach ($items as $item) { | ||||
| 'style' => implode(' ', $style), | 'style' => implode(' ', $style), | ||||
| ), | ), | ||||
| array( | array( | ||||
| $column, | $column, | ||||
| $item->getExpanders(), | $item->getExpanders(), | ||||
| )); | )); | ||||
| } | } | ||||
| $formation_id = celerity_generate_unique_node_id(); | $phuix_items = array(); | ||||
| foreach ($items as $item) { | |||||
| $phuix_items[] = $item->newClientProperties(); | |||||
| } | |||||
| $table_row = phutil_tag('tr', array(), $cells); | $table_row = phutil_tag('tr', array(), $cells); | ||||
| $table_body = phutil_tag('tbody', array(), $table_row); | $table_body = phutil_tag('tbody', array(), $table_row); | ||||
| $table = phutil_tag( | $table = javelin_tag( | ||||
| 'table', | 'table', | ||||
| array( | array( | ||||
| 'id' => $this->getID(), | |||||
| 'class' => 'phui-formation-view', | 'class' => 'phui-formation-view', | ||||
| 'id' => $formation_id, | 'sigil' => 'phuix-formation-view', | ||||
| 'meta' => array( | |||||
| 'items' => $phuix_items, | |||||
| ), | |||||
| ), | ), | ||||
| $table_body); | $table_body); | ||||
| $phuix_columns = array(); | |||||
| foreach ($items as $item) { | |||||
| $phuix_columns[] = $item->newClientProperties(); | |||||
| } | |||||
| Javelin::initBehavior( | |||||
| 'phuix-formation-view', | |||||
| array( | |||||
| 'nodeID' => $formation_id, | |||||
| 'columns' => $phuix_columns, | |||||
| )); | |||||
| return $table; | return $table; | ||||
| } | } | ||||
| private function newColumnExpanderView() { | private function newColumnExpanderView() { | ||||
| return new PHUIFormationExpanderView(); | return new PHUIFormationExpanderView(); | ||||
| } | } | ||||
| private function newResizerItem() { | private function newResizerItem() { | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||