Merge branch 'master' of dev.sourcefabric.org:campcaster

Conflicts:
	application/controllers/ScheduleController.php
	public/css/styles.css
This commit is contained in:
naomiaro 2011-03-15 17:02:22 -04:00
commit 8f86b05a4b
496 changed files with 442 additions and 49839 deletions

View file

@ -16,6 +16,16 @@ class ApiController extends Zend_Controller_Action
// action body
}
/**
* Returns Airtime version. i.e "1.7.0 alpha"
*
* First checks to ensure the correct API key was
* supplied, then returns AIRTIME_VERSION as defined
* in application/conf.php
*
* @return void
*
*/
public function versionAction()
{
global $CC_CONFIG;
@ -35,7 +45,12 @@ class ApiController extends Zend_Controller_Action
echo $jsonStr;
}
/**
* Allows remote client to download requested media file.
*
* @return void
* The given value increased by the increment amount.
*/
public function getMediaAction()
{
global $CC_CONFIG;
@ -67,23 +82,9 @@ class ApiController extends Zend_Controller_Action
// !! binary mode !!
$fp = fopen($filepath, 'rb');
$mtype = '';
/*
// magic_mime module installed?
if (function_exists('mime_content_type')) {
$mtype = mime_content_type($file_path);
}
// fileinfo module installed?
else if (function_exists('finfo_file')) {
$finfo = finfo_open(FILEINFO_MIME); // return mime type
$mtype = finfo_file($finfo, $file_path);
finfo_close($finfo);
}
//header("Content-Type: $mtype");
*/
// possibly use fileinfo module here in the future.
// http://www.php.net/manual/en/book.fileinfo.php
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if ($ext == "ogg")
header("Content-Type: audio/ogg");
@ -92,17 +93,12 @@ class ApiController extends Zend_Controller_Action
header("Content-Length: " . filesize($filepath));
//header('Content-Disposition: attachment; filename="'.$media->getRealMetadataFileName().'"');
fpassthru($fp);
return;
}
else {
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
exit;
}
} else {
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
exit;
}
}
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
exit;
}
public function scheduleAction()

View file

@ -162,12 +162,25 @@ class ScheduleController extends Zend_Controller_Action
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params,
'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Add Content');
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params,
'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Remove All Content');
}
}
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params,
'callback' => 'window["buildContentDialog"]'), 'title' => 'Show Content');
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
strtotime($today_timestamp) < strtotime($show->getShowEnd())) {
$menu[] = array('action' => array('type' => 'fn',
//'url' => '/Schedule/cancel-current-show'.$params,
'callback' => "window['confirmCancelShow']($id)"),
'title' => 'Cancel Current Show');
}
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
if ($user->isAdmin()) {
@ -177,12 +190,6 @@ class ScheduleController extends Zend_Controller_Action
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params,
'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance and All Following');
}
if ($user->isHost($show->getShowId()) || $user->isAdmin()) {
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params,
'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Remove All Content');
}
}
//returns format jjmenu is looking for.
@ -421,6 +428,19 @@ class ScheduleController extends Zend_Controller_Action
$show->cancelShow($showInstance->getShowStart());
}
}
public function cancelCurrentShowAction()
{
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id);
if($user->isAdmin()) {
$showInstanceId = $this->_getParam('id');
$show = new ShowInstance($showInstanceId);
$show->clearShow();
$show->deleteShow();
}
}
}