Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
c6dafd5df9
|
@ -7,6 +7,8 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||||
$ajaxContext->addActionContext('get-data-grid-data', 'json')
|
$ajaxContext->addActionContext('get-data-grid-data', 'json')
|
||||||
|
->addActionContext('register', 'json')
|
||||||
|
->addActionContext('remindme', 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,11 +26,47 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id);
|
$user = new User($userInfo->id);
|
||||||
|
|
||||||
|
$form = new Application_Form_RegisterAirtime();
|
||||||
|
|
||||||
|
if ($request->isPost()) {
|
||||||
|
$values = $request->getPost();
|
||||||
|
if ($values["Publicise"] == '1' && $form->isValid($values)) {
|
||||||
|
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
|
||||||
|
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||||
|
Application_Model_Preference::SetEmail($values["Email"]);
|
||||||
|
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||||
|
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||||
|
|
||||||
|
$form->Logo->receive();
|
||||||
|
$imagePath = $form->Logo->getFileName();
|
||||||
|
|
||||||
|
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||||
|
Application_Model_Preference::SetStationCity($values["City"]);
|
||||||
|
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||||
|
Application_Model_Preference::SetStationLogo($imagePath);
|
||||||
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
// unset session
|
||||||
|
Zend_Session::namespaceUnset('referrer');
|
||||||
|
}else{
|
||||||
|
$logo = Application_Model_Preference::GetStationLogo();
|
||||||
|
if($logo){
|
||||||
|
$this->view->logoImg = $logo;
|
||||||
|
}
|
||||||
|
$this->view->dialog = $form;
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js','text/javascript');
|
||||||
|
}
|
||||||
|
}else{
|
||||||
if($refer_sses->referrer == 'login' && Application_Model_Nowplaying::ShouldShowPopUp()
|
if($refer_sses->referrer == 'login' && Application_Model_Nowplaying::ShouldShowPopUp()
|
||||||
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
|
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
|
||||||
|
$logo = Application_Model_Preference::GetStationLogo();
|
||||||
|
if($logo){
|
||||||
|
$this->view->logoImg = $logo;
|
||||||
|
}
|
||||||
|
$this->view->dialog = $form;
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js','text/javascript');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getDataGridDataAction()
|
public function getDataGridDataAction()
|
||||||
{
|
{
|
||||||
|
@ -53,6 +91,59 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/dayview.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/dayview.js','text/javascript');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*public function registerAction(){
|
||||||
|
//$request = $this->getRequest();
|
||||||
|
//$baseUrl = $request->getBaseUrl();
|
||||||
|
|
||||||
|
//$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript');
|
||||||
|
|
||||||
|
$form = new Application_Form_RegisterAirtime();
|
||||||
|
|
||||||
|
/*if ($request->isPost()) {
|
||||||
|
$values = $request->getPost();
|
||||||
|
if ($values["Publicise"] == '1' && $form->isValid($values)) {
|
||||||
|
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
|
||||||
|
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||||
|
Application_Model_Preference::SetEmail($values["Email"]);
|
||||||
|
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||||
|
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||||
|
|
||||||
|
$form->Logo->receive();
|
||||||
|
$imagePath = $form->Logo->getFileName();
|
||||||
|
|
||||||
|
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||||
|
Application_Model_Preference::SetStationCity($values["City"]);
|
||||||
|
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||||
|
Application_Model_Preference::SetStationLogo($imagePath);
|
||||||
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
// unset session
|
||||||
|
Zend_Session::namespaceUnset('referrer');
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
$logo = Application_Model_Preference::GetStationLogo();
|
||||||
|
if($logo){
|
||||||
|
$this->view->logoImg = $logo;
|
||||||
|
}
|
||||||
|
$this->view->dialog = $form->render($this->view);
|
||||||
|
//}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public function remindmeAction()
|
||||||
|
{
|
||||||
|
// unset session
|
||||||
|
Zend_Session::namespaceUnset('referrer');
|
||||||
|
$now = date("Y-m-d H:i:s");
|
||||||
|
Application_Model_Preference::SetRemindMeDate($now);
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function donotshowpopupAction()
|
||||||
|
{
|
||||||
|
// unset session
|
||||||
|
Zend_Session::namespaceUnset('referrer');
|
||||||
|
die();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
/* Initialize action controller here */
|
/* Initialize action controller here */
|
||||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||||
$ajaxContext->addActionContext('register', 'json')
|
$ajaxContext/*->addActionContext('register', 'json')
|
||||||
->addActionContext('remindme', 'json')
|
->addActionContext('remindme', 'json')*/
|
||||||
->addActionContext('server-browse', 'json')
|
->addActionContext('server-browse', 'json')
|
||||||
->addActionContext('change-stor-directory', 'json')
|
->addActionContext('change-stor-directory', 'json')
|
||||||
->addActionContext('reload-watch-directory', 'json')
|
->addActionContext('reload-watch-directory', 'json')
|
||||||
|
@ -50,6 +50,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
Application_Model_Preference::SetSupportFeedback($values["preferences_support"]["SupportFeedback"]);
|
Application_Model_Preference::SetSupportFeedback($values["preferences_support"]["SupportFeedback"]);
|
||||||
Application_Model_Preference::SetPublicise($values["preferences_support"]["Publicise"]);
|
Application_Model_Preference::SetPublicise($values["preferences_support"]["Publicise"]);
|
||||||
|
|
||||||
|
$form->getSubForm('preferences_support')->Logo->receive();
|
||||||
$imagePath = $form->getSubForm('preferences_support')->Logo->getFileName();
|
$imagePath = $form->getSubForm('preferences_support')->Logo->getFileName();
|
||||||
|
|
||||||
Application_Model_Preference::SetStationCountry($values["preferences_support"]["Country"]);
|
Application_Model_Preference::SetStationCountry($values["preferences_support"]["Country"]);
|
||||||
|
@ -67,60 +68,6 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerAction(){
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript');
|
|
||||||
|
|
||||||
$form = new Application_Form_RegisterAirtime();
|
|
||||||
|
|
||||||
if ($request->isPost()) {
|
|
||||||
$values = $request->getPost();
|
|
||||||
if ($values["Publicise"] == '1' && $form->isValid($values)) {
|
|
||||||
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
|
|
||||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
|
||||||
Application_Model_Preference::SetEmail($values["Email"]);
|
|
||||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
|
||||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
|
||||||
|
|
||||||
$imagePath = $form->Logo->getFileName();
|
|
||||||
|
|
||||||
Application_Model_Preference::SetStationCountry($values["Country"]);
|
|
||||||
Application_Model_Preference::SetStationCity($values["City"]);
|
|
||||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
|
||||||
Application_Model_Preference::SetStationLogo($imagePath);
|
|
||||||
}
|
|
||||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
|
||||||
// unset session
|
|
||||||
Zend_Session::namespaceUnset('referrer');
|
|
||||||
$this->_redirect('Nowplaying');
|
|
||||||
}else{
|
|
||||||
$logo = Application_Model_Preference::GetStationLogo();
|
|
||||||
if($logo){
|
|
||||||
$this->view->logoImg = $logo;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->view->dialog = $form->render($this->view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function remindmeAction()
|
|
||||||
{
|
|
||||||
// unset session
|
|
||||||
Zend_Session::namespaceUnset('referrer');
|
|
||||||
$now = date("Y-m-d H:i:s");
|
|
||||||
Application_Model_Preference::SetRemindMeDate($now);
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function donotshowpopupAction()
|
|
||||||
{
|
|
||||||
// unset session
|
|
||||||
Zend_Session::namespaceUnset('referrer');
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function directoryConfigAction()
|
public function directoryConfigAction()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setAction('/Preference/register');
|
$this->setAction('/Nowplaying');
|
||||||
$this->setMethod('post');
|
$this->setMethod('post');
|
||||||
|
|
||||||
$country_list = Application_Model_Preference::GetCountryList();
|
$country_list = Application_Model_Preference::GetCountryList();
|
||||||
|
@ -95,14 +95,14 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
$upload = new Zend_Form_Element_File('Logo');
|
$upload = new Zend_Form_Element_File('Logo');
|
||||||
$upload->setLabel('Station Logo:')
|
$upload->setLabel('Station Logo:')
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setDecorators(array('File'));
|
->setDecorators(array('File'))
|
||||||
/*->addValidator('Count', false, 1)
|
->addValidator('Count', false, 1)
|
||||||
->addValidator('Extension', false, 'jpg,png,gif')
|
->addValidator('Extension', false, 'jpg,png,gif')
|
||||||
->addValidator('ImageSize', false, array(
|
->addValidator('ImageSize', false, array(
|
||||||
'minwidth' => 200,
|
'minwidth' => 200,
|
||||||
'minheight' => 200,
|
'minheight' => 200,
|
||||||
'maxwidth' => 600,
|
'maxwidth' => 600,
|
||||||
'maxheight' => 600));*/
|
'maxheight' => 600));
|
||||||
$this->addElement($upload);
|
$this->addElement($upload);
|
||||||
|
|
||||||
//enable support feedback
|
//enable support feedback
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="dialogPopup register-dialog" title="Register Airtime">
|
<div id="register_popup" class="dialogPopup register-dialog" title="Register Airtime" style="display: none;">
|
||||||
<form id="register-form" method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="multipart/form-data">
|
<form id="register-form" method="<?php echo $this->element->getMethod() ?>" action="<?php echo $this->element->getAction() ?>" enctype="multipart/form-data">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<dl class="zend_form">
|
<dl class="zend_form">
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
<span class="toggle-button-active end-button" id="now_view">Now View</span><span class="toggle-button" id="day_view">Day View</span>
|
<span class="toggle-button-active end-button" id="now_view">Now View</span><span class="toggle-button" id="day_view">Day View</span>
|
||||||
</div>
|
</div>
|
||||||
<table cellpadding="0" cellspacing="0" border="0" class="datatable" id="nowplayingtable"></table>
|
<table cellpadding="0" cellspacing="0" border="0" class="datatable" id="nowplayingtable"></table>
|
||||||
|
<?php echo $this->dialog?>
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var dialogGlob;
|
|
||||||
|
|
||||||
function doNotShowPopup(){
|
function doNotShowPopup(){
|
||||||
$.get("/Preference/donotshowpopup");
|
$.get("/Nowplaying/donotshowpopup");
|
||||||
}
|
}
|
||||||
|
|
||||||
$.get("/Preference/register", {format:"json"}, function(json){
|
var dialog = $("#register_popup");
|
||||||
var dialog = $(json.dialog);
|
|
||||||
dialogGlob = dialog;
|
|
||||||
|
|
||||||
dialog.dialog({
|
dialog.dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
|
@ -21,7 +18,7 @@ $(document).ready(function(){
|
||||||
id: "remind_me",
|
id: "remind_me",
|
||||||
text: "Remind me in 1 week",
|
text: "Remind me in 1 week",
|
||||||
click: function() {
|
click: function() {
|
||||||
var url = '/Preference/remindme';
|
var url = '/Nowplaying/remindme';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
});
|
});
|
||||||
|
@ -32,14 +29,8 @@ $(document).ready(function(){
|
||||||
id: "help_airtime",
|
id: "help_airtime",
|
||||||
text: "Yes, help Airtime",
|
text: "Yes, help Airtime",
|
||||||
click: function() {
|
click: function() {
|
||||||
if($("#Publicise").is(':checked')){
|
|
||||||
if(validateFields()){
|
|
||||||
$("#register-form").submit();
|
$("#register-form").submit();
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
$("#register-form").submit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -47,7 +38,7 @@ $(document).ready(function(){
|
||||||
var button = $("#help_airtime");
|
var button = $("#help_airtime");
|
||||||
button.attr('disabled', 'disabled').addClass('ui-state-disabled');
|
button.attr('disabled', 'disabled').addClass('ui-state-disabled');
|
||||||
dialog.dialog('open');
|
dialog.dialog('open');
|
||||||
})
|
|
||||||
|
|
||||||
$('.collapsible-header').live('click',function() {
|
$('.collapsible-header').live('click',function() {
|
||||||
$(this).next().toggle('fast');
|
$(this).next().toggle('fast');
|
||||||
|
@ -72,13 +63,17 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#Publicise").live('click', function(){
|
var promote = $("#Publicise");
|
||||||
|
promote.live('click', function(){
|
||||||
if($(this).is(':checked')){
|
if($(this).is(':checked')){
|
||||||
$("#public-info").show();
|
$("#public-info").show();
|
||||||
}else{
|
}else{
|
||||||
$("#public-info").hide();
|
$("#public-info").hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if( promote.is(":checked")){
|
||||||
|
$("#public-info").show();
|
||||||
|
}
|
||||||
|
|
||||||
$("#Privacy").live('click', function(){
|
$("#Privacy").live('click', function(){
|
||||||
var support = $("#SupportFeedback");
|
var support = $("#SupportFeedback");
|
||||||
|
@ -90,6 +85,12 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if($("#SupportFeedback").is(':checked') && $("#Privacy").is(':checked')){
|
||||||
|
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
||||||
|
}else{
|
||||||
|
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
||||||
|
}
|
||||||
|
|
||||||
$("#link_to_whos_using").live('click', function(){
|
$("#link_to_whos_using").live('click', function(){
|
||||||
window.open("http://sourcefabric.org/en/products/airtime_whosusing");
|
window.open("http://sourcefabric.org/en/products/airtime_whosusing");
|
||||||
});
|
});
|
||||||
|
@ -104,32 +105,6 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function validateFields(){
|
|
||||||
var stnName = $("#stnName");
|
|
||||||
|
|
||||||
var errors = new Array();
|
|
||||||
|
|
||||||
errors[0] = displayError(stnName);
|
|
||||||
|
|
||||||
for( e in errors ){
|
|
||||||
if(errors[e]){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayError(ele){
|
|
||||||
var errorMsg = "Value is required and can't be empty";
|
|
||||||
|
|
||||||
ele.parent().find("ul").remove();
|
|
||||||
if($.trim(ele.val()) == ''){
|
|
||||||
ele.parent().append("<ul class='errors'><li>"+errorMsg+"</li></ul>");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function resizeImg(ele){
|
function resizeImg(ele){
|
||||||
|
|
||||||
var img = $(ele);
|
var img = $(ele);
|
||||||
|
|
Loading…
Reference in New Issue