Changeset 3579
- Timestamp:
- 01/18/07 14:51:44 (2 years ago)
- Files:
-
- freepbx/branches/quickform/amp_conf/htdocs/admin/common/mainstyle.css (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/config.php (modified) (4 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/header.php (modified) (2 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/header_auth.php (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/panel.php (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/reports.php (modified) (3 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/views (added)
- freepbx/branches/quickform/amp_conf/htdocs/admin/views/freepbx.php (added)
- freepbx/branches/quickform/amp_conf/htdocs/admin/views/freepbx_admin.php (added)
- freepbx/branches/quickform/amp_conf/htdocs/admin/views/noaccess.php (added)
- freepbx/branches/quickform/amp_conf/htdocs/admin/views/panel.php (added)
- freepbx/branches/quickform/amp_conf/htdocs/admin/views/reports.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/quickform/amp_conf/htdocs/admin/common/mainstyle.css
r3573 r3579 200 200 } 201 201 202 /***** report nav *****/ 203 #reportnav { 204 position:absolute; 205 top:55px; 206 left:10px; 207 border:1; 208 padding: 0 0 0 0; 209 list-style-type: none; 210 font-size:12px; 211 border-right:1px solid black; 212 } 213 #reportnav ul { 214 margin:0; 215 padding:0; 216 } 217 #reportnav li { 218 display: inline; 219 border-left:1px solid black; 220 padding-left:6px; 221 padding-right:6px; 222 } 202 223 /***** footer *****/ 203 224 #footer { freepbx/branches/quickform/amp_conf/htdocs/admin/config.php
r3575 r3579 44 44 } 45 45 46 include 'header_auth.php';46 include('header.php'); 47 47 48 48 // get all enabled modules … … 127 127 } 128 128 129 if (!$quietmode) {130 if (is_array($fpbx_menu)) {131 $category = Array();132 $sort = Array();133 $name = Array();134 // Sorting menu by category and name135 foreach ($fpbx_menu as $key => $row) {136 $category[$key] = $row['category'];137 $sort[$key] = $row['sort'];138 $name[$key] = $row['name'];139 }140 141 if ($amp_conf['USECATEGORIES']) {142 array_multisort(143 $category, SORT_ASC,144 $sort, SORT_ASC, SORT_NUMERIC,145 $name, SORT_ASC,146 $fpbx_menu147 );148 } else {149 array_multisort(150 $sort, SORT_ASC, SORT_NUMERIC,151 $name, SORT_ASC,152 $fpbx_menu153 );154 }155 156 // Printing menu157 echo "<div id=\"nav\"><ul>\n";158 159 $prev_category = '';160 161 foreach ($fpbx_menu as $key => $row) {162 if ($amp_conf['USECATEGORIES'] && ($row['category'] != $prev_category)) {163 echo "\t\t<li>"._($row['category'])."</li>\n";164 $prev_category = $row['category'];165 }166 167 $href = isset($row['href']) ? $row['href'] : "config.php?type=".$type."&display=".$key;168 $extra_attributes = '';169 if (isset($row['target'])) {170 $extra_attributes .= ' target="'.$row['target'].'"';171 }172 173 echo "\t<li" .174 (($display==$key) ? ' class="current"':'') .175 '><a href="'.$href.'" '.$extra_attributes.' >'._($row['name'])."</a></li>\n";176 177 }178 echo "</ul></div>\n\n";179 }180 181 echo "<div id=\"wrapper\"><div id=\"background-wrapper\">\n";182 183 echo "<div id=\"left-corner\"></div>\n";184 echo "<div id=\"right-corner\"></div>\n";185 186 echo "<div class=\"content\">\n";187 188 189 echo "<noscript><div class=\"attention\">"._("WARNING: Javascript is disabled in your browser. The freePBX administration interface requires Javascript to run properly. Please enable javascript or switch to another browser that supports it.")."</div></noscript>";190 }191 192 193 194 129 // check access 195 130 if ( ($display != '') && !isset($fpbx_menu[$display]) ) { … … 213 148 $currentcomponent->buildconfigpage(); 214 149 } 150 151 // note: we buffer all the output from the 'page' being loaded.. 152 // This may change in the future, with proper returns, but for now, it's a simple 153 // way to support the old page.item.php include module format. 154 ob_start(); 215 155 216 156 // show the appropriate page … … 425 365 } 426 366 427 if (!$quietmode) { 428 echo "\t</div> <!-- /content -->\n"; 429 430 include('footer.php'); 431 echo "</div></div> <!-- /background-wrapper, /wrapper -->\n"; 432 433 echo "</div> <!-- /page -->\n"; 434 echo "</body>\n"; 435 echo "</html>\n"; 436 } 367 $admin_template['content'] = ob_get_contents(); 368 ob_end_clean(); 369 370 // build the admin interface (with menu) 371 $admin_template['fpbx_menu'] = $fpbx_menu; 372 $admin_template['fpbx_usecategories'] = $amp_conf['USECATEGORIES']; 373 $admin_template['fpbx_type'] = $type; 374 375 // then load it and put it into the main freepbx interface 376 $template['content'] = loadview('freepbx_admin', $admin_template); 377 showview('freepbx', $template); 378 437 379 ?> freepbx/branches/quickform/amp_conf/htdocs/admin/header.php
r3300 r3579 12 12 //GNU General Public License for more details. 13 13 14 // helper function, to draw the upper links 15 function print_sub_tool( $name, $page, $is_current, $href=NULL, $new_window=false ) 16 { 17 if (!is_file($page)) 18 return; 19 20 $html = "<li"; 14 /** Loads a view (from the views/ directory) with a number of named parameters created as local variables. 15 * @param string The name of the view. 16 * @param array The parameters to pass. Note that the key will be turned into a variable name for use by the view. 17 * For example, passing array('foo'=>'bar'); will create a variable $foo that can be used by 18 * the code in the view. 19 */ 20 function loadview($viewname, $parameters = false) { 21 ob_start(); 22 showview($viewname, $parameters); 23 $contents = ob_get_contents(); 24 ob_end_clean(); 25 return $contents; 26 } 27 /** Outputs the contents of a view. 28 * @param string The name of the view. 29 * @param array The parameters to pass. Note that the key will be turned into a variable name for use by the view. 30 * For example, passing array('foo'=>'bar'); will create a variable $foo that can be used by 31 * the code in the view. 32 */ 33 function showview($viewname, $parameters = false) { 34 if (is_array($parameters)) { 35 extract($parameters); 36 } 21 37 22 if ($is_current) 23 $html .= " class=\"current\""; 24 25 $html .= "><a "; 26 if ($href == NULL) 27 $href .= $page; 28 29 if ($new_window != NULL) 30 $html .= "target=\"_blank\" "; 31 32 $html .= "href=\"$href\">$name</a></li>"; 33 34 print("\t\t$html\n"); 38 $viewname = str_replace('..','.',$viewname); // protect against going to subdirectories 39 if (file_exists('views/'.$viewname.'.php')) { 40 include('views/'.$viewname.'.php'); 41 } 35 42 } 36 37 38 // start output buffering39 ob_start();40 43 41 44 //get the current file name … … 75 78 } 76 79 77 if (!$quietmode) { 80 // do authentication - header_auth exits if unauthorized 81 include('header_auth.php'); 82 78 83 ?> 79 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">80 81 <html>82 83 <head>84 <title><?php echo _($title) ?></title>85 <meta http-equiv="Content-Type" content="text/html">86 <link href="common/mainstyle.css" rel="stylesheet" type="text/css">87 <!--[if IE]>88 <link href="common/ie.css" rel="stylesheet" type="text/css">89 <![endif]-->90 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >91 <?php92 // check if in the amp configuration the user has set that93 // he wants to use an alternative style-sheet.94 // on Xorcom's TS1, it's used when the system is in rescue mode.95 if (isset($amp_conf["ALTERNATIVE_CSS"]))96 {97 if (($amp_conf["ALTERNATIVE_CSS"] == "1") ||98 ($amp_conf["ALTERNATIVE_CSS"] == "yes") ||99 ($amp_conf["ALTERNATIVE_CSS"] == "true"))100 echo "\t<link href=\"common/mainstyle-alternative.css\" rel=\"stylesheet\" type=\"text/css\">";101 }102 103 if (isset($display) && is_file("modules/{$display}/{$display}.css")) {104 echo "\t<link href=\"modules/{$display}/{$display}.css\" rel=\"stylesheet\" type=\"text/css\">\n";105 }106 ?>107 108 <script type="text/javascript" src="common/script.js.php"></script>109 <!--[if IE]>110 <style type="text/css">div.inyourface a{position:absolute;}</style>111 <![endif]-->112 </head>113 114 <body onload="body_loaded();" <?115 // Check if it's a RIGHT TO LEFT character set (eg, hebrew, arabic, whatever)116 //$_COOKIE['lang']="he_IL";117 if (isset($_COOKIE['lang']) && $_COOKIE['lang']==="he_IL")118 echo "dir=\"rtl\"";119 120 ?> >121 <div id="page">122 <div id="header">123 <?php124 125 echo "\t\t<div id=\"version\">";126 echo sprintf(_("%s %s on %s"),127 "<a href=\"index.php\">"._("freePBX")."</a>",128 getversion(),129 "<a href=\"http".(isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=''?'s':'')."://".$_SERVER['HTTP_HOST']."\">".$_SERVER["SERVER_NAME"]."</a>"130 );131 echo "</div>\n";132 133 echo "\t\t<ul id=\"metanav\">\n";134 print_sub_tool( _("Management"), "manage.php" , $currentFile=='manage.php' );135 print_sub_tool( _("Setup") , "config.php" , $currentFile=='config.php' && isset($_REQUEST['type']) && ($_REQUEST['type']=='setup' || $_REQUEST['type'] == ""), "config.php?type=setup", false );136 print_sub_tool( _("Tools") , "config.php" , $currentFile=='config.php' && isset($_REQUEST['type']) && $_REQUEST['type']=='tool' , "config.php?type=tool", false );137 print_sub_tool( _("Reports") , "reports.php", $currentFile=='reports.php' );138 print_sub_tool( _("Panel") , "panel.php" , $currentFile=='panel.php' );139 print_sub_tool( _("Recordings"), "../recordings/index.php" ,0, NULL, true );140 echo "\t\t</ul>\n";141 142 $freepbx_alt = _("freePBX");143 $freepbx_logo = (isset($amp_conf["AMPADMINLOGO"]) && is_file($amp_conf["AMPWEBROOT"]."/admin/images/".$amp_conf["AMPADMINLOGO"])) ? $amp_conf["AMPADMINLOGO"] : 'freepbx_small.png';144 echo "\t\t<div id=\"logo\"><a href=\"http://www.freepbx.org\" target=\"_blank\" title=\"".$freepbx_alt."\"><img src=\"images/".$freepbx_logo."\" alt=\"".$freepbx_alt."\" /></a></div>\n";145 146 echo "\t</div>";147 148 // need reload bar - hidden by default149 echo "\n\t\t<div class=\"attention\" id=\"need_reload_block\" style=\"display:none;\"><a href=\"javascript:void(null);\" onclick=\"amp_apply_changes();\" class=\"info\">";150 echo _("Apply Configuration Changes");151 echo "<span>".sprintf(_("You have made changes to the configuration that have not yet been applied. When you are ".152 "finished making all changes, click on %s to put them into effect."), "<strong>"._("Apply Configuration Changes")."</strong>");153 echo "</span></a></div>\n\n";154 155 156 echo "\t<div id=\"message\">";157 158 // TODO: this is ugly, need to code this better!159 // mixing php + html is bad!160 if (extension_loaded('gettext')) {161 if (!isset($_COOKIE['lang'])) {162 $_COOKIE['lang'] = "en_US";163 }164 ?>165 <?php echo _("Language:") ?>166 167 <select onchange="javascript:changeLang(this.value)">168 <option value="en_US" <? echo ($_COOKIE['lang']=="en_US" ? "selected" : "") ?> >English</option>169 <option value="fr_FR" <? echo ($_COOKIE['lang']=="fr_FR" ? "selected" : "") ?> >Français</option>170 <option value="de_DE" <? echo ($_COOKIE['lang']=="de_DE" ? "selected" : "") ?> >Deutsch</option>171 <option value="it_IT" <? echo ($_COOKIE['lang']=="it_IT" ? "selected" : "") ?> >Italiano</option>172 <option value="es_ES" <? echo ($_COOKIE['lang']=="es_ES" ? "selected" : "") ?> >Español</option>173 <option value="ru_RU" <? echo ($_COOKIE['lang']=="ru_RU" ? "selected" : "") ?> >Russki</option>174 <option value="pt_PT" <? echo ($_COOKIE['lang']=="pt_PT" ? "selected" : "") ?> >Portuguese</option>175 <option value="he_IL" <? echo ($_COOKIE['lang']=="he_IL" ? "selected" : "") ?> >Hebrew</option>176 </select>177 <?php178 }179 ?>180 181 <script type="text/javascript">182 <!--183 function changeLang(lang) {184 document.cookie='lang='+lang;185 window.location.reload();186 }187 //-->188 </script>189 190 <?php191 if ( isset($_SESSION['AMP_user']) && $amp_conf['AUTHTYPE'] != 'none' ) {192 echo _('Logged in: ').$_SESSION['AMP_user']->username;193 echo ' (<a href="http'.(isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=''?'s':'').'://';194 195 if (!ereg('MSIE', $_SERVER['HTTP_USER_AGENT'])) {196 // use other logout for Firefox and other browsers197 echo 'logout:logout@';198 }199 200 $pathLength = strrpos($_SERVER['PHP_SELF'],'/');201 $logoutPath = ($pathLength === false) ? '' : substr($_SERVER['PHP_SELF'],0,$pathLength);202 203 echo $_SERVER['HTTP_HOST'].$logoutPath.'/logout.php">Logout</a>) :: ';204 }205 echo _($message);206 ?></div>207 208 <?php209 } // End 'quietmode' check210 ?>freepbx/branches/quickform/amp_conf/htdocs/admin/header_auth.php
r3263 r3579 110 110 } 111 111 112 include 'header.php';112 //todo .. delete // include 'header.php'; 113 113 114 114 if ( !(isset($result) ? $result : false) ) { 115 echo "\t<br><br><br><br><center><h2>"; 116 echo _("You must log in first before you can access this page."); 117 echo "</h2></center><br><br><br><br>\n"; 118 include 'footer.php'; 115 showview("noaccess"); 119 116 exit; 120 117 } freepbx/branches/quickform/amp_conf/htdocs/admin/panel.php
r2856 r3579 22 22 $amp_conf = parse_amportal_conf("/etc/amportal.conf"); 23 23 24 include 'header_auth.php'; 24 include 'header.php'; 25 26 showview('panel', array('deptname' => $_SESSION["AMP_user"]->_deptname)); 25 27 ?> 26 </div>27 <iframe width="97%" height="600" frameborder="0" align="top" src="../panel/index_amp.php?context=<?php echo $_SESSION["AMP_user"]->_deptname?>"></iframe>28 29 </body>30 </html>freepbx/branches/quickform/amp_conf/htdocs/admin/reports.php
r2855 r3579 35 35 } 36 36 37 include 'header _auth.php';37 include 'header.php'; 38 38 39 39 $display=1; … … 43 43 44 44 // setup menu 45 $ amp_sections= array(45 $menu = array( 46 46 1=>_("Call Logs"), 47 47 2=>_("Compare Calls"), … … 50 50 ); 51 51 52 foreach ($amp_sections as $key=>$value) {53 echo "<div class=\"nav\" style=\"width=25%;text-align:center;\">";54 echo "<li><nobr><a id=\"".(($display==$key) ? 'current':'')."\" href=\"reports.php?display=".$key."\">".$value."</a><nobr></li>";55 echo "</div>";56 }57 58 52 // CDR viewer from www.areski.net. 59 53 // Changes for -- AMP -- commented in: 60 54 // cdr.php, defines.php, call-log.php, call-comp.php, graph_hourdetail.php, graph_statbar.php, graph_pie.php 55 56 showview('reports', array('display'=>$display, 'menu' => $menu)); 61 57 ?> 62 <br><br>63 </div>64 58 65 <iframe width="97%" height="600" frameborder="0" align="top" src="cdr/cdr.php?s=<?php echo $display; echo ($display=='1' ? '&posted=1' : '');?>"></iframe>66 59
