Changeset 2842

Show
Ignore:
Timestamp:
10/26/06 11:03:30 (6 years ago)
Author:
diego_iastrubni
Message:

continue fixing ticket:1202

- now rnav is also a <ul></ul> list.
- current is a class and not id
- core module href use &amp; instad of &
- rnav will not be generated with empty <li>

basically the core module should be clean enough. i also tried not to break any new things in non patched modules. the only problem, is that id="current" does not make the current item bold anymore. my next goal will be fixing the needed modules, so this is not a big problem on the long term.

module maintainers: please make my life easier and work for me
:)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/common/mainstyle.css

    r2840 r2842  
    6363  color: #ee9a47; 
    6464} 
     65#header a.current { 
     66  color: #E87B41; 
     67  font-weight:bold; 
     68} 
     69 
    6570a.current { 
    6671  color: #E87B41; 
    6772  font-weight:bold; 
    6873} 
     74 
     75ul.current { 
     76  color: #E87B41; 
     77  font-weight:bold; 
     78} 
     79 
    6980#header img { 
    7081    margin-top:10px; 
     
    148159  border:1px solid #F2AF1D;    
    149160} 
     161 
     162div.rnav ul { 
     163  display: block; 
     164  list-style: none; 
     165  margin: 0; 
     166  padding: 0; 
     167} 
     168 
    150169div.rnav li{ 
    151170    list-style-type: none; 
  • freepbx/trunk/amp_conf/htdocs/admin/config.php

    r2829 r2842  
    2323// determine module type to show, default to 'setup' 
    2424if($type == "tool") { 
    25   $message="Tools"; 
     25  $message = "Tools"; 
    2626  $amp_sections = array( 
    2727    'modules'=>_("Module Admin") 
    2828  ); 
    2929} elseif($type == "cdrcost") { 
    30   $message="Call Cost"; 
     30  $message = "Call Cost"; 
    3131} else { 
    32   $message="Setup"; 
     32  $message = "Setup"; 
    3333} 
    3434 
     
    4545 
    4646include 'header_auth.php'; 
    47  
    48 /* 
    49 // only show AMP Users if they have authtype set approiately 
    50 if (isset($amp_conf["AUTHTYPE"]) && ($amp_conf["AUTHTYPE"] != "none")) { 
    51   $amp_sections[10] = _("AMP Users"); 
    52 }*/ 
    5347 
    5448// get all enabled modules 
     
    109103  unset($amp_sections["users"]); 
    110104} 
    111  
    112105 
    113106// add the APPLY Changes bar as a section, so it shows in the Administrators module 
     
    136129} 
    137130 
    138 //  TODO why do we need the <div class='clear'> here ...? 
    139 //  echo "\t\t\n"; 
    140 //  echo "\t\t<div class='clear'></div>\n"; 
    141  
    142131if (!$quietmode) { 
    143   echo "\t<div id=\"nav\"><ul>\n"; 
     132  echo "<div id=\"nav\"><ul>\n"; 
    144133  ksort($amp_menu); 
    145134  foreach ($amp_menu as $category => $items) { 
     
    148137    foreach ($items as $key=>$value) { 
    149138      if (preg_match("/^(<a.+>)(.+)(<\/a>)/",$value,$matches)) { 
    150         echo "\t\t<li>".$matches[1]._($matches[2]).$matches[3]."</li>\n"; 
     139        echo "\t<li>".$matches[1]._($matches[2]).$matches[3]."</li>\n"; 
    151140      } else { 
    152         echo "\t\t<li><a" . 
     141        echo "\t<li><a" . 
    153142          (($display==$key) ? ' class="current"':'') . 
    154143          " href=\"config.php?type=".$type."&amp;display=".$key."\">"._($value)."</a></li>\n"; 
     
    156145    } 
    157146  } 
    158   echo "\t</ul></div>\n\n"; 
     147  echo "</ul></div>\n\n"; 
    159148  echo "<div id=\"wrapper\"><div class=\"content\">\n"; 
    160149} 
     
    250239  break; 
    251240  case '': 
    252 /*    $astman = new AGI_AsteriskManager(); 
    253     if ($res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 
    254       $astman->disconnect();*/ 
    255241    if ($astman) { 
    256242      printf( "<h2>%s</h2>", dgettext("welcome page", "Welcome to freePBX.") ); 
  • freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php

    r2815 r2842  
    346346  $index = 0; 
    347347  if ($skip == "") $skip = 0; 
    348   echo "<li><a id=\"".($extdisplay=='' ? 'current':'')."\" href=\"config.php?type=".$type."&display=".$dispnum."\">"._("Add")." ".$description."</a></li>"; 
     348  echo "<ul>\n"; 
     349  echo "\t<li><a ".($extdisplay=='' ? 'class="current"':'')." href=\"config.php?type=".$type."&display=".$dispnum."\">"._("Add")." ".$description."</a></li>\n"; 
    349350 
    350351  if (isset($results)) { 
     
    360361      } 
    361362       
    362       $index= $index + 1;  
    363       echo "<li><a id=\"".($extdisplay==$result[0] ? 'current':'')."\" href=\"config.php?type=".$type."&display=".$dispnum."&extdisplay={$result[0]}&skip={$skip}\">{$result[1]} <{$result[0]}></a></li>"; 
    364     } 
    365   } 
    366     
    367   if ($index >= $perpage) { 
    368      print "<li><center>"; 
     363      $index= $index + 1; 
     364      echo "\t<li><a".($extdisplay==$result[0] ? ' class="current"':''). " href=\"config.php?type=".$type."&amp;display=".$dispnum."&amp;extdisplay={$result[0]}&amp;skip={$skip}\">{$result[1]} &lt;{$result[0]}&gt;</a></li>\n"; 
     365    } 
    369366  } 
    370367    
     
    372369     $prevskip= $skip - $perpage; 
    373370     if ($prevskip<0) $prevskip= 0; 
    374      $prevtag_pre= "<a href='?type=".$type."&display=".$dispnum."&skip=$prevskip'>[PREVIOUS]</a>"; 
     371     $prevtag_pre= "<a href='?type=".$type."&amp;display=".$dispnum."&amp;skip=$prevskip'>" . 
     372      _("[PREVIOUS]") ."</a>"; 
     373     print "\t<li><center>"; 
    375374     print "$prevtag_pre"; 
     375     print "</center></li>\n"; 
    376376  } 
    377377   
     
    379379    $nextskip= $skip + $index; 
    380380    if ($prevtag_pre) $prevtag .= " | "; 
    381     print "$prevtag <a href='?type=".$type."&display=".$dispnum."&skip=$nextskip'>[NEXT]</a>"; 
    382   } 
    383   elseif ($skip) { 
    384     print "$prevtag"; 
    385   } 
    386     
    387    print "</center></li>"; 
     381    print "\t<li><center>"; 
     382    print "$prevtag <a href='?type=".$type."&amp;display=".$dispnum."&amp;skip=$nextskip'>" .  
     383      _("[NEXT]") . "</a>"; 
     384    print "</center></li>\n"; 
     385  } 
     386  echo "</ul>\n"; 
    388387} 
    389388 
  • freepbx/trunk/amp_conf/htdocs/admin/header.php

    r2822 r2842  
    2727   
    2828  if ($is_current) 
    29     $html .= "id=\"current\" "; 
     29    $html .= "class=\"current\" "; 
    3030 
    3131  $html .= "href=\"$href\">&nbsp; $name</a></span>"; 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.ampusers.php

    r2748 r2842  
    9191 
    9292<div class="rnav"> 
    93     <li><a id="<?php  echo ($userdisplay=='' ? 'current':'') ?>" href="config.php?display=<?php echo urlencode($display)?>"><?php echo _("Add User")?></a></li
    94  
     93<ul
     94  <li><a <?php  echo ($userdisplay=='' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($display)?>"><?php echo _("Add User")?></a></li> 
    9595<?php  
    9696//get existing trunk info 
     
    9898 
    9999foreach ($tresults as $tresult) { 
    100     echo "<li><a id=\"".($userdisplay==$tresult[0] ? 'current':'')."\" href=\"config.php?display=".urlencode($display)."&userdisplay=".urlencode($tresult[0])."\">".$tresult[0]."</a></li>"; 
    101 } 
    102  
    103 ?
     100    echo "\t<li><a ".($userdisplay==$tresult[0] ? 'class="current"':'')." href=\"config.php?display=".urlencode($display)."&amp;userdisplay=".urlencode($tresult[0])."\">".$tresult[0]."</a></li>\n"; 
     101} 
     102?> 
     103</ul
    104104</div> 
    105105 
     
    121121     
    122122?> 
    123     <p><a href="config.php?display=<?php echo urlencode($display) ?>&userdisplay=<?php echo urlencode($userdisplay) ?>&action=delampuser"><?php echo _("Delete User")?> <?php  echo $userdisplay; ?></a></p> 
     123    <p><a href="config.php?display=<?php echo urlencode($display) ?>&amp;userdisplay=<?php echo urlencode($userdisplay) ?>&amp;action=delampuser"><?php echo _("Delete User")?> <?php  echo $userdisplay; ?></a></p> 
    124124<?php  
    125125 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.did.php

    r2544 r2842  
    4545 
    4646<div class="rnav"> 
    47     <li><a id="<?php echo ($extdisplay=='' ? 'current':'') ?>" href="config.php?display=<?php echo urlencode($dispnum)?>"><?php echo _("Add Incoming Route")?></a></li> 
     47<ul> 
     48  <li><a <?php echo ($extdisplay=='' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum)?>"><?php echo _("Add Incoming Route")?></a></li> 
    4849<?php  
    4950//get unique incoming routes 
     
    5556    $zapchan = ( strlen($inroute['channel'])? "Zaptel Channel {$inroute['channel']}" : "" ); 
    5657    if ($zapchan != "")  
    57       echo "<li><a id=\"".($extdisplay==$inroute['extension']."/".$inroute['cidnum']."/".$inroute['channel'] ? 'current':'nul')."\" href=\"config.php?display=".urlencode($dispnum)."&amp;extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."/".urlencode($inroute['channel'])."\">{$zapchan} </a></li>"; 
     58      echo "\t<li><a ".($extdisplay==$inroute['extension']."/".$inroute['cidnum']."/".$inroute['channel'] ? 'class="current"':'')." href=\"config.php?display=".urlencode($dispnum)."&amp;extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."/".urlencode($inroute['channel'])."\">{$zapchan} </a></li>\n"; 
    5859    else 
    59       echo "<li><a id=\"".($extdisplay==$inroute['extension']."/".$inroute['cidnum']."/".$inroute['channel'] ? 'current':'nul')."\" href=\"config.php?display=".urlencode($dispnum)."&amp;extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."/".urlencode($inroute['channel'])."\">{$displaydid} / {$displaycid} {$zapchan} </a></li>"; 
     60      echo "\t<li><a ".($extdisplay==$inroute['extension']."/".$inroute['cidnum']."/".$inroute['channel'] ? 'class="current"':'')." href=\"config.php?display=".urlencode($dispnum)."&amp;extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."/".urlencode($inroute['channel'])."\">{$displaydid} / {$displaycid} {$zapchan} </a></li>\n"; 
    6061  } 
    6162} 
    6263?> 
     64</ul> 
    6365</div> 
    6466 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.extensions.php

    r2617 r2842  
    1818drawListMenu($extens, $skip, $type, $display, $extdisplay, _("Extension")); 
    1919?> 
     20  <br /> 
    2021</div> 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.routing.php

    r2252 r2842  
    198198 
    199199<div class="rnav"> 
    200     <li><a id="<?php  echo ($extdisplay=='' ? 'current':'') ?>" href="config.php?display=<?php echo urlencode($display)?>"><?php echo _("Add Route")?></a></li> 
     200<ul> 
     201  <li><a <?php  echo ($extdisplay=='' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($display)?>"><?php echo _("Add Route")?></a></li> 
    201202<?php  
    202203$reporoutedirection = isset($_REQUEST['reporoutedirection'])?$_REQUEST['reporoutedirection']:''; 
     
    206207$positions=count($routepriority); 
    207208foreach ($routepriority as $tresult) { 
    208 $key++; 
    209 ?> 
    210       <?php   // move up 
    211           echo "<li><a id=\"".($extdisplay==$tresult[0] ? 'current':'')."\" href=\"config.php?display=".urlencode($display)."&extdisplay=".urlencode($tresult[0])."\">$key ". substr($tresult[0],4)."</a>"; 
    212       if ($key > 0) {?> 
    213         <img src="images/scrollup.gif" onclick="repositionRoute('<?php echo $key ?>','up')" alt="<?php echo _("Move Up")?>" style="float:none; margin-left:0px; margin-bottom:0px;" width="9" height="11"> 
    214       <?php  } else { ?> 
    215         <img src="images/blank.gif" style="float:none; margin-left:0px; margin-bottom:0px;" width="9" height="11"> 
    216       <?php  } 
    217        
    218       // move down 
    219        
    220       if ($key < ($positions-1)) {?> 
    221         <img src="images/scrolldown.gif" onclick="repositionRoute('<?php echo $key ?>','down')" alt="<?php echo _("Move Down")?>"  style="float:none; margin-left:0px; margin-bottom:0px;" width="9" height="11"> 
    222       <?php  } else { ?> 
    223         <img src="images/blank.gif" style="float:none; margin-left:0px; margin-bottom:0px;" width="9" height="11"> 
    224       <?php  }  
    225       echo "</li>";?> 
    226        
    227 <?php  
     209  $key++; 
     210    echo "\t<li>\n\t\t<a " . ($extdisplay==$tresult[0] ? 'class="current"':'') . 
     211      " href=\"config.php?display=" .  
     212      urlencode($display)."&amp;extdisplay=" .  
     213      urlencode($tresult[0]) . "\">$key " . substr($tresult[0],4)."</a>\n"; 
     214 
     215    if ($key > 0) 
     216      echo "\t\t<img src=\"images/scrollup.gif\" onclick=\"repositionRoute('$key','up')\" alt='" .  _("Move Up") . 
     217        "' style='float:none; margin-left:0px; margin-bottom:0px;' width='9' height='11'>\n"; 
     218    else 
     219      echo "\t\t<img src='images/blank.gif' style='float:none; margin-left:0px; margin-bottom:0px;' width='9' height='11'>\n"; 
     220 
     221    // move down 
     222    if ($key < ($positions-1)) 
     223      echo "\t\t<img src='images/scrolldown.gif' onclick=\"repositionRoute('$key>','down')\" alt='" . _("Move Down") . 
     224        "'  style='float:none; margin-left:0px; margin-bottom:0px;' width='9' height='11'>\n"; 
     225    else  
     226      echo "\t\t<img src='images/blank.gif' style='loat:none; margin-left:0px; margin-bottom:0px;' width='9' height='11'>\n"; 
     227      echo "\t</li>\n"; 
    228228} // foreach 
    229229?> 
     230</ul> 
    230231</div> 
    231232 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.trunks.php

    r2754 r2842  
    169169 
    170170<div class="rnav"> 
    171     <li><a id="<?php  echo ($extdisplay=='' ? 'current':'') ?>" href="config.php?display=<?php echo urlencode($display)?>"><?php echo _("Add Trunk")?></a></li
    172  
     171<ul
     172  <li><a <?php  echo ($extdisplay=='' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($display)?>"><?php echo _("Add Trunk")?></a></li> 
    173173<?php  
    174174//get existing trunk info 
     
    176176 
    177177foreach ($tresults as $tresult) { 
    178     echo "<li><a id=\"".($extdisplay==$tresult[0] ? 'current':'')."\" href=\"config.php?display=".urlencode($display)."&extdisplay=".urlencode($tresult[0])."\" title=\"".urlencode($tresult[1])."\">"._("Trunk")." ".substr(ltrim($tresult[1],"AMP:"),0,15)."</a></li>"; 
    179 
    180  
    181 ?> 
     178    echo "\t<li><a ".($extdisplay==$tresult[0] ? 'class="current"':'')." href=\"config.php?display=".urlencode($display)."&amp;extdisplay=".urlencode($tresult[0])."\" title=\"".urlencode($tresult[1])."\">"._("Trunk")." ".substr(ltrim($tresult[1],"AMP:"),0,15)."</a></li>\n"; 
     179
     180 
     181?> 
     182</ul> 
    182183</div> 
    183184 
     
    189190?> 
    190191  <h2><?php echo _("Add a Trunk")?></h2> 
    191   <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&tech=ZAP"><?php echo _("Add ZAP Trunk")?></a><br><br> 
    192   <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&tech=IAX2"><?php echo _("Add IAX2 Trunk")?></a><br><br> 
    193   <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&tech=SIP"><?php echo _("Add SIP Trunk")?></a><br><br> 
    194   <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&tech=ENUM"><?php echo _("Add ENUM Trunk")?></a><br><br> 
    195   <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&tech=CUSTOM"><?php echo _("Add Custom Trunk")?></a><br><br> 
     192  <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=ZAP"><?php echo _("Add ZAP Trunk")?></a><br><br> 
     193  <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=IAX2"><?php echo _("Add IAX2 Trunk")?></a><br><br> 
     194  <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=SIP"><?php echo _("Add SIP Trunk")?></a><br><br> 
     195  <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=ENUM"><?php echo _("Add ENUM Trunk")?></a><br><br> 
     196  <a href="<?php echo $_SERVER['PHP_SELF'].'?display='.urlencode($display); ?>&amp;tech=CUSTOM"><?php echo _("Add Custom Trunk")?></a><br><br> 
    196197<?php  
    197198} else { 
     
    254255    echo "<h2>".sprintf(_("Edit %s Trunk"),strtoupper($tech))."</h2>"; 
    255256?> 
    256     <p><a title="<?php echo $channelid ?>" href="config.php?display=<?php echo urlencode($display) ?>&extdisplay=<?php echo urlencode($extdisplay) ?>&action=deltrunk"><?php echo _("Delete Trunk")?> <?php  echo substr($channelid,0,20); ?></a></p> 
     257    <p><a title="<?php echo $channelid ?>" href="config.php?display=<?php echo urlencode($display) ?>&amp;extdisplay=<?php echo urlencode($extdisplay) ?>&amp;action=deltrunk"><?php echo _("Delete Trunk")?> <?php  echo substr($channelid,0,20); ?></a></p> 
    257258<?php  
    258259