r1443 + make all functions use buildVServiceName()
authorDenis Ovsienko <infrastation@yandex.ru>
Fri, 28 Dec 2007 14:53:47 +0000 (14:53 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Fri, 28 Dec 2007 14:53:47 +0000 (14:53 +0000)
+ introduce dynamic title for VS

inc/functions.php
inc/interface.php
inc/navigation.php
inc/pagetitles.php

index 7de9226..aac418f 100644 (file)
@@ -1056,7 +1056,7 @@ function buildVServiceName ($vsinfo = NULL)
                showError ('NULL argument', __FUNCTION__);
                return NULL;
        }
-       return 'VS ' . $vsinfo['vip'] . ':' . $vsinfo['vport'] . '/' . $vsinfo['proto'];
+       return $vsinfo['vip'] . ':' . $vsinfo['vport'] . '/' . $vsinfo['proto'];
 }
 
 ?>
index 15eba52..4ee5b9a 100644 (file)
@@ -1662,7 +1662,7 @@ function renderAddressspace ()
                foreach ($summary as $vsid => $vsdata)
                {
                        echo "<tr><td class=tdleft><a href='$root?page=vservice&tab=default&id=${vsid}'>";
-                       echo $vsdata['vip'] . ':' . $vsdata['vport'] . '/' . $vsdata['proto'] . '</a></td>';
+                       echo buildVServiceName ($vsdata);
                        echo "<td>${vsdata['name']}</td>";
                        foreach ($lblist as $lb_object_id)
                                echo '<td>' . (isset ($vsdata['rspools'][$lb_object_id]) ? $vsdata['rspools'][$lb_object_id] : '&nbsp;') . '</td>';
index e05e0af..fbf76f9 100644 (file)
@@ -151,7 +151,7 @@ $ophandler['ipaddress']['assignment']['delIpAssignment'] = 'delIpAssignment';
 $ophandler['ipaddress']['assignment']['editBondForAddress'] = 'editIpAssignment';
 $ophandler['ipaddress']['assignment']['bindObjectToIp'] = 'addIpAssignment';
 
-$page['vservice']['title'] = 'static_title';
+$page['vservice']['title'] = 'dynamic_title_vservice';
 $page['vservice']['parent'] = 'ipv4space';
 $page['vservice']['bypass'] = 'id';
 $page['vservice']['bypass_type'] = 'uint';
index 7accd42..d48ce64 100644 (file)
@@ -91,6 +91,23 @@ function dynamic_title_object ()
        return $ret;
 }
 
+function dynamic_title_vservice ()
+{
+       global $pageno;
+       $ret = array();
+       switch ($pageno)
+       {
+               case 'vservice':
+                       assertUIntArg ('id');
+                       $ret['name'] = buildVServiceName (getVServiceInfo ($_REQUEST['id']));
+                       $ret['params']['id'] = $_REQUEST['id'];
+                       break;
+               default:
+                       return NULL;
+       }
+       return $ret;
+}
+
 function dynamic_title_search ()
 {
        if (isset ($_REQUEST['q']))
@@ -184,9 +201,6 @@ function static_title ($pageno)
                case 'help':
                        $ret['name'] = 'Help';
                        break;
-               case 'vservice':
-                       $ret['name'] = 'Virtual service';
-                       break;
                default:
                        $ret['name'] = 'UNKNOWN';
                        break;