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

This commit is contained in:
denise 2013-05-14 08:59:30 -04:00
commit bfd525395a
17 changed files with 243 additions and 120 deletions

View file

@ -49,6 +49,7 @@ class LibraryController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/waveform.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');

View file

@ -421,8 +421,8 @@ class PlaylistController extends Zend_Controller_Action
public function setCrossfadeAction()
{
$id1 = $this->_getParam('id1');
$id2 = $this->_getParam('id2');
$id1 = $this->_getParam('id1', null);
$id2 = $this->_getParam('id2', null);
$type = $this->_getParam('type');
$fadeIn = $this->_getParam('fadeIn', 0);
$fadeOut = $this->_getParam('fadeOut', 0);

View file

@ -38,22 +38,22 @@
<div class="waveform-cues">
<div class="playlist-tracks"></div>
<div class="playlist-controls">
<span class="btn_play ui-state-default">Play</span>
<span class="btn_stop ui-state-default">Stop</span>
<a class="btn btn-small btn_play"><i class="icon-play icon-white"></i>Play</a>
<a class="btn btn-small btn_stop"><i class="icon-stop icon-white"></i>Stop</a>
<label class="audio audio_pos">00:00:00.0</label>
</div>
<div>
<input type="text" class="audio_start">
<input type="button" class="set-cue-in" value="Set Cue In">
<input type="text" class="audio_end">
<input type="button" class="set-cue-out" value="Set Cue Out">
<input type="text" class="audio_pos">
</div>
<div>
<div class="set-cue">
<label for="editor-cue-in">Cue In</label>
<input type="text" id="editor-cue-in" class="editor-cue-in">
<span style="display:none" class="cue-in-error"></span>
<input type="text" class="audio_start">
<input type="button" class="btn btn-small set-cue-in" value="Set Cue In">
<label class="audio editor-cue-in">00:00:00.0</label>
<span style="display:none" class="cue-in-error"></span>
</div>
<div class="set-cue">
<label for="editor-cue-out">Cue Out</label>
<input type="text" id="editor-cue-out" class="editor-cue-out">
<input type="text" class="audio_end">
<input type="button" class="btn btn-small set-cue-out" value="Set Cue Out">
<label class="audio editor-cue-out">00:00:00.0</label>
<span style="display:none" class="cue-out-error"></span>
</div>
</div>
@ -62,14 +62,14 @@
<script id="tmpl-pl-fades" type="text/template">
<div class="waveform-fades">
<div class="playlist-tracks"></div>
<div>
<span class="btn_play ui-state-default">Play</span>
<span class="btn_stop ui-state-default">Stop</span>
<div class="playlist-controls left-floated">
<a class="btn btn-small btn_play"><i class="icon-play icon-white"></i>Play</a>
<a class="btn btn-small btn_stop"><i class="icon-stop icon-white"></i>Stop</a>
</div>
<div>
<span class="btn_select ui-state-default" data-state="cursor">Cursor</span>
<span class="btn_fadein ui-state-default" data-state="fadein">Fade In</span>
<span class="btn_fadeout ui-state-default" data-state="fadeout">Fade Out</span>
<div class="set-fade left-floated">
<a type="button" class="btn btn-small btn_cursor" data-state="cursor">Cursor</a>
<a type="button" class="btn btn-small btn_fadein" data-state="fadein">Fade In</a>
<a type="button" class="btn btn-small btn_fadeout" data-state="fadeout">Fade Out</a>
</div>
</div>
</script>

View file

@ -688,8 +688,12 @@ SQL;
$this->con->beginTransaction();
try {
$this->changeFadeInfo($id1, null, $fadeOut);
$this->changeFadeInfo($id2, $fadeIn, null, $offset);
if (isset($id1)) {
$this->changeFadeInfo($id1, null, $fadeOut);
}
if (isset($id2)) {
$this->changeFadeInfo($id2, $fadeIn, null, $offset);
}
$this->con->commit();

View file

@ -670,8 +670,12 @@ SQL;
$this->con->beginTransaction();
try {
$this->changeFadeInfo($id1, null, $fadeOut);
$this->changeFadeInfo($id2, $fadeIn, null, $offset);
if (isset($id1)) {
$this->changeFadeInfo($id1, null, $fadeOut);
}
if (isset($id2)) {
$this->changeFadeInfo($id2, $fadeIn, null, $offset);
}
$this->con->commit();

View file

@ -106,43 +106,44 @@ class Application_Model_Preference
private static function getValue($key, $isUserValue = false)
{
try {
$con = Propel::getConnection();
//Check if key already exists
$sql = "SELECT COUNT(*) FROM cc_pref"
." WHERE keystr = '$key'";
/*." WHERE keystr = :key";
." WHERE keystr = :key";
$paramMap = array();
$paramMap[':key'] = $key;*/
$paramMap[':key'] = $key;
//For user specific preference, check if id matches as well
if ($isUserValue) {
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$id = $auth->getIdentity()->id;
$sql .= " AND subjid = '$id'";
/*$sql .= " AND subjid = :id";
$paramMap[':id'] = $id;*/
$sql .= " AND subjid = :id";
$paramMap[':id'] = $id;
}
}
$result = $con->query($sql)->fetchColumn(0);
//$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, 'column');
$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, Application_Common_Database::COLUMN);
if ($result == 0) {
return "";
} else {
}
else {
$sql = "SELECT valstr FROM cc_pref"
." WHERE keystr = '$key'";
/*." WHERE keystr = :key";
." WHERE keystr = :key";
$paramMap = array();
$paramMap[':key'] = $key;*/
$paramMap[':key'] = $key;
//For user specific preference, check if id matches as well
if ($isUserValue && $auth->hasIdentity()) {
$sql .= " AND subjid = '$id'";
/*$sql .= " AND subjid = :id";
$paramMap[':id'] = $id;*/
$sql .= " AND subjid = :id";
$paramMap[':id'] = $id;
}
$result = $con->query($sql)->fetchColumn(0);
//$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, 'column');
$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, Application_Common_Database::COLUMN);
return ($result !== false) ? $result : "";
}
@ -609,9 +610,10 @@ class Application_Model_Preference
public static function GetCountryList()
{
$con = Propel::getConnection();
$sql = "SELECT * FROM cc_country";
$res = $con->query($sql)->fetchAll();
$res = Application_Common_Database::prepareAndExecute($sql, array());
$out = array();
$out[""] = _("Select Country");
foreach ($res as $r) {

View file

@ -11,7 +11,7 @@
</dd>
<dd class="edit-error"></dd>
<?php }
if ($this->item2Type == 0) {?>
if (isset($this->item2Url)) {?>
<dt><? echo _("Fade in: "); ?><span class='spl_cue_hint'><? echo _("(ss.t)")?></span></dt>
<dd id="spl_fade_in_<?php echo $this->item2; ?>" class="spl_fade_in" data-fadein="<?php echo $this->item2Url; ?>" data-offset="<?php if ($this->item1Type == 0) { echo $this->offset; } else { echo 0; } ?>"
data-cuein="<?php echo $this->cueIn2; ?>" data-cueout="<?php echo $this->cueOut2; ?>" data-length="<?php echo $this->fadeIn; ?>"

View file

@ -4,6 +4,7 @@ if (count($items)) : ?>
<?php $i = 0; ?>
<?php foreach($items as $item) :
$staticBlock = null;
$nextFileUrl = null;
if ($item['type'] == 2) {
$bl= new Application_Model_Block($item['item_id']);
$staticBlock = $bl->isStatic();
@ -87,21 +88,33 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) {
if(($i < count($items) -1) && !($items[$i]['type'] == 2 && $items[$i+1]['type'])):
?>
<div id="crossfade_<?php echo $i ?>-<?php echo $i+1 ?>" class="crossfade clearfix" style="display: none">
<?php echo $this->partial('playlist/set-fade.phtml', array(
<?php
$vars = array(
'item1' => $items[$i]['id'],
'item2' => $items[$i+1]['id'],
'fadeOut' => $items[$i]['fadeout'],
'fadeIn' => $items[$i+1]['fadein'],
'item1Type' => $items[$i]['type'],
'item2Type' => $items[$i+1]['type'],
'item1Url' => $fileUrl,
'item2Url' => $nextFileUrl,
'fadeOut' => $items[$i]['fadeout'],
'fadeIn' => $items[$i+1]['fadein'],
'offset' => $items[$i]['trackSec'] - $items[$i+1]['trackoffset'],
'cueIn1' => $items[$i]['cueInSec'],
'cueIn1' => $items[$i]['cueInSec'],
'cueOut1' => $items[$i]['cueOutSec'],
'item1Url' => $fileUrl
);
$item2 = array(
'item2Url' => $nextFileUrl,
'item2' => $items[$i+1]['id'],
'item2Type' => $items[$i+1]['type'],
'offset' => $items[$i]['trackSec'] - $items[$i+1]['trackoffset'],
'cueIn2' => $items[$i+1]['cueInSec'],
'cueOut2' => $items[$i+1]['cueOutSec'])
); ?>
'cueOut2' => $items[$i+1]['cueOutSec']
);
if (isset($nextFileUrl)) {
$vars = $vars + $item2;
}
echo $this->partial('playlist/set-fade.phtml', $vars);
?>
</div>
<?php endif; ?>
<?php if ($item['type'] == 2) {?>