Location: PHPKode > projects > HERMES PHP-Based Business Mgmt > hermes-0.4.1/SideBar.php
<table width="100%" height="100%" border="0" cellspacing="1" cellpadding="3">
    <?
/*This section lists the modules installed
by looking at what files are listed in
the directory where forms are kept and
generates HTML links for the side bar.*/


function SideBar_make_links($handle, $dir_prefix){
	$linkval_array = array();

	while (($file = readdir($handle))!==false) {

    //If the name of a file starts with a ".", a "-" a, "Aux" etc, ends with a "~", its ignored:
		if(substr($file, (strlen($file)-4), 4) == ".php" &&
    			substr($file, 0, 3) != "Aux" &&
    			substr($file, 0, 1) != "." &&
    			substr($file, 0, 1) != "_" &&
			$file != "Logout.php"){


			array_push($linkval_array, $dir_prefix .
				(substr($file, 0, 
					(strlen($file) - 4))));
		}
	}
	natsort($linkval_array);
	array_push($linkval_array, "Logout");

	foreach ($linkval_array as $linkval){
	
		?>
		  <tr>
	 	   <td valign="top" bgcolor="00CC99">
			<font face="Arial, Helvetica, sans-serif" size="2">
		<?

			echo "<a href=$submit_url?form=$linkval>$linkval</a>";
		

	?>
	   </td>
          </tr>
	<?	
		
	}
}
$handle=opendir($formModulesDir);
SideBar_make_links($handle, '');
closedir($handle);

if ($current_user->is_admin){
	$handle=opendir("$formModulesDir/Admin");
	print "<tr><td>";
	print "Admin Tools:</td></tr>";
	SideBar_make_links($handle, "Admin/");
	closedir($handle);
}

if ($db_user_can_change_passwd){
	?><tr><td>User Tools:</td></tr>
	<tr><td valign="top" bgcolor="00CC99">
		<a href=<? print $submit_url; ?>?form=.Password>Password</a>
	</td></tr>
	<?

}
    ?>
</table>
Return current item: HERMES PHP-Based Business Mgmt