Changeset 4346

Show
Ignore:
Timestamp:
07/10/07 20:02:46 (6 years ago)
Author:
gregmac
Message:

Fix more issues with views system

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.3.views/amp_conf/htdocs/admin/config.php

    r4345 r4346  
    309309} 
    310310 
    311 $admin_template = $template = array(); 
    312  
    313  
    314 $admin_template['content'] = ob_get_contents(); 
    315 ob_end_clean(); 
    316  
    317 // build the admin interface (with menu) 
    318 $admin_template['fpbx_types'] = $types; 
    319 $admin_template['fpbx_menu'] = $fpbx_menu; 
    320 $admin_template['fpbx_usecategories'] = $amp_conf['USECATEGORIES']; 
    321 $admin_template['fpbx_type'] = $type; 
    322  
    323 // then load it and put it into the main freepbx interface 
    324 $template['content'] = loadview('freepbx_admin', $admin_template); 
    325  
    326 // setup main template 
    327 $template['currentFile'] = $currentFile; 
    328 $template['display'] = $display; 
    329 $template['title'] = "FreePBX administration"; 
    330  
    331  
    332 showview('freepbx', $template); 
     311if ($quietmode) { 
     312  // send the output buffer 
     313  ob_end_flush(); 
     314} else { 
     315  $admin_template = $template = array(); 
     316 
     317 
     318  $admin_template['content'] = ob_get_contents(); 
     319  ob_end_clean(); 
     320 
     321  // build the admin interface (with menu) 
     322  $admin_template['fpbx_types'] = $types; 
     323  $admin_template['fpbx_type_names'] = $type_names; 
     324  $admin_template['fpbx_menu'] = $fpbx_menu; 
     325  $admin_template['fpbx_usecategories'] = $amp_conf['USECATEGORIES']; 
     326  $admin_template['fpbx_type'] = $type; 
     327  $admin_template['display'] = $display; 
     328 
     329  // then load it and put it into the main freepbx interface 
     330  $template['content'] = loadview('freepbx_admin', $admin_template); 
     331 
     332  // setup main template 
     333  $template['display'] = $display; 
     334  $template['title'] = "FreePBX administration"; 
     335  $template['amp_conf'] = &$amp_conf; 
     336 
     337 
     338  showview('freepbx', $template); 
     339
    333340 
    334341?> 
  • freepbx/branches/2.3.views/amp_conf/htdocs/admin/header.php

    r4345 r4346  
    4444//get the current file name 
    4545$currentFile = $_SERVER["PHP_SELF"]; 
    46 $parts = Explode('/', $currentFile); 
     46$parts = explode('/', $currentFile); 
    4747//header('Content-type: text/html; charset=utf-8'); 
    4848$currentFile = $parts[count($parts) - 1]; 
  • freepbx/branches/2.3.views/amp_conf/htdocs/admin/reports.php

    r4345 r4346  
    1717$message="Call Detail Reports"; 
    1818 
     19include 'header.php'; 
     20 
    1921// BUILD an SQL clause for any AMP User restrictions 
    20 session_register('AMP_SQL'); 
     22//session_register('AMP_SQL'); 
    2123$low = $_SESSION["AMP_user"]->_extension_low; 
    2224$high = $_SESSION["AMP_user"]->_extension_high; 
     
    2931  $_SESSION["AMP_SQL"] = ""; 
    3032} 
    31  
    32 include 'header.php'; 
    3333 
    3434$display=1; 
     
    4646 
    4747echo "<div id=\"cdr\"><ul id=\"metanav\">"; 
    48 foreach ($amp_sections as $key=>$value) { 
     48foreach ($menu as $key=>$value) { 
    4949  echo "<li class=\"".(($display==$key) ? 'current':'')."\"><a href=\"reports.php?display=".$key."\">".$value."</a></li>"; 
    5050} 
     
    5959</div> 
    6060 
    61 <iframe width="100%" height="600" frameborder="0" align="top" scrolling="yes" src="cdr/cdr.php?s=<?php echo $display; echo ($display=='1' ? '&posted=1' : '');?>"></iframe
     61<!-- iframe width="100%" height="600" frameborder="0" align="top" scrolling="yes" src="cdr/cdr.php?s=<?php echo $display; echo ($display=='1' ? '&posted=1' : '');?>"></iframe> --
    6262 
  • freepbx/branches/2.3.views/amp_conf/htdocs/admin/views/freepbx.php

    r4345 r4346  
    8383  echo "</div>\n"; 
    8484 
     85  $currentFile = basename($_SERVER["SCRIPT_NAME"]); 
     86   
    8587  echo "\t\t<ul id=\"metanav\">\n"; 
    8688  print_sub_tool( _("Management"), "manage.php" , $currentFile=='manage.php' ); 
     
    141143 
    142144<?php 
    143   if ( isset($_SESSION['AMP_user']) &&  $amp_conf['AUTHTYPE'] != 'none' ) { 
     145  if ( isset($_SESSION['AMP_user']) &&  isset($amp_conf['AUTHTYPE']) && ($amp_conf['AUTHTYPE'] != 'none')) { 
    144146    echo _('Logged in: ').$_SESSION['AMP_user']->username; 
    145147    echo ' (<a href="http'.(isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=''?'s':'').'://'; 
     
    153155    $logoutPath = ($pathLength === false) ? '' : substr($_SERVER['PHP_SELF'],0,$pathLength); 
    154156 
    155     echo $_SERVER['HTTP_HOST'].$logoutPath.'/logout.php">Logout</a>)&nbsp;::&nbsp;'; 
     157    echo $_SERVER['HTTP_HOST'].$logoutPath.'/logout.php">Logout</a>)&nbsp;'; 
    156158  } 
    157   echo _($message); 
     159  //echo '::&nbsp;'._($message); 
    158160?>  </div> 
    159161 
  • freepbx/branches/2.3.views/amp_conf/htdocs/admin/views/freepbx_admin.php

    r4345 r4346  
    4545  $tab_num = 1; 
    4646  foreach ($fpbx_types as $key=>$val) { 
    47     $type_name = (isset($type_names[$val]) ? $type_names[$val] : ucfirst($val)); 
     47    $type_name = (isset($fpbx_type_names[$val]) ? $fpbx_type_names[$val] : ucfirst($val)); 
    4848    echo '<li><a href="#nav-'.str_replace(' ','_',$val).'"><span>'.$type_name.'</span></a></li>'; 
    49     if ($val == $type) { 
     49    if ($val == $fpbx_type) { 
    5050      $tab_num = $key+1; 
    5151    }