Exemplo n.º 1
0
// delete series
$delseries = sotf_Utils::getParameter('delseries');
if ($delseries) {
    $seriesid = sotf_Utils::getParameter('seriesid');
    $series =& $repository->getObject($seriesid);
    $series->delete();
    $page->redirect(mygetenv('PHP_SELF') . "#series");
    exit;
}
// delete prog
$delprog = sotf_Utils::getParameter('delprog');
$prgid = sotf_Utils::getParameter('prgid');
if ($delprog) {
    $prg =& $repository->getObject($prgid);
    $prg->delete();
    $page->redirect(mygetenv('PHP_SELF') . "#progs");
    exit;
}
// generate output
$smarty->assign('STATION_ID', $stationid);
$smarty->assign('STATION', $st->get('name'));
$smarty->assign('STATION_DATA', $st->getAllWithIcon());
$smarty->assign('HOME_URL', sotf_Node::getHomeNodeRootUrl($st));
if ($st->isLocal()) {
    $smarty->assign('IS_LOCAL', 1);
}
$smarty->assign('ROLES', $st->getRoles());
if ($st->getJingle()) {
    $smarty->assign('JINGLE', 1);
}
if ($entered) {
Exemplo n.º 2
0
// the repository of radio stations
$repository = new sotf_Repository($config['repositoryDir'], $db);
// all controlled vocabularies
$vocabularies = new sotf_Vocabularies($db);
// now you have the following global objects: $config, $db, $userdb, $smarty, $page, $repository, $user, $permission
// is that too many?
// forwarding all $config to smarty is a security risk
// $smarty->assign("CONFIG", $config);
// add basic variables to Smarty
$smarty->assign("NODEID", $config['nodeId']);
$smarty->assign("NODE_NAME", $config['nodeName']);
$smarty->assign("ROOT_URL", $config['rootUrl']);
$smarty->assign("ROOT_PREFIX", $config['localPrefix']);
$smarty->assign("IMAGE_URL", $config['imageUrl']);
$smarty->assign("CACHE_URL", $config['cacheUrl']);
$smarty->assign("PHP_SELF", mygetenv('PHP_SELF'));
$smarty->assign("ICON_HEIGHT", $config['iconHeight']);
$smarty->assign("ICON_WIDTH", $config['iconWidth']);
$smarty->assign("DEBUG", $config['debug']);
$smarty->assign("ACTION", $page->action);
$smarty->assign("LANG", $lang);
if ($page->loggedIn()) {
    $smarty->assign("loggedIn", '1');
    $smarty->assign("USERNAME", $user->name);
    $smarty->assign("PERMISSIONS", $permissions->currentPermissions);
    if ($permissions->isEditor()) {
        $smarty->assign("IS_EDITOR", '1');
    }
    //$smarty->assign("STATION_MANAGER", sotf_Permission::get("station_manager"));
}
if ($config['debug']) {
 function collectPathinfoParams()
 {
     global $pathinfoParams;
     $str = mygetenv('PATH_INFO');
     if (!$str) {
         return;
     }
     $a = explode('/', $str);
     while (list(, $v) = each($a)) {
         $p = explode('__', $v);
         if (count($p) == 1) {
             $pathinfoParams['id'] = $v;
         } else {
             $pathinfoParams[$p[0]] = $p[1];
         }
     }
     debug("PATHINFO PARAMS: ", $pathinfoParams);
 }