Merge branch 'saas-dev' of github.com:sourcefabric/airtime into saas-dev
This commit is contained in:
commit
4b5980d898
6 changed files with 63 additions and 38 deletions
|
@ -370,6 +370,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
// add elelments that needs to be added
|
// add elelments that needs to be added
|
||||||
// set multioption for modifier according to criteria_field
|
// set multioption for modifier according to criteria_field
|
||||||
$modRowMap = array();
|
$modRowMap = array();
|
||||||
|
if (!isset($data['criteria'])) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($data['criteria'] as $critKey=>$d) {
|
foreach ($data['criteria'] as $critKey=>$d) {
|
||||||
$count = 1;
|
$count = 1;
|
||||||
foreach ($d as $modKey=>$modInfo) {
|
foreach ($d as $modKey=>$modInfo) {
|
||||||
|
|
|
@ -67,7 +67,9 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<a href="/Plupload">
|
<a href="/Plupload">
|
||||||
<button id="add_media_btn" class="btn btn-small dashboard-btn">Upload</button>
|
<button id="add_media_btn" class="btn btn-small dashboard-btn btn-new">
|
||||||
|
<span><?php echo _("Upload") ?></span>
|
||||||
|
</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="media_type_selector top-link" data-selection-id="1">
|
<div class="media_type_selector top-link" data-selection-id="1">
|
||||||
|
|
|
@ -1517,27 +1517,27 @@ SQL;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if file exists
|
|
||||||
$qry->add("file_exists", "true", Criteria::EQUAL);
|
|
||||||
$qry->add("hidden", "false", Criteria::EQUAL);
|
|
||||||
$sortTracks = 'random';
|
|
||||||
if (isset($storedCrit['sort'])) {
|
|
||||||
$sortTracks = $storedCrit['sort']['value'];
|
|
||||||
}
|
|
||||||
if ($sortTracks == 'newest') {
|
|
||||||
$qry->addDescendingOrderByColumn('utime');
|
|
||||||
}
|
|
||||||
else if ($sortTracks == 'oldest') {
|
|
||||||
$qry->addAscendingOrderByColumn('utime');
|
|
||||||
}
|
|
||||||
else if ($sortTracks == 'random') {
|
|
||||||
$qry->addAscendingOrderByColumn('random()');
|
|
||||||
} else {
|
|
||||||
Logging::warning("Unimplemented sortTracks type in ".__FILE__);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if file exists
|
||||||
|
$qry->add("file_exists", "true", Criteria::EQUAL);
|
||||||
|
$qry->add("hidden", "false", Criteria::EQUAL);
|
||||||
|
$sortTracks = 'random';
|
||||||
|
if (isset($storedCrit['sort'])) {
|
||||||
|
$sortTracks = $storedCrit['sort']['value'];
|
||||||
|
}
|
||||||
|
if ($sortTracks == 'newest') {
|
||||||
|
$qry->addDescendingOrderByColumn('utime');
|
||||||
|
}
|
||||||
|
else if ($sortTracks == 'oldest') {
|
||||||
|
$qry->addAscendingOrderByColumn('utime');
|
||||||
|
}
|
||||||
|
else if ($sortTracks == 'random') {
|
||||||
|
$qry->addAscendingOrderByColumn('random()');
|
||||||
|
} else {
|
||||||
|
Logging::warning("Unimplemented sortTracks type in ".__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
// construct limit restriction
|
// construct limit restriction
|
||||||
$limits = array();
|
$limits = array();
|
||||||
|
|
||||||
|
|
|
@ -89,9 +89,9 @@
|
||||||
}
|
}
|
||||||
$nextDisabled = $this->element->getElement("sp_criteria_field_".$nextIndex)->getAttrib('disabled') == 'disabled'?true:false;
|
$nextDisabled = $this->element->getElement("sp_criteria_field_".$nextIndex)->getAttrib('disabled') == 'disabled'?true:false;
|
||||||
?>
|
?>
|
||||||
<div <?php if (($i > 0) && $disabled) {
|
<div <?php if (/*($i > 0) && */ $disabled) {
|
||||||
echo 'style=display:none';
|
echo 'style=display:none';
|
||||||
} ?>>
|
} ?> >
|
||||||
<?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?>
|
<?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?>
|
||||||
<?php echo $this->element->getElement("sp_criteria_modifier_".$i."_".$j) ?>
|
<?php echo $this->element->getElement("sp_criteria_modifier_".$i."_".$j) ?>
|
||||||
<?php echo $this->element->getElement("sp_criteria_value_".$i."_".$j) ?>
|
<?php echo $this->element->getElement("sp_criteria_value_".$i."_".$j) ?>
|
||||||
|
|
|
@ -3275,6 +3275,9 @@ dd .stream-status {
|
||||||
|
|
||||||
#add_media_btn {
|
#add_media_btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
font-size: 16px;
|
||||||
|
height: 38px;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-show-submit.btn:hover {
|
.add-show-submit.btn:hover {
|
||||||
|
@ -3296,11 +3299,11 @@ dd .stream-status {
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-new {
|
.btn-new {
|
||||||
background: #237686;
|
background: #246B86;
|
||||||
}
|
}
|
||||||
.btn-new:active, .btn-new:hover,
|
.btn-new:active, .btn-new:hover,
|
||||||
.btn-new[disabled], .btn-new[disabled]:active {
|
.btn-new[disabled], .btn-new[disabled]:active {
|
||||||
background-color: #1c606e;
|
background-color: #185b6e;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark_class
|
.dark_class
|
||||||
|
|
|
@ -11,18 +11,30 @@ function setSmartBlockEvents() {
|
||||||
|
|
||||||
var div = $('dd[id="sp_criteria-element"]').children('div:visible:last');
|
var div = $('dd[id="sp_criteria-element"]').children('div:visible:last');
|
||||||
|
|
||||||
div.find('.db-logic-label').text('and').show();
|
if (div.length == 0) {
|
||||||
div = div.next().show();
|
div = $('dd[id="sp_criteria-element"]').children('div:first');
|
||||||
|
div.children().removeAttr('disabled');
|
||||||
|
div.show();
|
||||||
|
|
||||||
div.children().removeAttr('disabled');
|
appendAddButton();
|
||||||
div = div.next();
|
appendModAddButton();
|
||||||
if (div.length === 0) {
|
removeButtonCheck();
|
||||||
$(this).hide();
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
div.find('.db-logic-label').text('and').show();
|
||||||
|
div = div.next().show();
|
||||||
|
|
||||||
|
div.children().removeAttr('disabled');
|
||||||
|
div = div.next();
|
||||||
|
if (div.length === 0) {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
appendAddButton();
|
||||||
|
appendModAddButton();
|
||||||
|
removeButtonCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
appendAddButton();
|
|
||||||
appendModAddButton();
|
|
||||||
removeButtonCheck();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/********** ADD MODIFIER ROW **********/
|
/********** ADD MODIFIER ROW **********/
|
||||||
|
@ -512,7 +524,9 @@ function callback(json, type) {
|
||||||
|
|
||||||
form.find('.success').show();
|
form.find('.success').show();
|
||||||
}
|
}
|
||||||
form.find('.smart-block-form').removeClass("closed");
|
removeButtonCheck();
|
||||||
|
|
||||||
|
form.find('.smart-block-form').removeClass("closed");
|
||||||
} else {
|
} else {
|
||||||
if (json.result == "0") {
|
if (json.result == "0") {
|
||||||
$('.active-tab #sp-success-saved').text($.i18n._('Smart block saved')).show();
|
$('.active-tab #sp-success-saved').text($.i18n._('Smart block saved')).show();
|
||||||
|
@ -524,6 +538,7 @@ function callback(json, type) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AIRTIME.playlist.playlistResponse(json);
|
AIRTIME.playlist.playlistResponse(json);
|
||||||
|
removeButtonCheck();
|
||||||
}
|
}
|
||||||
form.find('.smart-block-form').removeClass("closed");
|
form.find('.smart-block-form').removeClass("closed");
|
||||||
}
|
}
|
||||||
|
@ -551,6 +566,7 @@ function appendAddButton() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeButtonCheck() {
|
function removeButtonCheck() {
|
||||||
|
/*
|
||||||
var rows = $('.active-tab dd[id="sp_criteria-element"]').children('div'),
|
var rows = $('.active-tab dd[id="sp_criteria-element"]').children('div'),
|
||||||
enabled = rows.find('select[name^="sp_criteria_field"]:enabled'),
|
enabled = rows.find('select[name^="sp_criteria_field"]:enabled'),
|
||||||
rmv_button = enabled.siblings('a[id^="criteria_remove"]');
|
rmv_button = enabled.siblings('a[id^="criteria_remove"]');
|
||||||
|
@ -560,7 +576,7 @@ function removeButtonCheck() {
|
||||||
} else {
|
} else {
|
||||||
rmv_button.removeAttr('disabled');
|
rmv_button.removeAttr('disabled');
|
||||||
rmv_button.show();
|
rmv_button.show();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableLoadingIcon() {
|
function enableLoadingIcon() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue