function initialize() { $this->checkSession(); $this->assignSession(); $name = $_REQUEST['program'] ? $_REQUEST['program'] : self::DEFAULT_NAME; $memory = array('program' => $name); $this->program = ProgramHandler::handleMemory($this->userid, $memory); $this->assign('program', $name); }
private function handleProgram() { $program = ProgramHandler::handleMemory($this->userid, $this->memory); if (!$program) { return; } $this->media = $program->currentInfo(); if ($program->previousInfo()) { $memory = $this->memory; $memory['index'] = $program->index - 1; $string = urlencode(json_encode($memory)); $this->assign('url_previous', sprintf("%sjplayer.php?memory=%s", HOME_URL, $string)); } if ($program->nextInfo()) { $memory = $this->memory; $memory['index'] = $program->index + 1; $string = urlencode(json_encode($memory)); $this->assign('url_next', sprintf("%sjplayer.php?memory=%s", HOME_URL, $string)); } }