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;
|
2013-04-01 21:43:21 +02:00
|
|
|
$selected_phid = null;
|
2013-01-25 02:23:05 +01:00
|
|
|
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();
|
|
|
|
}
|
2013-04-01 21:43:21 +02:00
|
|
|
$selected_phid = $conpherence->getPHID();
|
2013-01-25 02:23:05 +01:00
|
|
|
|
|
|
|
$participant = $conpherence->getParticipant($user->getPHID());
|
|
|
|
$current_selection_epoch = $participant->getDateTouched();
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->loadStartingConpherences($current_selection_epoch);
|
|
|
|
$nav = $this->buildSideNavView();
|
|
|
|
|
2013-04-01 21:43:07 +02:00
|
|
|
$main_pane = id(new ConpherenceLayoutView())
|
|
|
|
->setBaseURI($this->getApplicationURI())
|
2013-04-01 21:43:21 +02:00
|
|
|
->setSelectedConpherencePHID($selected_phid);
|
2013-04-01 21:43:07 +02:00
|
|
|
|
2013-01-25 02:23:05 +01:00
|
|
|
$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
|
|
|
}
|
|
|
|
|
|
|
|
}
|