Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1068619
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 18, 4:29 PM
Size
7 KB
Mime Type
text/x-diff
Expires
Sun, Jul 20, 4:29 PM (1 d, 9 h)
Engine
blob
Format
Raw Data
Handle
691639
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/head.php
===================================================================
--- trunk/admin/head.php (revision 3845)
+++ trunk/admin/head.php (revision 3846)
@@ -1,68 +1,143 @@
<?php
define('DBG_SHOW_MEMORY_USAGE', 0);
-
- // new startup: begin
+ define('DBG_SKIP_REPORTING', 1);
+
+ define('ADMIN', 1);
define('REL_PATH', 'admin');
$relation_level = count( explode('/', REL_PATH) );
define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
- require_once FULL_PATH.'/kernel/startup.php';
- // new startup: end
-
-$pathtolocal = $pathtoroot;
-//require_once ($pathtoroot."admin/include/elements.php");
-//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-//require_once ($pathtolocal."admin/include/navmenu.php");
-//require_once($pathtoroot."admin/toolbar.php");
- //print_r($objSession);
+ define('APPLICATION_CLASS', 'MyApplication');
+ include_once(FULL_PATH.'/kernel/kernel4/startup.php');
- $userid= $objSession->Get("PortalUserId");
- if($userid!=-1)
- {
- $userobj=$objUsers->GetItem($userid);
- $loginname= $userobj->Get("Login");
- }
- else
- $loginname = "root";
+ $application =& kApplication::Instance();
+ $application->Init();
- $logout = $rootURL."admin/";
- $mainpage = $rootURL."admin/subitems.php?"."env=".BuildEnv()."§ion=in-portal:root";
- $objLang = $objLanguages->GetItem($m_var_list["lang"]);
- $charset = GetRegionalOption('Charset');
+ if ($application->GetVar('check_server')) {
+ echo 'PING: '.date('d/m/Y H:i:s');
+ exit;
+ }
+
+
+ $user = $application->recallObject('u');
+ $loginname = ($user->GetID() != -1) ? $user->GetDBField('Login') : 'root';
+
+ $logout = $application->HREF('', '', Array('logout' => 1, '__URLENCODE__' => 1), 'index.php');
+ $mainpage = $application->HREF('', '', Array('section' => 'in-portal:root', '__URLENCODE__' => 1), 'subitems.php');
+ $xmlhttp_url = $application->HREF('', '', Array('check_server' => 1, '__URLENCODE__' => 1));
+
+ $language =& $application->recallObject('lang.current');
+
+ $use_xml = $application->isDebugMode() && dbg_ConstOn('DBG_SHOW_EXPIRATION');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
-<title>HEAD</title>
-<meta http-equiv="content-type" content="text/html;charset=<?php echo $charset; ?>">
-<meta name="generator" content="Notepad">
-<link rel="stylesheet" type="text/css" href="include/style.css">
+ <title>HEAD</title>
+ <meta http-equiv="content-type" content="text/html;charset=<?php echo $language->GetDBField('Charset'); ?>">
+ <meta name="generator" content="Notepad">
+ <link rel="stylesheet" type="text/css" href="include/style.css">
+ <?php
+ if ($use_xml) {
+ ?>
+ <script language="javascript" type="text/javascript">
+ function getXMLHTTPObject()
+ {
+ var http_request = false;
+ if (window.XMLHttpRequest) { // Mozilla, Safari,...
+ http_request = new XMLHttpRequest();
+ if (http_request.overrideMimeType) {
+ http_request.overrideMimeType('text/plain');
+ // See note below about this line
+ }
+ } else if (window.ActiveXObject) { // IE
+ try {
+ http_request = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ http_request = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e) {}
+ }
+ }
+ return http_request;
+ }
+
+ function processResponce(http_request) {
+ if (http_request.readyState == 4) {
+ if (http_request.status == 200) {
+ document.getElementById('server_status').innerHTML = http_request.responseText;
+ } else {
+ // alert('There was a problem with the request.');
+ }
+ }
+
+ }
+ </script>
+ <?php
+ }
+ ?>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td valign="bottom">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="90">
<tr>
- <td rowspan="3" valign="top"><a href="<?php echo $mainpage; ?>" target="main"><img title="In-portal" src="images/globe.gif" width="84" height="91" border="0"></a></td>
- <td rowspan="3" valign="top"><a href="<?php echo $mainpage; ?>" target="main"><img title="In-portal" src="images/logo.gif" width="150" height="91" border="0"></a></td>
- <td rowspan="3" width="100000" align="right"> </td>
- <td width="400"><img title="" src="images/blocks.gif" width="400" height="73"></td>
+ <td rowspan="3" valign="top">
+ <a href="<?php echo $mainpage; ?>" target="main"><img title="In-portal" src="images/globe.gif" width="84" height="91" border="0"></a>
+ </td>
+ <td rowspan="3" valign="top">
+ <a href="<?php echo $mainpage; ?>" target="main"><img title="In-portal" src="images/logo.gif" width="150" height="91" border="0"></a>
+ </td>
+ <td rowspan="3" width="100000" align="center">
+ <?php
+ echo $use_xml ? '<div id="server_status"></div>' : ' ';
+ ?>
+ </td>
+ <td width="400">
+ <img title="" src="images/blocks.gif" width="400" height="73">
+ </td>
</tr>
+
<tr>
- <td align="right" background="images/version_bg.gif" class="head_version" valign="bottom"><img title="" src="images/spacer.gif" width="1" height="10" align="absmiddle">
-
- <?php echo prompt_language("la_Logged_in_as")." "; ?><B><?php echo $loginname." "; ?></B>
- <a href="<?php echo $logout.'index.php?env='.BuildEnv().'&logout=1'; ?>" target="_parent"><img src="images/blue_bar_logout.gif" height="16" WIDTH="16" align="absmiddle" BORDER="0"></A></td>
+ <td align="right" background="images/version_bg.gif" class="head_version" valign="bottom">
+ <img title="" src="images/spacer.gif" width="1" height="10" align="absmiddle">
+ <?php echo $application->Phrase('la_Logged_in_as').' <b>'.$loginname.' </b>'; ?>
+ <a href="<?php echo $logout; ?>" target="_parent"><img src="images/blue_bar_logout.gif" height="16" width="16" align="absmiddle" border="0"></A>
+ </td>
</tr>
+
<tr>
<td><img title="" src="images/blocks2.gif" width="400" height="1"></td>
- </tr> <tr>
+ </tr>
+
+ <tr>
<td bgcolor="black" colspan="4"><img title="" src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
</table>
-
+ <?php
+ if ($use_xml) {
+ ?>
+ <script language="javascript" type="text/javascript">
+ function checkServer() {
+ var http_request = getXMLHTTPObject();
+ http_request.onreadystatechange = function() { processResponce(http_request); };
+
+ http_request.open('GET', '<?php echo $xmlhttp_url; ?>', true);
+ http_request.send(null);
+
+ setTimeout('checkServer()', 60000);
+ }
+
+ checkServer();
+ </script>
+ <?php
+ }
+ ?>
</body>
-</html>
\ No newline at end of file
+</html>
+<?php
+ $application->Done();
+?>
\ No newline at end of file
Property changes on: trunk/admin/head.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.9
\ No newline at end of property
Event Timeline
Log In to Comment