ich habe einmal eine einfache einfache Umsetzung einer Druckversion als Modul gemacht. Als erstes habe ich ein "Modul" Drucken geschrieben das im Ausgabeteil des Moduls folgenden Inhalt hat und auf eine Datei print.php verweist. Als Anzeige dient dann nur ein Drucken-Button:
Code: Alles auswählen
<?php
echo"
<table align='left' width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr><form name='drucken' method='POST' target='_blank' action='print.php'>
<td align='center' valign='bottom' height='21'>
<input name='print_htmlhead' type='hidden' id='print_htmlhead' value='CMS_HTMLHEAD[1]'>
<input name='print_htmlsubhead' type='hidden' id='print_htmlsubhead' value='CMS_HTMLHEAD[2]'>
<input name='print_html' type='hidden' id='print_html' value='CMS_HTML[1]'>
<input name='print_img' type='hidden' id='print_img' value='CMS_IMG[2]'>
<input type='image' value='drucken'src='images/_druck.gif' alt='druck' align='bottom' border='0'>
</td></FORM>
</tr>
</table>";
?>
Das Beispiel für das Feld für den HTML Text:
Code: Alles auswählen
<input name='print_html' type='hidden' id='print_html' value='CMS_HTML[1]'>
Code: Alles auswählen
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Druckvorschau</title>
<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-color: #FFFFFF;
}
-->
</style>
<link rel="stylesheet" type="text/css" href="css/format.css" media="screen">
<link rel="stylesheet" type="text/css" href="css/format_p.css" media="print">
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<?php
$druck_headline= str_replace('\\','',$HTTP_POST_VARS[print_htmlhead]);
$druck_subheadline= str_replace('\\','',$HTTP_POST_VARS[print_htmlsubhead]);
$druck_html= str_replace('\\','',$HTTP_POST_VARS[print_html]);
$druck_img=str_replace('\\','',$HTTP_POST_VARS[print_img]);
echo "<font class=headline1>".$druck_headline."</font><br><br>";
?>
</td>
<td><img src="<?= $druck_img; ?>"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><font class=text><?= $druck_subheadline; ?></font></td>
</tr>
<tr>
<td colspan="2"><font class=text><?= $druck_html; ?></font></td>
</tr>
<tr>
<td colspan="2" align="right"><a href="javascript:window.print();"><img src="drucken.gif" alt="" width="98" height="23" border="0"></a></td>
</tr>
</table>
</body>
</html>
Code: Alles auswählen
$druck_headline= str_replace('\\','',$HTTP_POST_VARS[print_htmlhead]);
$druck_subheadline= str_replace('\\','',$HTTP_POST_VARS[print_htmlsubhead]);
$druck_html= str_replace('\\','',$HTTP_POST_VARS[print_html]);
$druck_img=str_replace('\\','',$HTTP_POST_VARS[print_img]);
Beispiel Texte:
Code: Alles auswählen
<tr>
<td colspan="2"><font class=text><?= $druck_subheadline; ?></font></td>
</tr>
Code: Alles auswählen
<tr>
<td><img src="<?= $druck_img; ?>"></td>
</tr>
Für meine Zwecke langt es. Ich habe es nur für Detailseiten benötigt die aus 4 Modulen wie Headline, Subheadline, Bild und Text bestehen. Mein Layout der print.php wird noch angepasst aber die technische übergabe funktioniert. Wer es einmal sehen möchte:
http://www.netter.de/Contenido/cms/fron ... p?idcat=11
http://www.netter.de/Contenido/cms/fron ... =108&m=&s=
Ich hoffe vieleicht einigen geholfen zu haben.
mfg
yodatortenboxer