Location: PHPKode > projects > O - OpenSource GroupWare > osgw/admin/services.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/

include("./data.php");
$service['add_header'] = TRUE;
include("../config.inc.php");

include($here. "/class.admin.php");
$admin = new admin;
echo $layout->page_header;
echo $layout->service_header($text['service_name'] . ' - '. $text['plugin_manager'],$admin->nav_buttons());

	$fp = fopen($O->dir ."/services", 'r');

	$handle = opendir($O->dir);
	$i = 0;
	while (false !== ($file = readdir($handle))) {
		if(is_dir($O->dir ."/". $file) && !in_array($file, $system_dirs))
		{
	    		$available_services[$i]['location'] = $file;
			include($O->dir ."/". $available_services[$i]['location'] ."/data.php");
			$available_services[$i]['name'] = $service['name'];
		$i++;
		}

	}

	closedir($handle);
	$i = 0;
	while(!feof($fp))
	{

		$installed_services[$i] = trim(fgets($fp, 1024));
		$i++;

	}

	fclose($fp);


?>


<table style="width:400px" align="center">
<tr>
<td class="list_header" width="150">Available Services</td>
<td class="list_header">Status</td>

</tr>
<?php
$i = 0;

while($i < count($available_services))
{
	if($class == "list_light")
	{
		$class = "list_dark";
	} else {
		$class = "list_light";
	}
	echo "<tr><td class=\"$class\">". $available_services[$i]['name'] ."</td>";
	echo "<td class=\"$class\">";
	$service_location = $available_services[$i]['location'];
	if(!in_array($service_location, $installed_services))
	{
		include($O->dir ."/". $service_location ."/data.php");
		echo $O->create_link("/admin/service_install.php?lc=". $service_location ."&x=". $_GET['x']. "&s=". $_GET['s'],'Install');

	} else {
		echo "Already Installed";
	}
	echo "</td><td>";
	echo "</td>";
	echo "</tr>";
	$i++;
}
?>


</table>
Return current item: O - OpenSource GroupWare