if (sotf_Utils::getParameter('addprog')) { $fname = sotf_Utils::getParameter('fname'); $station = sotf_Utils::getParameter('station'); checkPerm($station, 'create'); $newPrg = new sotf_Programme(); $track = preg_replace('/\\.[^.]*$/', '', $fname); debug("create with track", $track); $newPrg->create($station, $track); $newPrg->setAudio($user->getUserDir() . '/' . $fname); $permissions->addPermission($newPrg->id, $user->id, 'admin'); //$page->redirect("editFiles.php"); $page->redirect("editFiles.php?new=1&id=" . $newPrg->getID()); exit; } $expiryDays = 7; $expiringIds = sotf_Programme::getMyExpiringProgrammes($expiryDays); if (count($expiringIds) > 0) { $smarty->assign("WILL_EXPIRE", $page->getlocalizedWithParams('will_expire', count($expiringIds), $expiryDays)); } $stationId = sotf_Utils::getParameter('stationid'); if ($stationId) { $smarty->assign('SELECTED_STATION', $stationId); } $userFtpUrl = $user->getUrlForUserFTP(); $smarty->assign("USERFTPURL", $userFtpUrl); $stations = $permissions->listStationsForEditor(); if ($stationId) { foreach ($stations as $st) { if ($st['id'] == $stationId) { $stFound = true; }