root/freepbx/branches/experimental/amp_conf/htdocs/users/header.php

Revision 2213, 4.2 kB (checked in by gregmac, 2 years ago)

Beginnings of UserPortal interface (NOT AT ALL FINISHED)

  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to native
Line 
1 <?php /* $Id: header.php 1874 2006-05-05 17:41:30Z rcourtna $ */
2 //Copyright (C) 2004 Coalescent Systems Inc. (info@coalescentsystems.ca)
3 //
4 //This program is free software; you can redistribute it and/or
5 //modify it under the terms of the GNU General Public License
6 //as published by the Free Software Foundation; either version 2
7 //of the License, or (at your option) any later version.
8 //
9 //This program is distributed in the hope that it will be useful,
10 //but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //GNU General Public License for more details.
13
14 //get the current file name
15     $currentFile = $_SERVER["PHP_SELF"];
16     $parts = Explode('/', $currentFile);
17     $currentFile = $parts[count($parts) - 1];
18
19     if (!extension_loaded('gettext')) {
20            function _($str) {
21                    return $str;
22            }
23     }
24
25 if (!$quietmode) {
26 ?>
27 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
28
29 <html>
30
31 <head>
32     <title><?php  echo _($title) ?></title>
33     <meta http-equiv="Content-Type" content="text/html">
34     <link href="common/mainstyle.css" rel="stylesheet" type="text/css">
35     <?php
36         if (isset($display) && is_file("modules/{$display}/{$display}.css")) {
37                  echo " <link href=\"modules/{$display}/{$display}.css\" rel=\"stylesheet\" type=\"text/css\">\n";
38         }
39      ?>
40
41     <script type="text/javascript" src="common/script.js.php"></script>
42     <script type="text/javascript">
43                 <!--
44                 // Disable browser's Back button on another pg being able to go back to this pg.
45                 history.forward();
46                 //-->
47     </script>
48 <!--[if IE]>
49     <style type="text/css">div.inyourface a{position:absolute;}</style>
50 <![endif]-->
51 </head>
52
53 <?php
54         if (extension_loaded('gettext')) {
55                 if (isset($_COOKIE['lang'])) {
56                         setlocale(LC_MESSAGES,  $_COOKIE['lang']);
57                         putenv("LANG=".$_COOKIE['lang']);
58                 } else {
59                         setlocale(LC_MESSAGES,  'en_US');
60                 }
61                 bindtextdomain('amp','./i18n');
62                 textdomain('amp');
63         }
64 ?>
65
66 <body onload="setAllInfoToHideSelects();">
67 <div id="page">
68
69 <div class="header">
70
71 <?php
72 if (isset($amp_conf["AMPADMINLOGO"]) && is_file($amp_conf["AMPWEBROOT"]."/admin/images/".$amp_conf["AMPADMINLOGO"]))
73 { ?>
74     <a href="index.php"><img src="images/<?php echo $amp_conf["AMPADMINLOGO"] ?>"/></a>
75 <?php } else { ?>
76     <a href="index.php"><img src="images/freepbx.png"/></a>
77 <?php }
78 if (!isset($_REQUEST['type'])) { $_REQUEST['type'] = 'setup'; }
79 ?>
80
81 <?php if (is_file("manage.php")){ ?>
82         <a id="<?php echo ($currentFile=='manage.php' ? 'current':'') ?>" href="manage.php?">
83                 &#8226;
84                 <li><?php echo _("Management") ?></li>
85         </a>
86 <?php } ?>
87
88         <a id="<?php echo ($currentFile=='config.php' && $_REQUEST['type']!='tool' ? 'current':'') ?>" href="config.php?type=setup">
89                 &#8226;
90                 <li><?php echo _("Setup") ?></li>
91         </a>
92
93         <a id="<?php echo ($currentFile=='config.php' && $_REQUEST['type']=='tool' ? 'current':'') ?>" href="config.php?type=tool">
94                 &#8226;
95                 <li><?php echo _("Tools") ?></li>
96         </a>
97
98 <?php if (is_file("cdr/cdr.php")){ ?>
99         <a id="<?php echo ($currentFile=='reports.php' ? 'current':'') ?>" href="reports.php?">
100                 &#8226;
101                 <li><?php echo _("Reports") ?></li>
102         </a>
103 <?php } ?>
104
105 <?php if (is_file("../panel/index_amp.php")){ ?>
106         <a id="<?php echo ($currentFile=='panel.php' ? 'current':'') ?>" href="panel.php?">
107                 &#8226;
108                 <li><?php echo _("Panel") ?></li>
109         </a>
110 <?php } ?>
111
112 <?php if (is_file("../recordings/index.php")){ ?>
113         <a href="../recordings/index.php" target="_blank">
114                 &#8226;
115                 <li><?php echo _("Recordings") ?></li>
116         </a>
117 <?php } ?>
118
119 </div>
120
121 <div class="message">
122 <?php 
123         if ( isset($_SESSION['AMP_user']) &&  $amp_conf['AUTHTYPE'] != 'none' ) {
124                 echo _('Logged in: ').$_SESSION['AMP_user']->username;
125                 echo ' (<a href="http'.(isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=''?'s':'').'://';
126
127                 if (!ereg('MSIE', $_SERVER['HTTP_USER_AGENT'])) {
128                         // use other logout for Firefox and other browsers
129                         echo 'logout:logout@';
130                 }
131
132                 $pathLength = strrpos($_SERVER['PHP_SELF'],'/');
133                 $logoutPath = ($pathLength === false) ? '' : substr($_SERVER['PHP_SELF'],0,$pathLength);
134
135                 echo $_SERVER['HTTP_HOST'].$logoutPath.'/logout.php">Logout</a>)&nbsp;::&nbsp;';
136         }
137         echo _($message);
138 ?>
139 </div>
140
141 <?php
142 } // End 'quietmode' check
143 ?>
Note: See TracBrowser for help on using the browser.