Editing the archive Url from the gui.

This commit is contained in:
naomiaro 2010-09-08 10:02:53 -04:00
parent d5ee603215
commit 20eacb439c
3 changed files with 40 additions and 5 deletions

View File

@ -68,6 +68,19 @@ $ui_fmask = array(
'type' => 'text',
'label' => 'Scheduler startup script',
'required' => false,
),
array(
'element' => 'archiveServerLocation',
'isPref' => TRUE,
'type' => 'text',
'label' => 'Archive server location URL',
'required' => false,
),
array(
'rule' => 'regex',
'element' => 'archiveServerLocation',
'format' => UI_REGEX_URL,
'rulemsg' => 'archive server location seems not to be valid'
),
array(
'element' => UI_SCRATCHPAD_MAXLENGTH_KEY,

View File

@ -3,7 +3,7 @@
<div style="width: 574px;">
<div style="float: left;"><h1>##Playlist Editor## </h1></div>
<div style="float: right;"><h1><a href="{$UI_BROWSER}?act=PL.editMetaData" style="color: #666666">{$PL->title} &nbsp; {getHour time=$PL->duration}##h##&nbsp;{getMinute time=$PL->duration}##m##&nbsp;{getSecond time=$PL->duration}##s##</a></h1></div>
<div style="float: right;"><h1><a href="{$UI_BROWSER}?act=PL.editMetaData" style="color: #666666">{$PL->title} &nbsp; {niceTime in=$PL->duration} &nbsp;</a></h1></div>
</div>
<div class="head" style="width: 574px;">

View File

@ -1633,10 +1633,32 @@ class Transport
{
global $CC_CONFIG;
$xrp = XML_RPC_encode($pars);
$c = new XML_RPC_Client(
$CC_CONFIG['archiveUrlPath']."/".$CC_CONFIG['archiveXMLRPC'],
$CC_CONFIG['archiveUrlHost'], $CC_CONFIG['archiveUrlPort']
);
$group = 'StationPrefs';
$key = 'archiveServerLocation';
$archiveUrl = $pr->loadGroupPref(NULL/*sessid*/, $group, $key);
if($archiveUrl){
$archiveUrlInfo = parse_url($archiveUrl);
if($archiveUrlInfo['port']){
$port = $archiveUrlInfo['port'];
}
else {
$port = 80;
}
$c = new XML_RPC_Client($archiveUrlInfo['path'], $archiveUrlInfo['host'], $port);
}
else {
$c = new XML_RPC_Client(
$CC_CONFIG['archiveUrlPath']."/".$CC_CONFIG['archiveXMLRPC'],
$CC_CONFIG['archiveUrlHost'], $CC_CONFIG['archiveUrlPort']
);
}
$f = new XML_RPC_Message($method, array($xrp));
$r = $c->send($f);
if (!$r) {