2013-01-25 02:23:05 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group conpherence
|
|
|
|
*/
|
|
|
|
final class ConpherenceListController extends
|
|
|
|
ConpherenceController {
|
|
|
|
|
|
|
|
private $conpherenceID;
|
|
|
|
|
|
|
|
public function setConpherenceID($conpherence_id) {
|
|
|
|
$this->conpherenceID = $conpherence_id;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
public function getConpherenceID() {
|
|
|
|
return $this->conpherenceID;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
$this->setConpherenceID(idx($data, 'id'));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$user = $request->getUser();
|
|
|
|
$title = pht('Conpherence');
|
|
|
|
|
|
|
|
$conpherence_id = $this->getConpherenceID();
|
|
|
|
$current_selection_epoch = null;
|
|
|
|
if ($conpherence_id) {
|
|
|
|
$conpherence = id(new ConpherenceThreadQuery())
|
|
|
|
->setViewer($user)
|
|
|
|
->withIDs(array($conpherence_id))
|
|
|
|
->executeOne();
|
|
|
|
if (!$conpherence) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($conpherence->getTitle()) {
|
|
|
|
$title = $conpherence->getTitle();
|
|
|
|
}
|
|
|
|
$this->setSelectedConpherencePHID($conpherence->getPHID());
|
|
|
|
|
|
|
|
$participant = $conpherence->getParticipant($user->getPHID());
|
|
|
|
$current_selection_epoch = $participant->getDateTouched();
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->loadStartingConpherences($current_selection_epoch);
|
|
|
|
$nav = $this->buildSideNavView();
|
|
|
|
|
|
|
|
$main_pane = $this->renderEmptyMainPane();
|
|
|
|
$nav->appendChild(
|
|
|
|
array(
|
|
|
|
$main_pane,
|
|
|
|
));
|
|
|
|
|
|
|
|
return $this->buildApplicationPage(
|
|
|
|
$nav,
|
|
|
|
array(
|
|
|
|
'title' => $title,
|
|
|
|
'device' => true,
|
2013-02-19 22:33:10 +01:00
|
|
|
));
|
2013-01-25 02:23:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private function renderEmptyMainPane() {
|
2013-03-16 07:41:36 +01:00
|
|
|
$this->initJavelinBehaviors(true);
|
2013-03-31 23:41:13 +02:00
|
|
|
return javelin_tag(
|
2013-01-25 02:23:05 +01:00
|
|
|
'div',
|
|
|
|
array(
|
2013-03-31 23:41:13 +02:00
|
|
|
'id' => 'conpherence-main-pane',
|
|
|
|
'sigil' => 'conpherence-layout'
|
2013-01-25 02:23:05 +01:00
|
|
|
),
|
2013-01-25 14:50:50 +01:00
|
|
|
array(
|
2013-03-31 23:41:13 +02:00
|
|
|
javelin_tag(
|
2013-01-25 02:23:05 +01:00
|
|
|
'div',
|
|
|
|
array(
|
2013-01-25 14:50:50 +01:00
|
|
|
'class' => 'conpherence-header-pane',
|
|
|
|
'id' => 'conpherence-header-pane',
|
2013-03-31 23:41:13 +02:00
|
|
|
'sigil' => 'conpherence-header',
|
2013-01-25 02:23:05 +01:00
|
|
|
),
|
2013-02-19 22:33:10 +01:00
|
|
|
''),
|
2013-01-25 14:50:50 +01:00
|
|
|
phutil_tag(
|
2013-01-25 02:23:05 +01:00
|
|
|
'div',
|
|
|
|
array(
|
2013-01-25 14:50:50 +01:00
|
|
|
'class' => 'conpherence-widget-pane',
|
|
|
|
'id' => 'conpherence-widget-pane'
|
2013-01-25 02:23:05 +01:00
|
|
|
),
|
2013-02-19 22:33:10 +01:00
|
|
|
''),
|
2013-02-05 04:01:46 +01:00
|
|
|
javelin_tag(
|
2013-01-25 14:50:50 +01:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'conpherence-message-pane',
|
|
|
|
'id' => 'conpherence-message-pane'
|
|
|
|
),
|
|
|
|
array(
|
2013-03-31 23:41:13 +02:00
|
|
|
javelin_tag(
|
2013-01-25 14:50:50 +01:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'conpherence-messages',
|
2013-03-31 23:41:13 +02:00
|
|
|
'id' => 'conpherence-messages',
|
|
|
|
'sigil' => 'conpherence-messages',
|
2013-01-25 14:50:50 +01:00
|
|
|
),
|
2013-02-19 22:33:10 +01:00
|
|
|
''),
|
2013-01-25 14:50:50 +01:00
|
|
|
phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'id' => 'conpherence-form'
|
|
|
|
),
|
2013-02-19 22:33:10 +01:00
|
|
|
'')
|
|
|
|
))
|
|
|
|
));
|
2013-01-25 02:23:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|