<?
	include("vars.inc.php");
	$bgcolor="red";
	
	// Plugin Aktivieren/Deaktivieren
	if ( isset($_GET['plugin']) && isset($_GET['action']) ) {
		$RETURN = editPlugin($_GET['plugin'], $_GET['action']);
	}
?>

<table width="95%"><tr><TD>
<? 
	if(strlen($RETURN)>0) {
	  ?>
	  	<div class="info">
	  		<img src="images/warning.png" alt="Achtung" align="left">
	  		<? echo $B_PLUGIN_ERR . $RETURN; ?>
	  	</div>
	  <?
	}
	
	exec($EASYPORTAL_SH." lst",$PLUGINS);
	echo '<table width="100%" cellspacing="0" cellpadding="2">';
	foreach ($PLUGINS as $ROW) {
		if(substr($ROW,0,1)<>"-") {
			$DATA = explode("\"", $ROW);
			$ANZAHL = count($DATA);

			for ($i = 0; $i < $ANZAHL; $i++) {
				if(strlen($DATA[$i])>1) {
					if(trim($DATA[$i])=="name=") {
						$PLUGIN=htmlentities(str_replace("=","",$DATA[$i+1]));
					}

					if(trim($DATA[$i])=="info=") {
						$INFO=htmlentities(str_replace("=","",$DATA[$i+1]));
					}

					if(trim($DATA[$i])=="active=") {
						echo "<td>";

						if(str_replace("=","",$DATA[$i+1])=="yes") {
							$IMG="greenled.png";
							$BUTTON="deaktiv.png";
							$ACT="off";
							$MESSAGE=$TIP_PLUGINS_OFF;
						}
						else {
							$IMG="redled.png";
							$BUTTON="aktiv.png";
							$ACT="on";
							$MESSAGE=$TIP_PLUGINS_ON;
						}
						echo "</td>";
					}
				}
			}
			if($bgcolor == "#d1d4e1") {
        			$bgcolor = "#e1e4f1";
			} else {
				$bgcolor = "#d1d4e1";
			}
			echo '<tr>';
			echo "<td bgcolor='$bgcolor' align='center'><img align='center' src='images/$IMG'></td>";
			echo "<td bgcolor='$bgcolor'><b>$PLUGIN</b></td>";
			echo "<td bgcolor='$bgcolor'>$INFO</td>";
			echo "<td bgcolor=\"$bgcolor\"><a href=\"?go=plugins&sub=all&plugin=$PLUGIN&action=$ACT\" onclick=\"wait('WaitEditPlugin')\" onmouseover=\"Tip('$MESSAGE')\"><img src=\"images/$BUTTON\"></a>";
			echo '</td>';
			echo '</tr>';
			
		}
	}
	echo "</table>";
	?>
	</TD></tr>
</table>