Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?
2
	$self=basename($PHP_SELF);
3
	require_once "connect.php";
4
	if (!$modul) {$modul=1;}
5
?>
6
<html>
7
<head>
8
<title>Content-Management-System</title>
9
<link rel=stylesheet type="text/css" href="buttons.css">
10
<style type="text/css"><? require_once "buttons.css"; ?></style>
11
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
12
<script language="JavaScript">
13
<!--
14
function MM_swapImgRestore() { //v3.0
15
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
16
}
17
 
18
function MM_preloadImages() { //v3.0
19
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
20
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
21
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
22
}
23
 
24
function MM_swapImage() { //v3.0
25
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
26
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
27
}
28
 
29
function MM_findObj(n, d) { //v4.01
30
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
31
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
32
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
33
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
34
  if(!x && d.getElementById) x=d.getElementById(n); return x;
35
}
36
//-->
37
</script>
38
</head>
39
 
40
<?
41
	$images_Pfad='images/navigation/';
42
	$query="
43
		select
44
			button_name
45
		from
46
			Access,
47
			user_modules,
48
			user_modules_tools,
49
			modules,
50
			tools
51
		where
52
			Access.user = '$PHP_AUTH_USER'
53
		and
54
			Access.ID = user_modules.Access
55
		and
56
			user_modules.ID = user_modules_tools.user_modules
57
		and
58
			user_modules_tools.tools = tools.ID
59
		and
60
			(tools.server = '%' or tools.server = '".$_SERVER["SERVER_ADDR"]."')
61
		and
62
			user_modules.modules = modules.ID
63
 
64
	";
65
	$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
66
	$buttons=array();
67
	while($zeile=mysql_fetch_array($result))
68
	{
69
		array_push($buttons,"'".$images_Pfad."bt_".$zeile[button_name]."_f2.gif'");
70
	}
71
	$buttons=implode(", ", $buttons);
72
 
73
?>
74
<body leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" onLoad="MM_preloadImages(<? echo $buttons ?>,'../images/redaktion/bt_kontakt_f2.gif','../images/redaktion/bt_exit_f2.gif')" bgcolor="#FFFFFF" text="#000000">
75
<table border="0" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#666666">
76
  <tr valign="top">
77
<?
78
	$query_modules="select distinct modules.ID,modules.name from Access, user_modules, user_modules_tools, tools,  modules where user_modules.modules = modules.ID and user_modules_tools.user_modules = user_modules.ID and user_modules_tools.tools = tools.ID and user_modules.Access = Access.ID and Access.user = '$PHP_AUTH_USER' order by modules.rang";
79
	$result_modules = mysql_query ($query_modules) or die (mysql_errno().": ".mysql_error()."<hr>$query_modules<hr>");
80
	while($zeile_modules=mysql_fetch_array($result_modules))
81
	{
82
		$query_buttons="select tools.* from Access, user_modules, user_modules_tools, modules, tools where tools.modules = $modul and  user_modules.modules = modules.ID and user_modules_tools.user_modules = user_modules.ID and user_modules_tools.tools = tools.ID and user_modules.Access = Access.ID and Access.user = '$PHP_AUTH_USER' order by tools.rang";
83
		$result_buttons = mysql_query ($query_buttons) or die (mysql_errno().": ".mysql_error()."<hr>$query_buttons<hr>");
84
?>
85
    <td valign="top">
86
      <table border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#666666">
87
        <tr>
88
		  <td colspan="<? echo mysql_num_rows($result_buttons) ?>" align="center" class="button"><a href="<? echo $self ?>?modul=<? echo $zeile_modules[ID]; ?>">
89
            <? echo $zeile_modules[name]; ?>
90
            </a></td>
91
	</tr>
92
<?
93
	if ($zeile_modules[ID] == $modul)
94
	{
95
?>
96
	<tr>
97
<?
98
	while($zeile_buttons=mysql_fetch_array($result_buttons))
99
	{
100
		$imgsrc=$images_Pfad.'bt_'.$zeile_buttons[button_name].'.gif';
101
		$imgsrc_f2=$images_Pfad.'bt_'.$zeile_buttons[button_name].'_f2.gif';
102
?>
103
		  <td align="center" bgcolor="#CCCCCC"><a href="<? echo $zeile_buttons[filename] ?>" target="tool" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ID','','<? echo $imgsrc_f2 ?>',0)"><img name="Image<? echo $zeile_buttons[ID] ?>" border="0" src="<? echo $imgsrc ?>"></a></td>
104
<?
105
	}
106
?>
107
	</tr>
108
<?
109
	}
110
?>
111
	</table>
112
</td>
113
<?
114
	}
115
?>
116
</tr>
117
</table>
118
</body>
119
</html>