7c7,15
< 
---
>     
>     //LeeB
>     $numcats = 0;
>     $pgstart = optional_param('pgstart',1,PARAM_INT);
>     if($pgstart<1){
>     	$pgstart=1;
>     }
>     $pglength = 15;
>     
119a128,170
>     
> 
> 	//LeeB - course pager header
> 	$countcat = count_records('course_categories');
> 	$numpgs = ceil($countcat/$pglength);
> 	$currentpg = floor(($pgstart+$pglength)/$pglength);
>     $baselink = $CFG->wwwroot."/course/index.php?categoryedit=on&pgstart=";
>     
>     echo "<center>";    
>     echo "Page: ";
> 
> 	$prevpg = $pgstart-$pglength;
>     echo "<a href='${baselink}$prevpg'>";
>     echo "(Previous)";
>     echo "</a> ";    
>     for($i=1;$i<=$numpgs;$i++){    	
>     	if($i==$currentpg){
>     		echo "<b>";
>     	} else {
>     		echo "<a href='".$baselink.((($i-1)*$pglength)+1)."'>";
>     	}    	
>     	echo "$i";    	
>     	if($i==$currentpg){
>     		echo "</b> ";
>     	} else {
>     		echo "</a> ";
>     	}    	
>     }
>     $nextpg = $pgstart+$pglength;
>     echo " <a href='${baselink}$nextpg'>";
>     echo "(Next)";
>     echo "</a>";    
>     echo "<br/><br/>";
>     
>     $dispcourseto = ($pgstart+$pglength-1);
>     if ($dispcourseto>$countcat){
>     	$dispcourseto=$countcat;
>     }
>     echo "Displaying course ".$pgstart." to ".$dispcourseto." of ".$countcat;
>     echo "</center>";
> 
>     echo "<br/>";
>     //LeeB - end of pager header
319a371,372
> 	global $numcats, $pgstart, $pglength;
> 	
333,364c386,389
<     if ($category) {
< 
<         $context  = get_context_instance(CONTEXT_COURSECAT, $category->id);
<           
<         echo '<tr><td align="left" class="name">';
<         for ($i=0; $i<$depth;$i++) {
<             echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
<         }
<         $linkcss = $category->visible ? '' : ' class="dimmed" ';
<         echo '<a '.$linkcss.' title="'.$str->edit.'" '.
<              ' href="category.php?id='.$category->id.'&amp;categoryedit=on&amp;sesskey='.sesskey().'">'.
<              format_string($category->name).'</a>';
<         echo '</td>';
< 
<         echo '<td class="count">'.$category->coursecount.'</td>';
< 
<         echo '<td class="icons">';    /// Print little icons
< 
<         if (has_capability('moodle/category:delete', $context)) {
<             echo '<a title="'.$str->delete.'" href="index.php?delete='.$category->id.'&amp;sesskey='.sesskey().'"><img'.
<                  ' src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.$str->delete.'" /></a> ';
<         }
<         
<         if (has_capability('moodle/category:visibility', $context)) {
<             if (!empty($category->visible)) {
<                 echo '<a title="'.$str->hide.'" href="index.php?hide='.$category->id.'&amp;sesskey='.sesskey().'"><img'.
<                      ' src="'.$CFG->pixpath.'/t/hide.gif" class="iconsmall" alt="'.$str->hide.'" /></a> ';
<             } else {
<                 echo '<a title="'.$str->show.'" href="index.php?show='.$category->id.'&amp;sesskey='.sesskey().'"><img'.
<                      ' src="'.$CFG->pixpath.'/t/show.gif" class="iconsmall" alt="'.$str->show.'" /></a> ';
<             }
<         }
---
>     //LeeB - only show range
> 	if($numcats>=($pgstart) && $numcats<($pgstart+$pglength)){
>     
> 		if ($category) {
366,388c391,446
<         if ($up) {
<             echo '<a title="'.$str->moveup.'" href="index.php?moveup='.$category->id.'&amp;sesskey='.sesskey().'"><img'.
<                  ' src="'.$CFG->pixpath.'/t/up.gif" class="iconsmall" alt="'.$str->moveup.'" /></a> ';
<         }
<         if ($down) {
<             echo '<a title="'.$str->movedown.'" href="index.php?movedown='.$category->id.'&amp;sesskey='.sesskey().'"><img'.
<                  ' src="'.$CFG->pixpath.'/t/down.gif" class="iconsmall" alt="'.$str->movedown.'" /></a> ';
<         }
<         echo '</td>';
< 
<         echo '<td align="left">';
<         $tempdisplaylist = $displaylist;
<         unset($tempdisplaylist[$category->id]);
<         foreach ($parentslist as $key => $parents) {
<             if (in_array($category->id, $parents)) {
<                 unset($tempdisplaylist[$key]);
<             }
<         }
<       	popup_form ("index.php?move=$category->id&amp;sesskey=$USER->sesskey&amp;moveto=", $tempdisplaylist, "moveform$category->id", $category->parent, '', '', '', false);
<         echo '</td>';
<         echo '</tr>';
<     } else {
<         $category->id = '0';
---
> 		    $context  = get_context_instance(CONTEXT_COURSECAT, $category->id);
> 		      
> 		    echo '<tr><td align="left" class="name">';
> 		    for ($i=0; $i<$depth;$i++) {
> 		        echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
> 		    }
> 		    $linkcss = $category->visible ? '' : ' class="dimmed" ';
> 		    echo '<a '.$linkcss.' title="'.$str->edit.'" '.
> 		         ' href="category.php?id='.$category->id.'&amp;categoryedit=on&amp;sesskey='.sesskey().'">'.
> 		         format_string($category->name).'</a>';
> 		    echo '</td>';
> 
> 		    echo '<td class="count">'.$category->coursecount.'</td>';
> 
> 		    echo '<td class="icons">';    /// Print little icons
> 
> 		    if (has_capability('moodle/category:delete', $context)) {
> 		        echo '<a title="'.$str->delete.'" href="index.php?delete='.$category->id.'&amp;sesskey='.sesskey().'&amp;pgstart='.$pgstart.'">'.
> 		        '<img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.$str->delete.'" /></a> ';
> 		    }
> 		    
> 		    if (has_capability('moodle/category:visibility', $context)) {
> 		        if (!empty($category->visible)) {
> 		            echo '<a title="'.$str->hide.'" href="index.php?hide='.$category->id.'&amp;sesskey='.sesskey().'&amp;pgstart='.$pgstart.'">'.
> 		            '<img src="'.$CFG->pixpath.'/t/hide.gif" class="iconsmall" alt="'.$str->hide.'" /></a> ';
> 		        } else {
> 		            echo '<a title="'.$str->show.'" href="index.php?show='.$category->id.'&amp;sesskey='.sesskey().'&amp;pgstart='.$pgstart.'">'.
> 		            '<img src="'.$CFG->pixpath.'/t/show.gif" class="iconsmall" alt="'.$str->show.'" /></a> ';
> 		        }
> 		    }
> 
> 		    if ($up) {
> 		        echo '<a title="'.$str->moveup.'" href="index.php?moveup='.$category->id.'&amp;sesskey='.sesskey().'&amp;pgstart='.$pgstart.'">'.
> 		        '<img src="'.$CFG->pixpath.'/t/up.gif" class="iconsmall" alt="'.$str->moveup.'" /></a> ';
> 		    }
> 		    if ($down) {
> 		        echo '<a title="'.$str->movedown.'" href="index.php?movedown='.$category->id.'&amp;sesskey='.sesskey().'&amp;pgstart='.$pgstart.'">'.
> 		        '<img src="'.$CFG->pixpath.'/t/down.gif" class="iconsmall" alt="'.$str->movedown.'" /></a> ';
> 		    }
> 		    echo '</td>';
> 
> 		    echo '<td align="left">';
> 		    $tempdisplaylist = $displaylist;
> 		    unset($tempdisplaylist[$category->id]);
> 		    foreach ($parentslist as $key => $parents) {
> 		        if (in_array($category->id, $parents)) {
> 		            unset($tempdisplaylist[$key]);
> 		        }
> 		    }
> 		  	popup_form ("index.php?move=$category->id&amp;sesskey=$USER->sesskey&amp;moveto=", $tempdisplaylist, "moveform$category->id", $category->parent, '', '', '', false);
> 		    echo '</td>';
> 		    echo '</tr>';
> 		} else {
> 		    $category->id = '0';
> 		}
>     
389a448
>     $numcats++;
407a467
> 
