From 20eacb439c06105ee15fedd4481828f0703a3aa9 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Wed, 8 Sep 2010 10:02:53 -0400 Subject: [PATCH] Editing the archive Url from the gui. --- .../htmlUI/var/formmask/generic.inc.php | 13 ++++++++ .../htmlUI/var/templates/playlist/editor.tpl | 2 +- src/modules/storageServer/var/Transport.php | 30 ++++++++++++++++--- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/modules/htmlUI/var/formmask/generic.inc.php b/src/modules/htmlUI/var/formmask/generic.inc.php index 2de204d62..351f35582 100644 --- a/src/modules/htmlUI/var/formmask/generic.inc.php +++ b/src/modules/htmlUI/var/formmask/generic.inc.php @@ -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, diff --git a/src/modules/htmlUI/var/templates/playlist/editor.tpl b/src/modules/htmlUI/var/templates/playlist/editor.tpl index 1563ca095..55cb5f1d0 100644 --- a/src/modules/htmlUI/var/templates/playlist/editor.tpl +++ b/src/modules/htmlUI/var/templates/playlist/editor.tpl @@ -3,7 +3,7 @@

##Playlist Editor##

-

{$PL->title}   {getHour time=$PL->duration}##h## {getMinute time=$PL->duration}##m## {getSecond time=$PL->duration}##s##

+

{$PL->title}   {niceTime in=$PL->duration}  

diff --git a/src/modules/storageServer/var/Transport.php b/src/modules/storageServer/var/Transport.php index a6cd4e2de..fa4dbcfa6 100644 --- a/src/modules/storageServer/var/Transport.php +++ b/src/modules/storageServer/var/Transport.php @@ -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) {