$hidden_lines[] = 'Duplex: ' . $link_info['duplex'];
if (count ($hidden_lines))
$result[$portname]['popup'] = implode ('<br>', $hidden_lines);
- $visible_part = '<img width="16" height="16" src="' . TSURI ("pix/${img_filename}") . '">';
+ $visible_part = "<img width=16 height=16 src='?module=chrome&uri=pix/${img_filename}'>";
$result[$portname]['inline'] = $visible_part;
}
// put empty pictures for not-found ports
amplifyCell ($object);
foreach ($object['ports'] as $port)
if (! isset ($result[$port['name']]))
- $result[$port['name']]['inline'] = '<img width="16" height="16" src="' . TSURI ('pix/1x1t.gif') . ' ">';
+ $result[$port['name']]['inline'] = "<img width=16 height=16 src='?module=chrome&uri=pix/1x1t.gif'>";
return $result;
}
define ('RE_L2_WWN_SOLID', '/^[0-9a-f]{16}$/i');
define ('RE_IP4_ADDR', '#^[0-9]{1,3}(\.[0-9]{1,3}){3}$#');
define ('RE_IP4_NET', '#^[0-9]{1,3}(\.[0-9]{1,3}){3}/[0-9]{1,2}$#');
-define ('RE_STATIC_URI', '#^([[:alpha:]]+)/(?:[[:alpha:]]+/)*[[:alnum:]\._-]*\.([[:alpha:]]+)$#');
+define ('RE_STATIC_URI', '#^([[:alpha:]]+)/(?:[[:alpha:]]+/)*[[:alnum:]\._-]+\.([[:alpha:]]+)$#');
define ('E_8021Q_NOERROR', 0);
define ('E_8021Q_VERSION_CONFLICT', 101);
define ('E_8021Q_PULL_REMOTE_ERROR', 102);
return long2ip($quad);
}
-// translate static URI
-function TSURI ($URI)
-{
- global $racktables_static_dir;
- if (! isset ($racktables_static_dir))
- return $URI;
- return "?module=tsuri&uri=${URI}";
-}
-
// make "A" HTML element
function mkA ($text, $nextpage, $bypass = NULL, $nexttab = NULL)
{
if ($item['type'] == 'inline')
echo '<style type="text/css">' . "\n" . trim ($item['style'], "\r\n") . "\n</style>\n";
elseif ($item['type'] == 'file')
- echo '<link rel="stylesheet" type="text/css" href="' . TSURI ($item['style']) . "\" />\n";
+ echo "<link rel=stylesheet type='text/css' href='?module=chrome&uri=${item['style']}' />\n";
// add JS scripts
foreach (addJS (NULL) as $group_name => $js_list)
or ! array_key_exists ($matches[2], $content_type)
)
printStatic404();
- global $racktables_static_dir;
- $file_path = (isset ($racktables_static_dir) ? $racktables_static_dir : '.') . '/' . $URI;
- if (! file_exists ($file_path))
+ global $racktables_staticdir;
+ if (! file_exists ("${racktables_staticdir}/${URI}"))
printStatic404();
header ('Content-type: ' . $content_type[$matches[2]]);
- readfile ($file_path);
+ readfile ("${racktables_staticdir}/${URI}");
}
?>
$user_auth_src = 'database';
$require_local_account = TRUE;
$racktables_gwdir = '../gateways';
+$racktables_staticdir = '.';
// (re)connects to DB, stores PDO object in $dbxlink global var
function connectDB()
if (!isset ($image[$tag]))
$tag = 'error';
$img = $image[$tag];
- $img['path'] = TSURI ($img['path']);
+ $img['path'] = '?module=chrome&uri=' . $img['path'];
if ($do_input == TRUE)
return
"<input type=image name=submit class=icon " .
ob_clean();
renderInterfaceHTML ($pageno, $tabno, $contents);
break;
- case 'tsuri' == $_REQUEST['module']:
+ case 'chrome' == $_REQUEST['module']:
require_once 'inc/init.php';
genericAssertion ('uri', 'string');
proxyStaticURI ($_REQUEST['uri']);
port_cmenu = $.contextMenu.create(port_cmenu_items, {theme:'vista'});
// add popup button after every portname
$('.interactive-portname.port-menu').after('<a title="Show info from switch" class="port-popup" href="#">…</a>');
- $('<div />').hide().addClass('cursor-shadow').css('position', 'absolute').css('width', 16).css('height', 16).css("background-image", "url(pix/ajax-loader.gif").appendTo('body');
+ $('<div />').hide().addClass('cursor-shadow').css('position', 'absolute').css('width', 16).css('height', 16).css("background-image", "url(index.php?module=chrome&uri=pix/ajax-loader.gif").appendTo('body');
// bind popup menu to every link with class port-popup
$('a.port-popup').bind('click', function(e){port_cmenu.show(this,e);return false;});
function setItemIcon(menuItem, iconName) {
var iconURL;
if (iconName == 'wait')
- iconURL = 'pix/ajax-loader.gif';
+ iconURL = 'index.php?module=chrome&uri=pix/ajax-loader.gif';
else if (iconName == 'ok')
- iconURL = 'pix/checkbox_yes.png';
+ iconURL = 'index.php?module=chrome&uri=pix/checkbox_yes.png';
$(menuItem).children('.' + $.contextMenu.innerDivClassName).css("background-image", "url(" + iconURL + ")");
}