Additional parameters in provisioning when creating stations from dashboard
This commit is contained in:
parent
ccb4b1552e
commit
52813045a6
2 changed files with 23 additions and 6 deletions
|
@ -10,6 +10,7 @@ class ProvisioningHelper
|
||||||
// Parameter values
|
// Parameter values
|
||||||
private $dbuser, $dbpass, $dbname, $dbhost, $dbowner, $apikey;
|
private $dbuser, $dbpass, $dbname, $dbhost, $dbowner, $apikey;
|
||||||
private $instanceId;
|
private $instanceId;
|
||||||
|
private $station_name, $description;
|
||||||
|
|
||||||
public function __construct($apikey)
|
public function __construct($apikey)
|
||||||
{
|
{
|
||||||
|
@ -58,6 +59,7 @@ class ProvisioningHelper
|
||||||
|
|
||||||
$this->createDatabaseTables();
|
$this->createDatabaseTables();
|
||||||
$this->initializeMusicDirsTable($this->instanceId);
|
$this->initializeMusicDirsTable($this->instanceId);
|
||||||
|
$this->initializePrefs();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
Logging::error($e->getMessage()
|
Logging::error($e->getMessage()
|
||||||
|
@ -102,6 +104,9 @@ class ProvisioningHelper
|
||||||
$this->dbhost = $_POST['dbhost'];
|
$this->dbhost = $_POST['dbhost'];
|
||||||
$this->dbowner = $_POST['dbowner'];
|
$this->dbowner = $_POST['dbowner'];
|
||||||
$this->instanceId = $_POST['instanceid'];
|
$this->instanceId = $_POST['instanceid'];
|
||||||
|
|
||||||
|
$this->station_name = $_POST['station_name'];
|
||||||
|
$this->description = $_POST['description'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -182,5 +187,12 @@ class ProvisioningHelper
|
||||||
$musicDir->save();
|
$musicDir->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize preference values passed from the dashboard (if any exist)
|
||||||
|
*/
|
||||||
|
private function initializePrefs() {
|
||||||
|
Application_Model_Preference::SetStationName($this->station_name);
|
||||||
|
Application_Model_Preference::SetStationDescription($this->description);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -326,6 +326,11 @@ class Application_Model_Preference
|
||||||
return self::getValue("station_name");
|
return self::getValue("station_name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetStationName($station_name)
|
||||||
|
{
|
||||||
|
self::setValue("station_name", $station_name);
|
||||||
|
}
|
||||||
|
|
||||||
public static function SetAutoUploadRecordedShowToSoundcloud($upload)
|
public static function SetAutoUploadRecordedShowToSoundcloud($upload)
|
||||||
{
|
{
|
||||||
self::setValue("soundcloud_auto_upload_recorded_show", $upload);
|
self::setValue("soundcloud_auto_upload_recorded_show", $upload);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue