Skip to content

Commit

Permalink
Merge branch '2.5.x' into 2.5.x-installer
Browse files Browse the repository at this point in the history
Conflicts:
	airtime_mvc/public/index.php
  • Loading branch information
Albert Santoni committed Jun 16, 2015
2 parents b5b3d96 + efad7be commit 8c9981a
Show file tree
Hide file tree
Showing 46 changed files with 5,024 additions and 996 deletions.
2 changes: 1 addition & 1 deletion airtime_mvc/application/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected function _initHeadScript()

$view->headScript()->appendFile($baseUrl.'js/libs/underscore-min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');

$view->headScript()->appendFile($baseUrl.'js/libs/jquery.stickyPanel.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
// $view->headScript()->appendFile($baseUrl.'js/libs/jquery.stickyPanel.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl.'js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,14 @@ private function createElementMap($track)
$elementMap['element_mp3'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/ogg') {
$elementMap['element_oga'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/vorbis') {
$elementMap['element_oga'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/mp4') {
$elementMap['element_m4a'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/wav') {
$elementMap['element_wav'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/x-wav') {
$elementMap['element_wav'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/x-flac') {
$elementMap['element_flac'] = $track['item_id'];
} else {
Expand Down Expand Up @@ -289,10 +293,14 @@ public function getShowAction()
$elementMap['element_mp3'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/ogg') {
$elementMap['element_oga'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/vorbis') {
$elementMap['element_oga'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/mp4') {
$elementMap['element_m4a'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/wav') {
$elementMap['element_wav'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/x-wav') {
$elementMap['element_wav'] = $track['item_id'];
} elseif (strtolower($mime) === 'audio/x-flac') {
$elementMap['element_flac'] = $track['item_id'];
} else {
Expand Down
45 changes: 27 additions & 18 deletions airtime_mvc/application/controllers/PreferenceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ public function indexAction()
$form = new Application_Form_Preferences();
$values = array();

if ($request->isPost()) {
$params = $request->getPost();
$postData = explode('&', $params['data']);
foreach($postData as $k=>$v) {
$v = explode('=', $v);
$values[$v[0]] = urldecode($v[1]);
}
if ($form->isValid($values)) {

if ($request->isPost()) {
$values = $request->getPost();
if ($form->isValid($values))
{
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
Application_Model_Preference::SetStationDescription($values["stationDescription"]);
Application_Model_Preference::SetDefaultCrossfadeDuration($values["stationDefaultCrossfadeDuration"]);
Application_Model_Preference::SetDefaultFadeIn($values["stationDefaultFadeIn"]);
Application_Model_Preference::SetDefaultFadeOut($values["stationDefaultFadeOut"]);
Expand All @@ -52,6 +49,15 @@ public function indexAction()
Application_Model_Preference::SetDefaultTimezone($values["timezone"]);
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);

$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
$logoUploadElement->receive();
$imagePath = $logoUploadElement->getFileName();

// Only update the image logo if the new logo is non-empty
if (!is_null($imagePath) && $imagePath != "") {
Application_Model_Preference::SetStationLogo($imagePath);
}

Application_Model_Preference::SetEnableSystemEmail($values["enableSystemEmail"]);
Application_Model_Preference::SetSystemEmail($values["systemEmail"]);
Application_Model_Preference::SetMailServerConfigured($values["configureMailServer"]);
Expand All @@ -73,12 +79,14 @@ public function indexAction()

$this->view->statusMsg = "<div class='success'>". _("Preferences updated.")."</div>";
$this->view->form = $form;
$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')));
//$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')));
} else {
$this->view->form = $form;
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml')));
//$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml')));
}
}
$this->view->logoImg = Application_Model_Preference::GetStationLogo();

$this->view->form = $form;
}

Expand Down Expand Up @@ -111,24 +119,16 @@ public function supportSettingAction()
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
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);
if (isset($values["Privacy"])) {
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
}
}
$this->view->statusMsg = "<div class='success'>"._("Support setting updated.")."</div>";
}

$logo = Application_Model_Preference::GetStationLogo();
if ($logo) {
$this->view->logoImg = $logo;
}
$privacyChecked = false;
if (Application_Model_Preference::GetPrivacyPolicyCheck() == 1) {
$privacyChecked = true;
Expand All @@ -151,6 +151,15 @@ public function directoryConfigAction()
$this->view->form = $watched_dirs_pref;
}

public function removeLogoAction()
{
$this->view->layout()->disableLayout();
// Remove reliance on .phtml files to render requests
$this->_helper->viewRenderer->setNoRender(true);

Application_Model_Preference::SetStationLogo("");
}

public function streamSettingAction()
{
$CC_CONFIG = Config::getConfig();
Expand Down
1 change: 0 additions & 1 deletion airtime_mvc/application/controllers/ScheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public function eventFeedPreloadAction()
$editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));

$calendar_interval = Application_Model_Preference::GetCalendarTimeScale();
Logging::info($calendar_interval);
if ($calendar_interval == "agendaDay") {
list($start, $end) = Application_Model_Show::getStartEndCurrentDayView();
} else if ($calendar_interval == "agendaWeek") {
Expand Down
8 changes: 8 additions & 0 deletions airtime_mvc/application/controllers/ShowbuilderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,14 @@ public function scheduleAddAction()
$mediaItems = $request->getParam("mediaIds", array());
$scheduledItems = $request->getParam("schedIds", array());

$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "showbuilder/schedule-add";
$log_vars["params"] = array();
$log_vars["params"]["media_items"] = $mediaItems;
$log_vars["params"]["scheduled_items"] = $scheduledItems;
Logging::info($log_vars);

try {
$scheduler = new Application_Model_Scheduler();
$scheduler->scheduleAfter($scheduledItems, $mediaItems);
Expand Down
22 changes: 22 additions & 0 deletions airtime_mvc/application/forms/GeneralPreferences.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php

require_once 'customfilters/ImageSize.php';

class Application_Form_GeneralPreferences extends Zend_Form_SubForm
{

public function init()
{
$maxLens = Application_Model_Show::getMaxLengths();
$this->setEnctype(Zend_Form::ENCTYPE_MULTIPART);

$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
$rangeValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(0, 59.9);
Expand Down Expand Up @@ -34,6 +37,25 @@ public function init()
$stationDescription->setAttrib('rows', 4);
$this->addElement($stationDescription);

// Station Logo
$stationLogoUpload = new Zend_Form_Element_File('stationLogo');
$stationLogoUpload->setLabel(_('Station Logo:'))
->setDescription(_("Note: Anything larger than 600x600 will be resized."))
->setRequired(false)
->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->setMaxFileSize(1000000)
->addFilter('ImageSize');
$stationLogoUpload->setAttrib('accept', 'image/*');
$this->addElement($stationLogoUpload);

$stationLogoRemove = new Zend_Form_Element_Button('stationLogoRemove');
$stationLogoRemove->setLabel(_('Remove'));
$stationLogoRemove->setAttrib('class', 'btn');
$stationLogoRemove->setAttrib('id', 'logo-remove-btn');
$stationLogoRemove->setAttrib('onclick', 'removeLogo();');
$this->addElement($stationLogoRemove);

//Default station crossfade duration
$this->addElement('text', 'stationDefaultCrossfadeDuration', array(
'class' => 'input_text',
Expand Down
10 changes: 7 additions & 3 deletions airtime_mvc/application/forms/Preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ public function init()
{
$baseUrl = Application_Common_OsPath::getBaseDir();

$this->setMethod('post');


$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/preferences.phtml'))
));
Expand All @@ -31,5 +28,12 @@ public function init()
$soundcloud_pref = new Application_Form_SoundcloudPreferences();
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud');

$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel(_('Save'));
//$submit->removeDecorator('Label');
$submit->setAttribs(array('class'=>'btn right-floated'));
$submit->removeDecorator('DtDdWrapper');

$this->addElement($submit);
}
}
13 changes: 0 additions & 13 deletions airtime_mvc/application/forms/SupportSettings.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

require_once 'customfilters/ImageSize.php';

class Application_Form_SupportSettings extends Zend_Form
{

Expand Down Expand Up @@ -96,17 +94,6 @@ public function init()
->setAttrib('COLS','58');
$this->addElement($description);

// Station Logo
$upload = new Zend_Form_Element_File('Logo');
$upload->setLabel(_('Station Logo:'))
->setRequired(false)
->setDecorators(array('File'))
->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg,jpeg,png,gif')
->addFilter('ImageSize');
$upload->setAttrib('accept', 'image/*');
$this->addElement($upload);

//enable support feedback
$this->addElement('checkbox', 'SupportFeedback', array(
'label' => _('Send support feedback'),
Expand Down
2 changes: 1 addition & 1 deletion airtime_mvc/application/layouts/scripts/layout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<body>

<?php echo $this->partial('partialviews/trialBox.phtml', array("is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining())) ?>
<div id="Panel">
<div id="Panel" class="sticky">
<div class="logo"></div>
<?php echo $this->versionNotify();
$sss = $this->SourceSwitchStatus();
Expand Down
Loading

0 comments on commit 8c9981a

Please sign in to comment.