Changeset 6766

Show
Ignore:
Timestamp:
09/17/08 21:27:30 (5 years ago)
Author:
p_lindheimer
Message:

remove old unused code in drawListMenu and allow the Add to be optional

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.5/amp_conf/htdocs/admin/functions.inc.php

    r6756 r6766  
    15731573 
    15741574// draw list for users and devices with paging 
    1575 function drawListMenu($results, $skip, $type, $dispnum, $extdisplay, $description) { 
    1576   // Dirty Fix to get rid of [NEXT/PREV] since I'm not sure what passing skip does and don't want to mess with it. 
    1577   // When someone feels like looking closer at the below, probably should remove the code. 
    1578   // I removed pagination cause of the new scroll box ticket #1415 
    1579   $perpage=20000; 
    1580    
    1581   $skipped = 0; 
     1575// $skip has been dprecated, used to be used to page-enate 
     1576function drawListMenu($results, $skip, $type, $dispnum, $extdisplay, $description=false) { 
     1577   
    15821578  $index = 0; 
    1583   if ($skip == "") $skip = 0; 
    15841579  echo "<ul>\n"; 
    1585   echo "\t<li><a ".($extdisplay=='' ? 'class="current"':'')." href=\"config.php?type=".$type."&display=".$dispnum."\">"._("Add")." ".$description."</a></li>\n"; 
    1586  
     1580  if ($description !== false) { 
     1581    echo "\t<li><a ".($extdisplay=='' ? 'class="current"':'')." href=\"config.php?type=".$type."&display=".$dispnum."\">"._("Add")." ".$description."</a></li>\n"; 
     1582  } 
    15871583  if (isset($results)) { 
    1588     foreach ($results AS $key=>$result) { 
    1589       if ($index >= $perpage) { 
    1590         $shownext= 1; 
    1591         break; 
    1592       } 
    1593        
    1594       if ($skipped<$skip && $skip!= 0) { 
    1595         $skipped= $skipped + 1; 
    1596         continue; 
    1597       } 
    1598        
     1584    foreach ($results as $key=>$result) { 
    15991585      $index= $index + 1; 
    1600       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"; 
    1601     } 
    1602   } 
    1603     
    1604   $prevtag = ""; 
    1605   $prevtag_pre = ""; 
    1606   if ($skip) { 
    1607      $prevskip= $skip - $perpage; 
    1608      if ($prevskip<0) $prevskip= 0; 
    1609      $prevtag_pre= "<a href='?type=".$type."&amp;display=".$dispnum."&amp;skip=$prevskip'>" . 
    1610       _("[PREVIOUS]") ."</a>"; 
    1611      print "\t<li><center>"; 
    1612      print "$prevtag_pre"; 
    1613      print "</center></li>\n"; 
    1614   } 
    1615    
    1616   if (isset($shownext)) { 
    1617     $nextskip= $skip + $index; 
    1618     if ($prevtag_pre) $prevtag .= " | "; 
    1619     print "\t<li><center>"; 
    1620     print "$prevtag <a href='?type=".$type."&amp;display=".$dispnum."&amp;skip=$nextskip'>" .  
    1621       _("[NEXT]") . "</a>"; 
    1622     print "</center></li>\n"; 
     1586      echo "\t<li><a".($extdisplay==$result[0] ? ' class="current"':''). " href=\"config.php?type=".$type."&display=".$dispnum."&extdisplay={$result[0]}\">{$result[1]} &lt;{$result[0]}&gt;</a></li>\n"; 
     1587    } 
    16231588  } 
    16241589  echo "</ul>\n";