CC-3932: Master/Source Source Connection URL should be in non-editable box
-done
This commit is contained in:
parent
8b71ed6078
commit
4bcf904f92
|
@ -51,6 +51,22 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_password);
|
||||
|
||||
//Master source connection url
|
||||
$master_dj_connection_url = new Zend_Form_Element_Text('master_dj_connection_url');
|
||||
$master_dj_connection_url->setAttrib('readonly', true)
|
||||
->setLabel('Master Source Connection URL')
|
||||
->setValue(Application_Model_StreamSetting::GetConnectionUrls('master'))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_dj_connection_url);
|
||||
|
||||
//Show source connection url
|
||||
$live_dj_connection_url = new Zend_Form_Element_Text('live_dj_connection_url');
|
||||
$live_dj_connection_url->setAttrib('readonly', true)
|
||||
->setLabel('Show Source Connection URL')
|
||||
->setValue(Application_Model_StreamSetting::GetConnectionUrls('show'))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($live_dj_connection_url);
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
if (!$isSaas) {
|
||||
$m_port = Application_Model_StreamSetting::GetMasterLiveSteamPort();
|
||||
|
@ -105,29 +121,12 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
|
||||
public function updateVariables(){
|
||||
global $CC_CONFIG;
|
||||
|
||||
$m_port = Application_Model_StreamSetting::GetMasterLiveSteamPort();
|
||||
$m_mount = Application_Model_StreamSetting::GetMasterLiveSteamMountPoint();
|
||||
$l_port = Application_Model_StreamSetting::GetDJLiveSteamPort();
|
||||
$l_mount = Application_Model_StreamSetting::GetDJLiveSteamMountPoint();
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
|
||||
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();
|
||||
$live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL();
|
||||
|
||||
$master_dj_connection_url = ($master_dj_connection_url == "")?("http://".$_SERVER['SERVER_NAME'].":".$m_port."/".$m_mount):$master_dj_connection_url;
|
||||
$live_dj_connection_url = ($live_dj_connection_url == "")?"http://".$_SERVER['SERVER_NAME'].":".$l_port."/".$l_mount:$live_dj_connection_url;
|
||||
|
||||
if($m_port=="" || $m_mount==""){
|
||||
$master_dj_connection_url = "N/A";
|
||||
}
|
||||
if($l_port=="" || $l_mount==""){
|
||||
$live_dj_connection_url = "N/A";
|
||||
}
|
||||
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url, 'isSaas' => $isSaas, 'isDemo' => $isDemo))
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'isSaas' => $isSaas, 'isDemo' => $isDemo))
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -281,6 +281,28 @@ class Application_Model_StreamSetting {
|
|||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public static function GetConnectionUrls($p_source_type) {
|
||||
if (strcmp($p_source_type, "master")==0) {
|
||||
$m_port = Application_Model_StreamSetting::GetMasterLiveSteamPort();
|
||||
$m_mount = Application_Model_StreamSetting::GetMasterLiveSteamMountPoint();
|
||||
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();
|
||||
$connection_url = ($master_dj_connection_url == "")?("http://".$_SERVER['SERVER_NAME'].":".$m_port."/".$m_mount):$master_dj_connection_url;
|
||||
if($m_port=="" || $m_mount==""){
|
||||
$connection_url = "N/A";
|
||||
}
|
||||
}
|
||||
else if (strcmp($p_source_type, "show")==0) {
|
||||
$l_port = Application_Model_StreamSetting::GetDJLiveSteamPort();
|
||||
$l_mount = Application_Model_StreamSetting::GetDJLiveSteamMountPoint();
|
||||
$live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL();
|
||||
$connection_url = ($live_dj_connection_url == "")?"http://".$_SERVER['SERVER_NAME'].":".$l_port."/".$l_mount:$live_dj_connection_url;
|
||||
if($l_port=="" || $l_mount==""){
|
||||
$connection_url = "N/A";
|
||||
}
|
||||
}
|
||||
return $connection_url;
|
||||
}
|
||||
|
||||
public static function SetMasterLiveSteamPort($value){
|
||||
self::SetValue("master_live_stream_port", $value, "integer");
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
</label>
|
||||
</dt>
|
||||
<dd id="master_dj_connection_url-element">
|
||||
<span id="stream_url" class="static_text"><?php echo $this->master_dj_connection_url ?></span>
|
||||
<span id="stream_url" class="static_text"><?php echo $this->element->getElement('master_dj_connection_url') ?></span>
|
||||
<?php if( !$this->isSaas && !$this->isDemo){?>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">override</a>
|
||||
<span class="override_help_icon">
|
||||
|
@ -121,7 +121,7 @@
|
|||
</label>
|
||||
</dt>
|
||||
<dd id="live_dj_connection_url-element">
|
||||
<span id="stream_url" class="static_text"><?php echo $this->live_dj_connection_url ?></span>
|
||||
<span id="stream_url" class="static_text"><?php echo $this->element->getElement('live_dj_connection_url') ?></span>
|
||||
<?php if( !$this->isSaas && !$this->isDemo ){?>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">override</a>
|
||||
<span class="override_help_icon">
|
||||
|
|
Loading…
Reference in New Issue