<?php
/*
user_navigator.inc
$version$
$author$

This is a user navigator, that allows you to navigate the user
information for edits, deletes and other user functions.

To use setup the following variables :

$read_only

The width of the table is 3 cells wide.
[ action checkbox if not in readonly ] | [ horde_user_id ] | [ horde_user_name ]
*/

echo( '<center>' );
echo( '<form action="' . $action_url . '" method="post">' );
echo( '<table bgcolor="' . $default->nav_bg . '" border="0" cellspacing="0">' );
$horde_config_frm = new HordeConfigForm;
$horde_config_frm->full_colspan = 3;
$horde_config_frm->gen_title_bar( $title );
$horde_config_frm->gen_action_tag( $action_id );
echo( '<tr bgcolor="' . $default->light_bg . '">' );
if ( $action_text != '' && $read_only != true ) {
$horde_config_frm->gen_single_item( '<b>[- ' . $action_text . ' -]</b>' );
} else {
$horde_config_frm->gen_single_item( '' );
}
$horde_config_frm->gen_single_item( '<b>[- User id -]</b>' );
$horde_config_frm->gen_single_item( '<b>[- User Name -]</b>' );
echo( '</tr>' );

$ReturnArray = $db->User->ListAll();

$status = $ReturnArray[ 0 ];

if ( $status == true ) {
   list( $status, $ResultCount, $ResultArray ) = $ReturnArray;
   } else {
   list( $status, $error_id, $reason ) = $ReturnArray;
   echo( $reason );
   }

if ( $status == true ) {
   echo( '<!-- true -->' );
   for( $i = 0; $i < $ResultCount; $i++ ) {
   echo( '<tr bgcolor="' . $default->light_bg . '">' );
   if ( $read_only == true ) { 
      $horde_config_frm->gen_single_item( '' );
      } else {
      $horde_config_frm->gen_single_item( '<input type="checkbox" name="selected_user_id" value="' . $i . '">' );
   }
   $temp_obj = $ResultArray[ $i ];
   $horde_config_frm->gen_single_item( $temp_obj->user_id );
   $horde_config_frm->gen_single_item( $temp_obj->user_name );
   echo( '</tr>' );
   }
}
$horde_config_frm->gen_submit_reset();
echo( '</table>' );
echo( '</form>' );
echo( '</center>' );
echo( "\n" );
?>
