Esempio n. 1
0
if ($delete) {
    $station = sotf_Utils::getParameter('station');
    if (!hasPerm('node', 'delete') && !hasPerm($station, 'admin')) {
        $permTransl = $page->getlocalized('perm_delete');
        $msg = $page->getlocalizedWithParams('no_permission', $permTransl);
        raiseError($msg);
    }
    $st =& $repository->getObject($station);
    $st->delete();
    $page->addStatusMsg('delete_ok');
    $page->redirect($_SERVER["PHP_SELF"]);
}
$count = sotf_Station::countStations($language);
//$limit = $page->splitList($count, $config['localPrefix'] . "/stations.php");
$limit = $page->splitList($count, $scriptUrl);
$stations = sotf_Station::listStations($limit["from"], $limit["maxresults"], $mode, $language);
for ($i = 0; $i < count($stations); $i++) {
    $sprops = $stations[$i]->getAllWithIcon();
    $sprops['numProgs'] = $stations[$i]->numProgrammes();
    $sprops['isLocal'] = $stations[$i]->isLocal();
    $sprops['languages'] = $stations[$i]->getLanguagesLocalized();
    if (hasPerm('node', 'delete', 'change')) {
        $sprops['managers'] = $permissions->listUsersWithPermission($stations[$i]->id, 'admin');
    }
    $STATION_LIST[] = $sprops;
}
$smarty->assign('STATIONS', $STATION_LIST);
$smarty->assign('MODE', $mode);
$smarty->assign('LANGUAGE', $language);
$smarty->assign('STATION_LANGS', sotf_Station::listStationLanguages());
$page->send();
Esempio n. 2
0
<?php

// -*- tab-width: 3; indent-tabs-mode: 1; -*-
// $Id$
require "init.inc.php";
$hitsPerPage = $sotfVars->get("hitsPerPage", 15);
$smarty->assign('PAGETITLE', $page->getlocalized('Stations'));
$start = sotf_Utils::getParameter('start');
$station = sotf_Utils::getParameter('station');
$delete = sotf_Utils::getParameter('delete');
if ($delete and hasPerm('node', 'delete')) {
    $st =& new sotf_Station($station);
    $st->delete();
    $page->addStatusMsg('delete_ok');
    $page->redirect($_SERVER["PHP_SELF"]);
}
$limit = $page->splitList(sotf_Station::countAll(), "{$php_self}");
//$result = $db->limitQuery($query, $limit["from"], $limit["maxresults"]);				//get results with limit
$stations = sotf_Station::listStations($limit["from"], $limit["maxresults"]);
for ($i = 0; $i < count($stations); $i++) {
    $sprops = $stations[$i]->getAllWithIcon();
    $sprops['numProgs'] = $stations[$i]->numProgrammes();
    $sprops['isLocal'] = $stations[$i]->isLocal();
    if (hasPerm('node', 'delete')) {
        $sprops['managers'] = $permissions->listUsersWithPermission($stations[$i]->id, 'admin');
    }
    $STATION_LIST[] = $sprops;
}
$smarty->assign('STATIONS', $STATION_LIST);
$page->send();
Esempio n. 3
0
        } else {
            $smarty->assign('STATUS', $page->getlocalized('addstationmanager_failed'));
        }
    } elseif ($delstationmanager) {
        if (sotf_Permission::delStationManager($username)) {
            $smarty->assign('STATUS', $page->getlocalized('delstationmanager_ok'));
        } else {
            $smarty->assign('STATUS', $page->getlocalized('delstationmanager_failed'));
        }
    }
    $users = sotf_Permission::getStationManagers();
    if (count($users) > 0) {
        $smarty->assign('USERS', $users);
    }
}
$stations = sotf_Station::listStations();
for ($i = 0; $i < count($stations); $i++) {
    /*
    $logo = false;
    if (isLocalStation($stations[$i]['station']))
    {
    	if (!is_object($repository->getStationLogo($stations[$i]['station'])))
    	{
    		$logo = '<img border="0" src="getLogo.php?station='.rawurlencode($stations[$i]['station']).'">';
    	}
    }
    else
    {
    	$url = parse_url($repository->getRepositoryURL($stations[$i]['station']));
    	$scheme = $url['scheme'];
    	$host = $url['host'];