2011-02-03 23:51:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class PreferenceController extends Zend_Controller_Action
|
|
|
|
{
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
/* Initialize action controller here */
|
|
|
|
}
|
|
|
|
|
|
|
|
public function indexAction()
|
|
|
|
{
|
2011-04-04 00:04:14 +02:00
|
|
|
$this->view->headScript()->appendFile('/js/airtime/preferences/preferences.js','text/javascript');
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
2011-02-07 18:36:35 +01:00
|
|
|
$this->view->statusMsg = "";
|
|
|
|
|
2011-02-03 23:51:35 +01:00
|
|
|
$form = new Application_Form_Preferences();
|
2011-04-04 00:04:14 +02:00
|
|
|
|
|
|
|
if ($request->isPost()) {
|
2011-04-03 23:34:44 +02:00
|
|
|
|
2011-04-04 00:04:14 +02:00
|
|
|
if ($form->isValid($request->getPost())) {
|
|
|
|
|
|
|
|
$values = $form->getValues();
|
|
|
|
|
|
|
|
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
|
|
|
|
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
|
|
|
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
|
|
|
|
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
|
|
|
|
|
|
|
|
Application_Model_Preference::SetDoSoundCloudUpload($values["preferences_soundcloud"]["UseSoundCloud"]);
|
|
|
|
Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
|
|
|
|
Application_Model_Preference::SetSoundCloudPassword($values["preferences_soundcloud"]["SoundCloudPassword"]);
|
|
|
|
Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
|
|
|
|
Application_Model_Preference::SetSoundCloudGenre($values["preferences_soundcloud"]["SoundCloudGenre"]);
|
|
|
|
Application_Model_Preference::SetSoundCloudTrackType($values["preferences_soundcloud"]["SoundCloudTrackType"]);
|
|
|
|
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
|
|
|
|
|
|
|
|
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
|
|
|
}
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
2011-02-04 01:17:52 +01:00
|
|
|
|
2011-02-03 23:51:35 +01:00
|
|
|
$this->view->form = $form;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|