<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RE-Design - Enrico Reinsdorf &#187; Adventskalender 2008</title>
	<atom:link href="http://www.re-design.de/category/adventskalender-2008/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.re-design.de</link>
	<description>Trainer für Konzeption und Umsetzung von medialen Internet-Projekten</description>
	<lastBuildDate>Fri, 28 Oct 2011 19:26:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Tag 24 – Abschluss</title>
		<link>http://www.re-design.de/2008/12/24/tag-24-abschluss/</link>
		<comments>http://www.re-design.de/2008/12/24/tag-24-abschluss/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 22:00:36 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=293</guid>
		<description><![CDATA[Nun ist es geschafft. Ich schreibe nun den letzten Artikel für meinen Adventskalender. Als Resümee kann ich sagen – es gibt noch viel zu tun bis mein Projekt endlich einsatzbereit ist. In den letzten Artikeln habe ich ja schon mal angedeutet was ich alles noch gern drin haben würde. Ich hoffe ich werde in der [...]]]></description>
			<content:encoded><![CDATA[<p>Nun ist es geschafft. Ich schreibe nun den letzten Artikel für meinen Adventskalender. Als Resümee kann ich sagen – es gibt noch viel zu tun bis mein Projekt endlich einsatzbereit ist. In den letzten Artikeln habe ich ja schon mal angedeutet was ich alles noch gern drin haben würde. Ich hoffe ich werde in der nächsten Zeit Zeit finden meine Wünsche umzusetzen.</p>
<p>Auf jeden Fall hat es riesig viel Spaß gemacht mein eigenes CMS zu entwickeln und dazu eine kleine Dokumentation zu schreiben. Auch wenn ich wiedermal den Aufwand, gerade für das Schreiben der Dokumentation, unterschätzt habe.</p>
<p>Ich hoffe euch, meine Leser, hat das Lesen meiner Artikel auch Freude bereitet und ihr habt vielleicht zusätzlich auch noch was neues gelernt.</p>
<p>Nun wünsche ich euch ein besinnliches Weihnachtsfest und einen guten Rutsch ins neue Jahr.</p>
<p>Zum Abschluss meiner <a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms-dokumentation.pdf">REDcms Dokumentation</a> bekommt ihr natürlich auch nochmal den gesamten <a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_17.zip">REDcms 17</a>, einschließlich dem Datenbank-Backup.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li><li><a href="http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/" title="Tag 18 – HTML-Vorlagen">Tag 18 – HTML-Vorlagen</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/24/tag-24-abschluss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 23 – Mehrbenutzer- und Rechtesystem</title>
		<link>http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/</link>
		<comments>http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 22:00:57 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=290</guid>
		<description><![CDATA[Am vorletzten Tag meines Adventskalenders möchte ich mich nochmals mit den Erweiterungen meines REDcms beschäftigen. Fast jedes Redaktionssystem wird von mehreren Mitarbeitern betreut und so möchte auch ich in naher Zukunft mein System mit diesem Feature ausstatten. Zusätzlich möchte ich, dass jeder registrierte Benutzer seine Rechte, also das was er im System alles machen darf, [...]]]></description>
			<content:encoded><![CDATA[<p>Am vorletzten Tag meines Adventskalenders möchte ich mich nochmals mit den Erweiterungen meines <strong>REDcms</strong> beschäftigen. Fast jedes Redaktionssystem wird von mehreren Mitarbeitern betreut und so möchte auch ich in naher Zukunft mein System mit diesem Feature ausstatten. Zusätzlich möchte ich, dass jeder registrierte Benutzer seine Rechte, also das was er im System alles machen darf, individuell eingestellt bekommt.</p>
<h3 class="western">Mehrbenutzer-System</h3>
<p>Um in meinem System auch mit mehreren Benutzern Arbeiten zu können, sollte natürlich als erstes die Anmeldung am System und damit verbunden die Verwaltung der Benutzer geändert werden.</p>
<p>Zur Zeit wird die Anmeldung, also der Benutzername und das Kennwort innerhalb der „<code>Login</code>“-Klasse verwaltet. Wenn es jetzt mehrere Benutzer geben soll, dann wäre es sinnvoller die Benutzernamen und Passwörter in die Datenbank auszulagern. Wenn sich dann ein Benutzer am System anmelden möchte wird in der Datenbank nachgesehen ob es den Benutzer mit dem dazugehörigen Passwort auch gibt. Falls ja können zum Beispiel dann weitere Informationen aus der Datenbank geladen werden, wie bspw. der Vor- und Zuname des Benutzers. So können die Benutzernamen Nicknamen, also fiktive Name, sein und der Benutzer wird trotzdem mit seinem richtigen Namen angesprochen. Auch könnte dann automatisch beim Schreiben neuer Seite bzw. neuer Boxen der Name des Redakteurs eingetragen werden und nicht wie zur Zeit von Hand.</p>
<p>Das schöne an der OOP ist das die „<code>Login</code>“-Klasse in ihrer Benutzung wahrscheinlich nicht geändert werden bräuchte, denn auch weiterhin wird man sich darüber an- und abmelden können. Selbst die Anfrage ob der Benutzer schon angemeldet ist, die von den verarbeitenden Klasse an die „Login“-Klasse gestellt wird, wird bleiben. Hinzukommt eigentlich nur, dass in der Session zusätzliche Angaben, wie den Vor- und Zunamen, hinzugefügt werden.</p>
<h3 class="western">Rechte-System</h3>
<p>Auch die Erweiterung meines <strong>REDcms</strong> mit einem Rechte-System wird aller Voraussicht nach gar nicht so schwer. Ich könnte mir bei der Rechtevergabe zwei Funktionsarten vorstellen.</p>
<p>Auf der einen Seite wäre da die individuelle Rechtevergabe für jeden einzelnen Benutzer des Systems. Der Vorteil wäre die völlig freie Einstellbarkeit der Rechte für jeden Benutzer. Aber das kann gerade bei sehr vielen Benutzern schnell auch sehr aufwendig werden. Vor allem wenn ständig die Berechtigungen der Benutzer sich ändert.</p>
<p>Auf der anderen Seite könnte die Rechtevergabe gruppenspezifisch geschehen, dass heißt jeder Gruppe bekommt individuelle Berechtigungen und jeder Benutzer kann dann einer oder mehreren Gruppen zugewiesen werden. Aber auch dieses Vorgehensweise hat Nachteile. Zum einen ist der Aufwand zum Erstellen eines solchen Systems viel höher und zum anderen müssen gerade bei vielen individuellen Benutzereinstellungen jedes mal eine neue Gruppe angelegt werden. Was den Aufwand schnell wieder hoch treibt.</p>
<p>Ich werde mich aber wahrscheinlich für die letztere Möglichkeit entscheiden, da sie aus meiner Sicht heraus am praktikabelsten ist.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li><li><a href="http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/" title="Tag 18 – HTML-Vorlagen">Tag 18 – HTML-Vorlagen</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 22 – Bild-Upload und RSS-Feed</title>
		<link>http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/</link>
		<comments>http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 22:00:48 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=287</guid>
		<description><![CDATA[Heute möchte ich über 2 mögliche Erweiterungen meines Systems schreiben. Zum einen ist das die Möglichkeit Dateien auf den Server hochzuladen, das ist zwar schon durch die „CKfinder“-Erweiterung des „FCKeditor“ zum Teil abgedeckt, aber die kostenlose Version blendet immer eine kleinen, störenden Hinweis ein. Zum anderen das Erstellen von RSS-Feeds um REDcms auch als kleines [...]]]></description>
			<content:encoded><![CDATA[<p>Heute möchte ich über 2 mögliche Erweiterungen meines Systems schreiben. Zum einen ist das die Möglichkeit Dateien auf den Server hochzuladen, das ist zwar schon durch die „<a href="http://www.ckfinder.com/">CKfinder</a>“-Erweiterung des „<a href="http://www.fckeditor.net/">FCKeditor</a>“ zum Teil abgedeckt, aber die kostenlose Version blendet immer eine kleinen, störenden Hinweis ein. Zum anderen das Erstellen von RSS-Feeds um <strong>REDcms</strong> auch als kleines Blog-System nutzen zu können.</p>
<h3 class="western">Datei-Upload</h3>
<p>In meinen verwendeten Online-Editor gibt es eine nette Erweiterung mit deren Hilfe man Bild, Flash-Dateien und andere Format auf den Server hochladen kann. Da diese Erweiterung für kommerzielle Projekte nicht kostenlos ist, könnte ich mir vorstellen in einer der nächsten Versionen die Möglichkeit des Uploads selber zu schreiben und in das System zu integrieren. So wäre ich davon unabhängig. Auch den Editor könnte ich in diesem Zuge selber erstellen, aber ich habe mich schon mehrfach daran gesetzt dies zu machen und habe es wegen des Aufwandes immer wieder abgebrochen. Naja vielleicht klappt es doch noch.</p>
<h3 class="western">RSS-Feeds</h3>
<p><a href="http://de.wikipedia.org/wiki/RSS">RSS-Feed</a>s sind zwar nicht die neue Form von Newsletter, aber man könnte sie damit vergleichen. Auf der eigenen Website gibt man den Besucher die Möglichkeit einzelne Seiten bzw. die gesamte Website als RSS-Feed zu abonnieren. Wenn dann Änderungen an diesem Feed entstehen werden diese in einer separaten XML-Datei abgespeichert.</p>
<p>Mit einer geeigneten Software, ich benutze dazu „Windows Live Mail“ kann man dann die Abos anfordern und bekommt die neuen Meldungen angezeigt. Das Praktische als Besucher der Website daran ist, dass man seinen Email-Account nicht veröffentlichen muss, denn man selber stellt dieses Abo in seiner Software ein. So ist auch das Abbestellen kinderleicht, denn man löscht ganz einfach in seiner Software das Abo und schon bekommt man keine Neuigkeiten mehr.</p>
<p>In einer der nächsten Überarbeitungen meines <strong>REDcms</strong> möchte ich diese Erweiterung des Abonnierens mit anbieten. Dass heißt das beim Anlegen und Ändern von Seite und Boxen die XML-Datei geändert werden muss. Dabei gibt es aber folgendes zu beachten. Was passiert wenn der Administrator des Systems eine Box von der Seite 1 in die Seite 2 verschiebt? Bekommen dann die Abonnenten die komplette Überarbeitung der XML-Datei zugeschickt?</p>
<p>Also gerade bei späteren Änderungen von abonnierten Informationen sollte ich mir genauere Gedanken machen. Vielleicht könnt ihr als Leser meines RSS-Feeds mir dabei helfen und ein paar Tipps im Kommentar hinterlassen.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li><li><a href="http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/" title="Tag 18 – HTML-Vorlagen">Tag 18 – HTML-Vorlagen</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 21 – Erweiterung durch AJAX</title>
		<link>http://www.re-design.de/2008/12/21/tag-21-erweiterung-durch-ajax/</link>
		<comments>http://www.re-design.de/2008/12/21/tag-21-erweiterung-durch-ajax/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 22:00:06 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=282</guid>
		<description><![CDATA[Um den Bedienungskomfort der Seite zu verbessern, habe ich mir gedacht das die Administration am besten immer innerhalb eines Popups. Also wenn man z.B. eine neue Seite hinzufügen möchte, sollte nicht eine neue Browser-Seite geladen werden, wie es zur Zeit der Fall ist, sondern besser wäre es wenn über die Thickbox-Erweiterung das Formular innerhalb einer [...]]]></description>
			<content:encoded><![CDATA[<p>Um den Bedienungskomfort der Seite zu verbessern, habe ich mir gedacht das die Administration am besten immer innerhalb eines Popups.</p>
<p>Also wenn man z.B. eine neue Seite hinzufügen möchte, sollte nicht eine neue Browser-Seite geladen werden, wie es zur Zeit der Fall ist, sondern besser wäre es wenn über die <a href="http://jquery.com/demo/thickbox/">Thickbox</a>-Erweiterung das Formular innerhalb einer darübergelegten Ebene angezeigt wird. Eigentlich könnte jede Modifikation am System damit erweitert werden. So auch eine Zwischenabfrage vor dem Löschen eines Menüpunktes, einer Box oder gar einer gesamten Seite – auch könnten verlinkte Bilder in dieser neuen Ebene angezeigt werden.</p>
<p>So schön dies klinkt, einen kleinen Nachteil hätte diese Erweiterung allerdings doch. Wenn JavaScript deaktiviert ist, könnte es zu Problemen kommen, da ja <a href="http://de.wikipedia.org/wiki/Ajax_(Programmierung)">AJAX </a>bekanntlich auf JavaScript aufbaut. Aus diesem Grund empfehle ich bewusst zur Zeit solche Erweiterungen nur im kontrollierten Rahmen anzuwenden. In meinem Fall wäre das der Administrationsbereich. Hier sollte JavaScript schon aus dem Grund aktiviert sein, um den <a href="http://www.re-design.de/workbook/?p=254">Online-Editor</a> zu benutzen. Im Frontend-Bereich wo jeder Besucher die Links benutzen möchte, ist es vielleicht zu viel verlangt.</p>
<p>Auch habe ich zur Zeit die Thickbox-Erweiterung nicht mit integriert, um die Übersichtlichkeit und damit die Verständlichkeit nicht zu gefärhden.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/21/tag-21-erweiterung-durch-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tag 20 – CSS-Design</title>
		<link>http://www.re-design.de/2008/12/20/276/</link>
		<comments>http://www.re-design.de/2008/12/20/276/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 22:00:57 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=276</guid>
		<description><![CDATA[Heute möchte ich etwas über das verwendete Design schreiben. Da das Projekt Schulungszwecken dient, habe ich mich für ein recht einfaches Design entschieden. Auch muss ich zugeben bin ich nicht der wirkliche Kreative in diesem Bereich. Screen-Design Das Design besitzt den klassischen Aufbau eines 2spaltigen Layouts mit einem Kopfbereich und einer Fußzeile. So können alle [...]]]></description>
			<content:encoded><![CDATA[<p>Heute möchte ich etwas über das verwendete Design schreiben. Da das Projekt Schulungszwecken dient, habe ich mich für ein recht einfaches Design entschieden. Auch muss ich zugeben bin ich nicht der wirkliche Kreative in diesem Bereich.</p>
<h3 class="western">Screen-Design</h3>
<p>Das Design besitzt den klassischen Aufbau eines 2spaltigen Layouts mit einem Kopfbereich und einer Fußzeile. So können alle wichtigen Informationen übersichtlich untergebracht werden.</p>
<pre>+------------------------------------+
| Website-Titel                      |
| Slogan                             |
+---------------+--------------------+
| Seitentitel   | Sidebar            |
| Einführung    | +----------------+ |
| +-----------+ | | Navigation     | |
| | Box-Titel | | +----------------+ |
| | Box-Text  | | +----------------+ |
| +-----------+ | | Administration | |
|               | +----------------+ |
+---------------+--------------------+
| Copyright                          |
+------------------------------------+</pre>
<h4 class="western">Reset-Datei</h4>
<p>Um die unterschiedlichen CSS-Werte der verschiedenen Browser besser in den Griff zu bekommen, wird als erstes eine Reset-Datei geladen die alle wichtigen Style-Angaben für mich vordefiniert.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">body,</span> <span style="color: #3f7f7f;">div,</span> <span style="color: #3f7f7f;">dl,</span> <span style="color: #3f7f7f;">dt,</span> <span style="color: #3f7f7f;">dl,</span> <span style="color: #3f7f7f;">ul,</span> <span style="color: #3f7f7f;">ol,</span> <span style="color: #3f7f7f;">li,</span> <span style="color: #3f7f7f;">h1,</span> <span style="color: #3f7f7f;">h2,</span> <span style="color: #3f7f7f;">h3,</span> <span style="color: #3f7f7f;">h4,</span> <span style="color: #3f7f7f;">h5,</span> <span style="color: #3f7f7f;">h6,</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">pre,</span> <span style="color: #3f7f7f;">form,</span> <span style="color: #3f7f7f;">fieldset,</span> <span style="color: #3f7f7f;">input,</span> <span style="color: #3f7f7f;">p,</span> <span style="color: #3f7f7f;">blockoute,</span> <span style="color: #3f7f7f;">th,</span> <span style="color: #3f7f7f;">td</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">h1,</span> <span style="color: #3f7f7f;">h2,</span> <span style="color: #3f7f7f;">h3,</span> <span style="color: #3f7f7f;">h4,</span> <span style="color: #3f7f7f;">h5,</span> <span style="color: #3f7f7f;">h6</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>100%</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">ol,</span> <span style="color: #3f7f7f;">ul</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">list-style</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>none</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">adress,</span> <span style="color: #3f7f7f;">caption,</span> <span style="color: #3f7f7f;">cite,</span> <span style="color: #3f7f7f;">code,</span> <span style="color: #3f7f7f;">dfn,</span> <span style="color: #3f7f7f;">em,</span> <span style="color: #3f7f7f;">strong,</span> <span style="color: #3f7f7f;">th,</span> <span style="color: #3f7f7f;">var</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-style</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>normal</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font-weight</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>normal</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">table</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">border-collapse</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>collapse</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">border-spacing</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>100%</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">fieldset,</span> <span style="color: #3f7f7f;">img</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">border</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">caption,</span> <span style="color: #3f7f7f;">th,</span> <span style="color: #3f7f7f;">td</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">text-align</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>left</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">vertical-align</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>top</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">q:before,</span> <span style="color: #3f7f7f;">q:after</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">content</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>&#8221;</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Bei umfangreicheren Designs im Webbereich hat sich weiterhin eingebürgert, dass man das Layout der Site vom Design getrennt behandelt. Auch ich habe zwei separate Datei („<code>layout.css</code>“ und „<code>design.css</code>“) dazu erstellt.</p>
<h4 class="western">Layout-Datei</h4>
<p>Als Erstes möchte ich das Layout erklären. Um die Website zu zentrieren, habe ich um den gesamten Inhaltsbereich eine „<code>div</code>“-Container erstellt. Somit kann ich alles gut mittig mit einer Breite von 720 Pixeln platzieren.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">body</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">text-align</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>center</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#page</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">width</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>720px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span> <span style="color: #2a00e1;"><em>auto</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">text-align</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>left</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Die Überschriften innerhalb meines Kopfbereichen sind jetzt sehr nah am Rand weswegen ich ihnen etwas Abstand gegeben habe.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#branbing</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Im Prinzip werde ich jedem „<code>div</code>“-Container diesen Abstand geben. Ich habe ihn bewusst in die Layout-Datei und nicht in die Design-Datei geschrieben, weil er die Breiten der „<code>div</code>“-Container beeinflusst.</p>
<p>Um die zwei Spalten zu platzieren, habe ich beide per „<code>float</code>“-Befehl angeordnet, ihnen Breiten und Abstände gegeben.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">float</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>left</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">width</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>500px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin-right</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>10px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#sidebar</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">float</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>left</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">width</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>190px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Damit der Fußbereich dann auch wieder unterhalb dieses Bereiches weiterläuft, habe ich auch ihn in der Layout-Datei ein paar Werte gegeben.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#copyright</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">clear</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>both</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Zum Schluss habe ich noch den Inhalt der Administrationsbox layoutet. Dabei rücke ich den Code per Tab weiterein je tiefer die Verschachtelung ist.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	.adminBox</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0.8em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#content 	.adminBox p</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#content 	.adminBox li</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">display</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>inline</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#content 	.adminBox li a</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">float</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>left</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">display</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>block</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
</ol>
<h4 class="western">Design-Datei</h4>
<p>Zur Zeit habe ich nur wenige design-technische Änderungen vorgenommen. Als erstes habe ich allgemeinen Definitionen erstellt.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">body</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#FFF</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#CCC</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>14px/1.4em</em></span> <span style="color: #2a00e1;"><em>&#8220;Trebuchet 	MS&#8221;,</em></span> <span style="color: #2a00e1;"><em>Arial,</em></span> <span style="color: #2a00e1;"><em>Helvetica,</em></span> <span style="color: #2a00e1;"><em>sans-serif</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">input:focus,</span> <span style="color: #3f7f7f;">textarea:focus,</span> <span style="color: #3f7f7f;">select:focus</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#000</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">background</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#fff</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">border</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1px</em></span> <span style="color: #2a00e1;"><em>solid</em></span> <span style="color: #2a00e1;"><em>red</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<h5 class="western">Div-Page</h5>
<p>Der „<code>page</code>“-Container bekommt zusätzlich noch eine kleine Überarbeitung.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#page</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#000</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#FFF</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<h5 class="western">Div-Branding</h5>
<p>Da in meinem Fall der Kopfbereich nur Angaben über das Projekt enthalten soll besteht dieser nur aus zwei Überschriften.</p>
<ol class="Sourcecode">
<li>
<pre>&lt;div id="branding"&gt;</pre>
</li>
<li>
<pre>	&lt;h1&gt;RE-Design&lt;/h1&gt;</pre>
</li>
<li>
<pre>	&lt;h2&gt;REDcms Advents&lt;/h2&gt;</pre>
</li>
<li>
<pre style="margin-bottom: 0.5cm;">&lt;/div&gt;</pre>
</li>
</ol>
<p>In der CSS-Datei wird dann folgende Formatierung darauf angewendet:</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#branding</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#333</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#FFF</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font-family</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>Georgia,&#8221;Time New Roman&#8221;,</em></span> <span style="color: #2a00e1;"><em>Times,</em></span> <span style="color: #2a00e1;"><em>serif</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font-style</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>italic</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#branding 	h1</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>3em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">line-height</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#branding 	h2</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1.5em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">line-height</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#3C0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
</ol>
<h5 class="western">Div-Content</h5>
<p>Als nächstes werden alle wichtigen Tags im „<code>content</code>“-Container definiert.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	h2,</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	h3,</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	h4,</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	h5,</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	h6</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-family</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>Georgia,&#8221;Time New Roman&#8221;,</em></span> <span style="color: #2a00e1;"><em>Times,</em></span> <span style="color: #2a00e1;"><em>serif</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font-style</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>italic</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">line-height</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin-bottom</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>0.5em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	h2</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>2em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	h3</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1.4em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	h4</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1.2em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	h5</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1.1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	h6</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	p</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin-bottom</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">text-align</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>justify</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Zusätzlich werden noch die Listen der Metaangaben gestylt.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	ul.meta</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0.8em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#content 	ul.meta li</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin-bottom</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0.5em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
</ol>
<p>Auch die angezeigten Formulare sind nicht von der Überarbeitung durch das Design-CSS verschont geblieben.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#content 	.add fieldset</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">border</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1px</em></span> <span style="color: #2a00e1;"><em>solid</em></span> <span style="color: #2a00e1;"><em>#333</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin-bottom</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	.add legend</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">border</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1px</em></span> <span style="color: #2a00e1;"><em>solid</em></span> <span style="color: #2a00e1;"><em>#333</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#CCC</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	.add label</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0.8em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	.add label.before</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">display</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>block</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	.add input,</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	.add textarea</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">width</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>470px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font-family</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>sans-serif</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#content 	.add option:hover</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#CCC</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<h5 class="western">Div-Sidebar</h5>
<p>Da in der Sidebar mehrere Boxen existieren können, habe ich als erstes grundlegende Einstellungen vorgenommen.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#sidebar 	.box</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">border</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>1px</em></span> <span style="color: #2a00e1;"><em>solid</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin-bottom</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	.box h4</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>#333</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#FFF</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">text-align</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>center</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin-bottom</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0.2em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
</ol>
<p>Für die Navigation gab es dann noch separate Einstellungen.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#sidebar 	#navigation</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#navigation ul</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span> <span style="color: #2a00e1;"><em>5px</em></span> <span style="color: #2a00e1;"><em>1em</em></span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#navigation ul ul</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span> <span style="color: #2a00e1;"><em>0</em></span> <span style="color: #2a00e1;"><em>0</em></span> <span style="color: #2a00e1;"><em>1.5em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
</ol>
<p>Ebenso für den Login bzw. das Logout und die Box „über mich“.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#sidebar 	#login</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login p</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0.8em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login legend</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-style</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>italic</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">text-transform</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>uppercase</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login strong</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-weight</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>bold</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">text-transform</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>uppercase</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login ul</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login a</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">padding-left</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>20px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login .page</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">background</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>transparent</em></span> <span style="color: #2a00e1;"><em>url(&#8220;/REDcms/templates/images/icons/page.png&#8221;)</em></span> <span style="color: #2a00e1;"><em>no-repeat</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login .box</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">background</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>transparent</em></span> ur<span style="color: #2a00e1;"><em>l(&#8220;/REDcms/templates/images/icons/box.png&#8221;)</em></span> <span style="color: #2a00e1;"><em>no-repeat</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">border</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>none</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#login .menu</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">background</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>transparent</em></span> <span style="color: #2a00e1;"><em>url(&#8220;/REDcms/templates/images/icons/menu.png&#8221;)</em></span> <span style="color: #2a00e1;"><em>no-repeat</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #3f7f7f;">#sidebar 	#about_us</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#sidebar 	#about_us p</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">font-size</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>0.8em</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">margin</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
</ol>
<h5 class="western">Div-Footer</h5>
<p>Was noch fehlt, ist der Fußbereich. Hier sind nur die Farben geändert worden.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">#copyright</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#333</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#FFF</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #3f7f7f;">#copyright 	a</span> <span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#FFF</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
</ol>
<h5 class="western">Div-Debug</h5>
<p>Eine kleine Besonderheit habe ich meinen Debugging gegeben. Jedes mal wenn die <a href="http://www.re-design.de/workbook/?p=178">allgemeine Funktion</a> „<code>code()</code>“ aufrufe, erzeuge ich eine „<code>div</code>“-Container mit der Klasse „<code>debug</code>“.</p>
<ol class="Sourcecode">
<li> <span style="color: #0000ff;"><span style="font-family: Courier New,monospace;">function </span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">code(</span></span><span style="color: #660000;"><span style="font-family: Courier New,monospace;">$msg</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">, </span></span><span style="color: #660000;"><span style="font-family: Courier New,monospace;">$code</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">=HTML_CODE)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$msg </span><span style="color: #000000;">= print_r(</span><span style="color: #660000;">$msg</span><span style="color: #000000;">, </span><span style="color: #0000ff;">true</span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #660000;">$code </span><span style="color: #000000;">== HTML_CODE)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$msg </span><span style="color: #000000;">= htmlentities(</span><span style="color: #660000;">$msg</span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">echo </span><span style="color: #008200;">&#8216;&lt;div 	class=&#8221;debug&#8221;&gt;&lt;pre&gt;&#8217;</span><span style="color: #000000;">.</span><span style="color: #660000;">$msg</span><span style="color: #000000;">.</span><span style="color: #008200;">&#8216;&lt;/pre&gt;&lt;/div&gt;&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Zusätzlich designe ich per CSS das dieser Container über allem anderen angezeigt werden soll. Somit sehen ich ihn immer.</p>
<ol class="Sourcecode">
<li> <span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">.debug</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"> <span style="color: #7f007f;">position</span><span style="color: #000000;">:</span><span style="color: #2a00e1;"><em>absolute</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">width</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>300px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">height</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>400px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">overflow</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>auto</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">text-align</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>left</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">padding</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>5px</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#FFF</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">background-color</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>#300</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #7f007f;">border</span><span style="color: #000000;">:</span> <span style="color: #2a00e1;"><em>1px</em></span> <span style="color: #2a00e1;"><em>solid</em></span> <span style="color: #2a00e1;"><em>#000</em></span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<h3 class="western">Print-Design</h3>
<p>Eigentlich wollte ich eine spezielle Druckversion per CSS für die Ausgabe erstellen – doch leider fehlte mir dafür die Zeit. Da sie aber auch schon auf meiner ToDo-Liste steht, wird sie bestimmt im nächsten Release vorhanden sein.</p>
<p>Ich hoffe ihr habt Verständnis dafür.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_16.zip">REDcms_16.zip</a></li>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/layout.txt">Layout.txt</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li><li><a href="http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/" title="Tag 18 – HTML-Vorlagen">Tag 18 – HTML-Vorlagen</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/20/276/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 19 – Formulare</title>
		<link>http://www.re-design.de/2008/12/19/tag-19-formulare/</link>
		<comments>http://www.re-design.de/2008/12/19/tag-19-formulare/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 22:00:24 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=261</guid>
		<description><![CDATA[In vielen Artikeln in diesem Adventskalender habe ich schon über die verwendeten Formulare berichtet. Heute möchte ich mich diesen Formularen etwas genauer widmen. Page-Formular Als erstes möchte ich das „Page“-Formular beschreiben. Wie schon im Artikel über die „Page“-Klasse geschildert werden nicht viele Information, die sich in 2 Gruppen unterteilen, vom Benutzer verlangt. Im Inhaltsbereich wird [...]]]></description>
			<content:encoded><![CDATA[<p>In vielen Artikeln in diesem Adventskalender habe ich schon über die verwendeten Formulare berichtet. Heute möchte ich mich diesen Formularen etwas genauer widmen.</p>
<h3 class="western">Page-Formular</h3>
<p>Als erstes möchte ich das „<code>Page</code>“-Formular beschreiben. Wie schon im <a href="http://www.re-design.de/workbook/?p=236">Artikel</a> über die „<code>Page</code>“-Klasse geschildert werden nicht viele Information, die sich in 2 Gruppen unterteilen, vom Benutzer verlangt.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-seite-formular.png"><img class="alignnone size-medium wp-image-262" title="neue Seite Formular" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-seite-formular-167x300.png" alt="" width="167" height="300" /></a></p>
<p>Im Inhaltsbereich wird der Titel der Seite, der Name des Autors und der Einführungstext angegeben, wobei nur der Titel als Pflicht verlangt wird. Da der Einführungstext sehr umfangreich sein kann, habe ich mich hier entschlossen einen <a href="http://www.re-design.de/workbook/?p=254">online WYSIWYG-Editor</a> einzubinden.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-seite-formular-inhalt.png"><img class="alignnone size-medium wp-image-263" title="neue Seite Formular - Inhalt" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-seite-formular-inhalt-256x300.png" alt="" width="256" height="300" /></a></p>
<p>In den 2. Teil des Formulars werden vom Benutzer Zusatzinformationen für die Seite abgefragt. Als erstes ist das der Dateiname des zu verwendenden Templates. Mit der Select-Box kann der Veröffentlichungszustand der Seite angegeben werden. Die letzte Angabe, das Berechtigungslevel, wird zwar zur Zeit noch nicht benötigt, weshalb der Wert Null ist, kann aber später für bestimmte Zugangsberechtigungen dienen. So können später die einzelnen Seiten über verschiedene Level vor nicht berechtigten Besuchern geschützt werden.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-seite-formular-meta.png"><img class="alignnone size-medium wp-image-264" title="neue Seite Formular - Meta" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-seite-formular-meta-300x131.png" alt="" width="300" height="131" /></a></p>
<h3 class="western">Menu-Formular</h3>
<p>Ähnlich wie das „<code>Page</code>“-Formular braucht auch das „<code>Menü</code>“-Formular nicht wirklich viele Angaben. Im Gegensatz zum „<code>Page</code>“-Formular sind die Eingaben aber in 3 Bereiche untergliedert.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular.png"><img class="alignnone size-medium wp-image-265" title="Neues Menü Formular" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular-266x300.png" alt="" width="266" height="300" /></a></p>
<p>Im ersten werden Angaben über den Namen des Menüpunktes und seinen Titel, er ist optional, verlangt.</p>
<p class="western"><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular-link.png"><img class="alignnone size-medium wp-image-266" title="neues Menü Lormular - Link" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular-link-300x98.png" alt="" width="300" height="98" /></a></p>
<p>Im zweite Teil des Formulars werden die Verbindungsangaben benötigt. Da der Benutzer beim Anlegen einer neuen Seite nicht direkt mitangeben muss wie sie im System verlinkt ist, kann er dies nun nachholen. Auch ist es so möglich mehrere Menüpunkte auf eine Seite zu verlinken oder er kann Seiten anlegen, die gar nicht verlinkt sind, wie z.B. Fehlerseiten.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular-verbindung.png"><img class="alignnone size-medium wp-image-267" title="neues Menü Formular - Verbindung" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular-verbindung-300x90.png" alt="" width="300" height="90" /></a></p>
<p>Der letzte Bereich ist, ähnlich wie bei dem „<code>Page</code>“-Formular, wieder mit den Meta-Angaben über den Menüpunkt bestückt.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular-meta.png"><img class="alignnone size-medium wp-image-268" title="neues Menü Formular - Meta" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neues-menue-formular-meta-300x94.png" alt="" width="300" height="94" /></a></p>
<h3 class="western">Box-Formular</h3>
<p>Das letzte Formular in diesem Artikel ist das „<code>Box</code>“-Formular. Es ist wohl das umfangreichste von den Drein. Auch hier sind die Angaben in 3 Bereiche unterteilt.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular.png"><img class="alignnone size-medium wp-image-269" title="neue Box Formular" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular-111x300.png" alt="" width="111" height="300" /></a></p>
<p>Der Inhaltsbereich verlangt wieder nach einem Titel und nach einem Einführungstext, wie beim „<code>Page</code>“-Formular. Zusätzlich kann aber optional auch noch ein weiterführender Text mit angegeben werden. So ist es später möglich Übersichtsseiten mit nur den Einführungstexten der Boxen zu erstellen und über einen Link zu den weiterführenden Informationen zu gelangen.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular-inhalt.png"><img class="alignnone size-medium wp-image-270" title="neue Box Formular - Inhalt" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular-inhalt-157x300.png" alt="" width="157" height="300" /></a></p>
<p>Da jede Box zu einer Seite zugewiesen werden muss, wird im zweiten Teil des Formulars nach der Seite für die Box gefragt.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular-verbindung.png"><img class="alignnone size-medium wp-image-271" title="neue Box Formular - Verbindung" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular-verbindung-300x58.png" alt="" width="300" height="58" /></a></p>
<p>Wie bei den beiden vorhergehenden Formularen werden auch hier, im dritten Teil des Formulars werden vom Benutzer Angaben über das zu verwendende Template, über den Veröffentlichungsstatus und dem Zugriffslevel verlangt.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular-meta.png"><img class="alignnone size-medium wp-image-272" title="neue Box Formular - Meta" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-neue-box-formular-meta-300x128.png" alt="" width="300" height="128" /></a></p>
<h3>Donwloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_14.zip">Bilder.zip</a></li>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_15.zip">REDcms_15.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/" title="Tag 18 – HTML-Vorlagen">Tag 18 – HTML-Vorlagen</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/19/tag-19-formulare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 18 – HTML-Vorlagen</title>
		<link>http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/</link>
		<comments>http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 22:00:05 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[redcms]]></category>
		<category><![CDATA[vorlage]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=257</guid>
		<description><![CDATA[Heute möchte ich etwas über die verwendeten Templates schreiben. Wie schon im Artikel über die „Template“-Klasse geschrieben habe, setzt sich die Website aus verschiedenen Code-Schnipsel zusammen. Sie werden ineinander verschachtelt. Index-Seite In der Index-Seite steht das gesamte Grundgerüst. Neben dem allgemeinen Aufbau der HTML-Seite werden hier auch alle CSS-Dateien und JavaScript-Dateien geladen. &#60;!DOCTYPE html PUBLIC [...]]]></description>
			<content:encoded><![CDATA[<p>Heute möchte ich etwas über die verwendeten Templates schreiben. Wie schon im Artikel über die <a href="http://www.re-design.de/workbook/?p=241">„<code>Template</code>“-Klasse</a> geschrieben habe, setzt sich die Website aus verschiedenen Code-Schnipsel zusammen. Sie werden ineinander verschachtelt.</p>
<h3 class="western">Index-Seite</h3>
<p>In der Index-Seite steht das gesamte Grundgerüst. Neben dem allgemeinen Aufbau der HTML-Seite werden hier auch alle CSS-Dateien und JavaScript-Dateien geladen.</p>
<ol class="Sourcecode">
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;!</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">DOCTYPE</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">html</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #808080;"><span style="font-family: Courier New,monospace;">PUBLIC</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&#8220;-//W3C//DTD 	XHTML 1.0 Transitional//EN&#8221;</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #3f7f5f;"><span style="font-family: Courier New,monospace;">&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">html</span> <span style="color: #7f007f;">xmlns</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://www.w3.org/1999/xhtml&#8221;</em></span> <span style="color: #7f007f;">xml:lang</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;de&#8221;</em></span> <span style="color: #7f007f;">lang</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;de&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">head</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">meta</span> <span style="color: #7f007f;">http-equiv</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;Content-Type&#8221;</em></span> <span style="color: #7f007f;">content</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;text/html; 	charset=utf-8&#8243;</em></span> <span style="color: #008080;">/&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">title</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##TITLEBAR##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">title</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">link</span> <span style="color: #7f007f;">rel</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;stylesheet&#8221;</em></span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;##BASEURL##/templates/styles/reset.css&#8221;</em></span> <span style="color: #008080;">/&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">link</span> <span style="color: #7f007f;">rel</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;stylesheet&#8221;</em></span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;##BASEURL##/templates/styles/layout.css&#8221;</em></span> <span style="color: #008080;">/&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">link</span> <span style="color: #7f007f;">rel</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;stylesheet&#8221;</em></span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;##BASEURL##/templates/styles/design.css&#8221;</em></span> <span style="color: #008080;">/&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">script</span> <span style="color: #7f007f;">type</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;text/javascript&#8221;</em></span> <span style="color: #7f007f;">src</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;##BASEURL##/templates/scripts/script.js&#8221;</em></span><span style="color: #008080;">&gt;&lt;/</span><span style="color: #3f7f7f;">script</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">style</span> <span style="color: #7f007f;">type</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;text/css&#8221;</em></span><span style="color: #008080;">&gt;&lt;/</span><span style="color: #3f7f7f;">style</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">head</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">body</span> <span style="color: #7f007f;">lang</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;de&#8221;</em></span> <span style="color: #7f007f;">dir</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;ltr&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;page&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;branding&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">h1</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##WEBSITETITLE##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">h1</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">h2</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##TAGLINE##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">h2</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;main&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;content&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##CONTENT##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;sidebar&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##SIDEBAR##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;copyright&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">p</span><span style="color: #008080;">&gt;</span><span style="color: #2a00ff;">&amp;copy;</span><span style="color: #000000;"> 2008 </span><span style="color: #2a00ff;">&amp;ndash;</span><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">a</span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://www.re-design.de&#8221;</em></span><span style="color: #008080;">&gt;</span><span style="color: #000000;">RE-Design</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">a</span><span style="color: #008080;">&gt;&lt;/</span><span style="color: #3f7f7f;">p</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">ul</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;valid&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;&lt;</span><span style="color: #3f7f7f;">a</span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://validator.w3.org/check?uri=referer&#8221;</em></span><span style="color: #008080;">&gt;&lt;</span><span style="color: #3f7f7f;">img</span> <span style="color: #7f007f;">src</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://www.w3.org/Icons/valid-xhtml10&#8243;</em></span> <span style="color: #7f007f;">alt</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;Valid 	XHTML 1.0 Transitional&#8221;</em></span> <span style="color: #7f007f;">height</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;31&#8243;</em></span> <span style="color: #7f007f;">width</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;88&#8243;</em></span> <span style="color: #008080;">/&gt;&lt;/</span><span style="color: #3f7f7f;">a</span><span style="color: #008080;">&gt;&lt;/</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;&lt;</span><span style="color: #3f7f7f;">a</span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://jigsaw.w3.org/css-validator/&#8221;</em></span><span style="color: #008080;">&gt;&lt;</span><span style="color: #3f7f7f;">img</span> <span style="color: #7f007f;">style</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;border:0;width:88px;height:31px&#8221;</em></span> <span style="color: #7f007f;">src</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://jigsaw.w3.org/css-validator/images/vcss&#8221;</em></span> <span style="color: #7f007f;">alt</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;CSS 	ist valide!&#8221;</em></span> <span style="color: #008080;">/&gt;&lt;/</span><span style="color: #3f7f7f;">a</span><span style="color: #008080;">&gt;&lt;/</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">ul</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">body</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;/</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">html</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
</ol>
<p>In dieser Datei gibt es eigentlich nur zwei Schlüsselworte die durch neue Schnipsel ersetzt werden: <code>##CONTENT##</code> und <code>##SIDEBAR##</code>. Die restlichen Schlüsselworte werden direkt in der <a href="http://www.re-design.de/workbook/?p=208">„<code>Application</code>“-Klasse</a> mit Inhalt gefüllt.</p>
<h3 class="western">Content-Bereich</h3>
<p>Da der Content-Bereich sehr viele verschiedene Aufgaben erfüllen muss, gibt es auch sehr viele verschiedene Code-Schnipsel die an diesem Platz eingesetzt werden:</p>
<ul>
<li>page.tpl.html</li>
<li>page.form.tpl.html</li>
<li>menu.form.tpl.html</li>
<li>box.form.tpl.html</li>
</ul>
<p>Der wohl wichtigste Bereich in diesem System ist die „<code>page.tpl.html</code>“-Datei, weswegen ich sie hier auch näher mal beschreibe.</p>
<h4 class="western">Page-Bereich</h4>
<p>Der „<code>Page</code>“-Vorlage wird von der „<code>Page</code>“-Klasse benutzt und mit Inhalt gefüllt. Aber zusätzlich wird in der „Page“-Klasse auch die Inhalte für die einzelnen Boxen gesammelt. Deshalb wird das „<code>##BOXES##</code>“-Schlüsselwort nicht direkt von der „<code>Page</code>“-Klasse gefüllt.</p>
<ol class="Sourcecode">
<li>
<p style="margin-bottom: 0cm;"><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">div</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #7f007f;"><span style="font-family: Courier New,monospace;">class</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">=</span></span><span style="color: #2a00ff;"><span style="font-family: Courier New,monospace;"><em>&#8220;page&#8221;</em></span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #7f007f;"><span style="font-family: Courier New,monospace;">id</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">=</span></span><span style="color: #2a00ff;"><span style="font-family: Courier New,monospace;"><em>&#8220;page_##ID##&#8221;</em></span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></p>
</li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">h2</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##TITLE## 	##ADMIN##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">h2</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">ul</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;meta&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##AUTHOR##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##MODIFIED##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">ul</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;teaser&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##TEASER##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;boxes&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##BOXES##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;/</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">div</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
</ol>
<h3 class="western">Box-Bereich</h3>
<p>Wie gerade beschrieben, füllt die „<code>Box</code>“-Klasse die „<code>Box</code>“-Vorlage und gibt sie dann an die „<code>Page</code>“-Klasse weiter, die diese dann an den richtigen Platz innerhalb der „<code>Page</code>“-Vorlage einsetzt.</p>
<ol class="Sourcecode">
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">div</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #7f007f;"><span style="font-family: Courier New,monospace;">class</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">=</span></span><span style="color: #2a00ff;"><span style="font-family: Courier New,monospace;"><em>&#8220;teaserbox&#8221;</em></span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #7f007f;"><span style="font-family: Courier New,monospace;">id</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">=</span></span><span style="color: #2a00ff;"><span style="font-family: Courier New,monospace;"><em>&#8220;box_##ID##&#8221;</em></span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">h3</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##TITLE## 	##ADMIN##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">h3</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">ul</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;meta&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##MODIFIED##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">li</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">ul</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;teaser&#8221;</em></span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##TEASER##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;body&#8221;</em></span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##BODY##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;/</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">div</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
</ol>
<h3 class="western">Sidebar-Bereich</h3>
<p>Auch die „<code>Sidebar</code>“-Vorlage wird von eine Klasse benutzt. Allerdings gibt es hier keine eigene Klasse sondern es ist die gleiche wie schon bei der „<code>Index</code>“-Vorlage. Es ist die „<code>Application</code>“-Klasse.</p>
<ol class="Sourcecode">
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">h3</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">Sidebar</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;/</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">h3</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;box&#8221;</em></span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;navigation&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##NAVIGATION##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;box&#8221;</em></span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;login&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##LOGIN##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;box&#8221;</em></span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;about_us&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">h4</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">Über 	das Projekt</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">h4</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">p</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">Die 	ist nur ein kleines CMS-Beispiel. Ich hoffe ihr habt Spaß dieses zu 	benutzen. Falls ihr Fehler findet dann schreibt eine Nachricht an: </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">a</span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;mailto:enrico@re-design.de&#8221;</em></span> <span style="color: #7f007f;">class</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;nowrap&#8221;</em></span><span style="color: #008080;">&gt;</span><span style="color: #000000;">enrico@re-design.de</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">a</span><span style="color: #008080;">&gt;&lt;/</span><span style="color: #3f7f7f;">p</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;/</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">div</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
</ol>
<p>Die „<code>Application</code>“-Klasse füllt dabei 2 Schlüsselworte mit Inhalt. Auf der einen Seite (<code>##NAVIGATION##</code>) ist es die Menüstruktur und auf der anderen Seite (<code>##LOGIN##</code>) der Administrationskasten. Zusätzlich ist hier auch noch ein fester Kasten eingetragen. Er kann später entweder mit mehr, bzw. anderen Inhalt gefüllt oder gelöscht werden.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_13.zip">REDcms_13.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/18/tag-18-html-vorlagen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 17 – WYSIWYG-Editor</title>
		<link>http://www.re-design.de/2008/12/17/tag-17-wysiwyg-editor/</link>
		<comments>http://www.re-design.de/2008/12/17/tag-17-wysiwyg-editor/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 22:00:11 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=254</guid>
		<description><![CDATA[Ein „WYSIWYG“-Editor ist ein Bearbeitungswerkzeug für Texte. Da der sichtbare Text im Browser nicht unbedingt mit dem im Quellcode übereinstimmt, müsste der Redakteur im einfachsten Fall den Quellcode von Hand schreiben. Dies ist aber fast immer sehr umständlich und zeitaufwändig. Deshalb haben Software-Programmierer Werkzeuge entwickelt in denen man relativ einfach seinen Text schreiben kann und [...]]]></description>
			<content:encoded><![CDATA[<p>Ein „WYSIWYG“-Editor ist ein Bearbeitungswerkzeug für Texte. Da der sichtbare Text im Browser nicht unbedingt mit dem im Quellcode übereinstimmt, müsste der Redakteur im einfachsten Fall den Quellcode von Hand schreiben. Dies ist aber fast immer sehr umständlich und zeitaufwändig.</p>
<p>Deshalb haben Software-Programmierer Werkzeuge entwickelt in denen man relativ einfach seinen Text schreiben kann und über spezielle Buttons dann nach seinen Wünschen formatieren. Die Software übernimmt dann die Formatierung. Das macht das Arbeiten mit HTML-Quellcode recht simple. Trotzdem sollte man immer wissen was man tut. Schließlich herrschen im Internet ein paar andere Regeln als im alt geliebten Druck.</p>
<h3 class="western">FCKeditor</h3>
<p>Ich habe mich bei <strong>REDcms</strong> für den FCKeditor entschieden. Er ist sehr einfach an die speziellen Bedürfnisse anzupassen, bietet aber trotzdem einen sehr großen Funktionsumfang.</p>
<p>Der Editor wurde mit JavaScript umgesetzt und ersetzt ein Eingabefeld durch den im iframe befindlichen Editor. Das Einbinden kann über verschiedene Sprachen geschehen. In meinem Fall ist das PHP 5. Die Syntax zum Einbinden des Editors bzw. die Verwendung der „Editor“-Klasse sieht dann wie folgt aus:</p>
<ol class="Sourcecode">
<li> <span style="color: #660000;"><span style="font-family: Courier New,monospace;">$teaser </span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">= </span></span><span style="color: #0000ff;"><span style="font-family: Courier New,monospace;">new </span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">FCKeditor(</span></span><span style="color: #008200;"><span style="font-family: Courier New,monospace;">&#8216;teaser&#8217;</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">);</span></span></li>
<li> <span style="color: #660000;"><span style="font-family: Courier New,monospace;">$teaser</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">-&gt;Value 	= </span></span><span style="color: #008200;"><span style="font-family: Courier New,monospace;">&#8216;&lt;p&gt;Anzuzeigender 	Text&lt;/p&gt;&#8217;</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">;</span></span></li>
<li> <span style="color: #660000;"><span style="font-family: Courier New,monospace;">$teaser</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">-&gt;Create(); </span></span></li>
</ol>
<p>Der übergebene Parameter beim Instanziieren der „Editor“-Klasse ist die ID des „textarea“-Tags der ersetzt werden soll. Um den Editor an den Browser zu senden kann man benutzen. In meinem Fall benutze ich die „CreateHTML()“-Methode der „Editor“-Klasse, um sie individuell in mein System einzusetzen.</p>
<h3 class="western">Konfiguration</h3>
<p>Die Konfiguration des Editors ist recht simple, da fast alle wichtigen Einstellungen schon vorgegeben sind. Da ich aber in meinem Fall ein paar Änderungen bzw. Anpassung vornehmen wollte, habe ich die „FCKeditor“-Klasse mit meiner „Editor“-Klasse erweitert.</p>
<p>Der Editor geht als erstes davon aus im Stammverzeichnis der Domain abgespeichert zu sein. Da ich mein System aber flexibel halten wollte, habe ich die „BasePath“-Eigenschaft angepasst. Auch habe ich die „ToolbarSet“-Eigenschaft auf „REDcms“ geändert. So kann ich in der Konfigurationsdatei des Editors meine eigenen Menüleisten erstellen. Auch empfand ich die Höhe des Eingabebereiches als zu klein, weswegen ich die „Height“-Eigenschaft auf 400 Pixel gesetzt habe. Zum Schluss passte ich die Konfiguration selbst mit 3 Einstellungen noch ein wenig an. Als erstes habe ich den Pfad zur Konfigurationsdatei geändert. Dann die Spracheinstellung auf deutsch geändert und zum Schluss die Verwendung des „LinkBrowsers“ aktiviert.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">class </span><span style="color: #000000;">Editor </span><span style="color: #0000ff;">extends </span><span style="color: #000000;">FCKeditor</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">function </span><span style="color: #000000;">__construct( </span><span style="color: #660000;">$instanceName </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">parent</span><span style="color: #000000;">::__construct( </span><span style="color: #660000;">$instanceName </span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;BasePath 	= BASEURL.</span><span style="color: #008200;">&#8216;/fckeditor/&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;ToolbarSet 	= </span><span style="color: #008200;">&#8216;REDcms&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Config[</span><span style="color: #008200;">"CustomConfigurationsPath"</span><span style="color: #000000;">] 	= BASEURL.</span><span style="color: #008200;">&#8220;/templates/scripts/myEditorConfig.js&#8221;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Config[</span><span style="color: #008200;">'DefaultLanguage'</span><span style="color: #000000;">] 	= </span><span style="color: #008200;">&#8216;de&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Height 	= </span><span style="color: #ff0000;">400</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Config[</span><span style="color: #008200;">'LinkBrowser'</span><span style="color: #000000;">] 	= </span><span style="color: #0000ff;">true</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">function </span><span style="color: #000000;">__destruct(){}</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<h3 class="western">myEditorConfing.js</h3>
<p>Alle weiteren Einstellungen für die Inbetriebnahme des Editors habe ich dann in die „myEditorConfig.js“-Datei ausgelagert. So kann auch später noch relativ schnell Anpassungen vorgenommen werden.</p>
<p>Als erstes habe ich, wie oben schon beschrieben, meine neuen Menüleisten konfiguriert.</p>
<ol class="Sourcecode">
<li>
<p style="margin-bottom: 0cm;"><span style="font-family: Courier New,monospace;"><span style="color: #000000;">FCKConfig.ToolbarSets[</span><span style="color: #2a00ff;">"REDcms"</span><span style="color: #000000;">] 	= [</span></span></p>
</li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'Source'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'-'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Templates'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'Cut'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Copy'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Paste'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'PasteText'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'PasteWord'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'-'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'SpellCheck'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'Undo'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Redo'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'-'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Find'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Replace'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'-'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'SelectAll'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'RemoveFormat'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #2a00ff;">&#8216;/&#8217;</span><span style="color: #000000;">,</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'Bold'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Italic'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Underline'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'StrikeThrough'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'-'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Subscript'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Superscript'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'OrderedList'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'UnorderedList'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'-'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Outdent'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Indent'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Blockquote'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'JustifyLeft'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'JustifyCenter'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'JustifyRight'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'JustifyFull'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'Link'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Unlink'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Anchor'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'Image'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Flash'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Table'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Rule'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'Smiley'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'SpecialChar'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'PageBreak'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #2a00ff;">&#8216;/&#8217;</span><span style="color: #000000;">,</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'Style'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'FontFormat'</span><span style="color: #000000;">],</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> [</span><span style="color: #2a00ff;">'FitWindow'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'ShowBlocks'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'-'</span><span style="color: #000000;">,</span><span style="color: #2a00ff;">'About'</span><span style="color: #000000;">] </span><span style="color: #3f7f5f;">// 	No comma for the last row.</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">] 	;</span></span></li>
</ol>
<p>Als nächstes habe ich die URLs des „LinkBrowser“ angepasst. Damit habe ich die Möglichkeit Links auf Dateien, wie z.B. Bilder, Flash-Dateien oder ähnliches, schnell und komfortabel zu regeln.</p>
<ol class="Sourcecode">
<li>
<p style="margin-bottom: 0cm;"><span style="font-family: Courier New,monospace;"><span style="color: #000000;">FCKConfig.LinkBrowserURL 	= </span><span style="color: #2a00ff;">&#8216;/REDcms/ckfinder/ckfinder.html&#8217;</span><span style="color: #000000;">;</span></span></p>
</li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;">FCKConfig.ImageBrowserURL 	= </span><span style="color: #2a00ff;">&#8216;/REDcms/ckfinder/ckfinder.html?type=Images&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;">FCKConfig.FlashBrowserURL 	= </span><span style="color: #2a00ff;">&#8216;/REDcms/ckfinder/ckfinder.html?type=Flash&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;">FCKConfig.LinkUploadURL 	= </span><span style="color: #2a00ff;">&#8216;/REDcms/ckfinder/core/connector/php/connector.php?command=QuickUpload&amp;type=Files&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;">FCKConfig.ImageUploadURL 	= </span><span style="color: #2a00ff;">&#8216;/REDcms/ckfinder/core/connector/php/connector.php?command=QuickUpload&amp;type=Images&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">FCKConfig.FlashUploadURL 	= </span></span><span style="color: #2a00ff;"><span style="font-family: Courier New,monospace;">&#8216;/REDcms/ckfinder/core/connector/php/connector.php?command=QuickUpload&amp;type=Flash&#8217;</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">;</span></span></li>
</ol>
<h3 class="western">CKfinder</h3>
<p>Um aber auch den „LinkBrowser“ benutzen zu können, habe ich die Erweiterung „CKfinder“ des FCKeditor mit in mein System installiert. Sie erweitert den Editor um die Möglichkeit komfortabel Dateien die verlinkt werden sollen, zu managen.  Die Erweiterung ist so eingestellt dass sie automatisch im Unterordner „userfiles“ des <strong>REDcms</strong>-System nach Dateien sucht. Auch hier gibt es eine Konfigurationsdatei „config.php“, aber die Anpassungen sind hier mit einer kleinen Änderung schnell erledigt. Geändert werden muss nämlich nur wieder einmal die „$baseUrl“.</p>
<ol class="Sourcecode">
<li><span style="color: #660000;"><span style="font-family: Courier New,monospace;">$baseUrl </span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">= </span></span><span style="color: #008200;"><span style="font-family: Courier New,monospace;">&#8216;/REDcms/userfiles/&#8217;</span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;">;</span></span></li>
</ol>
<p>Leider  konnte ich hier nicht mit meiner Konstanen „BASEURL“ arbeiten, da diese Datei separat aufgerufen wird und nicht direkt ins System eingebunden ist. Vielleicht werde ich später noch eine Routine dafür schreiben.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_12.zip">REDcms_12.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/" title="Tag 16 – Zusatzklassen">Tag 16 – Zusatzklassen</a></li><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/17/tag-17-wysiwyg-editor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tag 16 – Zusatzklassen</title>
		<link>http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/</link>
		<comments>http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 22:00:36 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=251</guid>
		<description><![CDATA[So bald habe wir es geschafft alle Klassen zu beschreiben. Es fehlen jetzt nur noch 2 Hilfsklassen. Auf der einen Seite ist das die „Date“-Klasse und auf der anderen die „Editor“-Klasse. Date Class Als erstes nun die „Date“-Klasse. Sie hat im gesamten System die wohl kleinste Rolle, denn sie managt die Konvertierung von einer internationalen [...]]]></description>
			<content:encoded><![CDATA[<p>So bald habe wir es geschafft alle Klassen zu beschreiben. Es fehlen jetzt nur noch 2 Hilfsklassen. Auf der einen Seite ist das die „<code>Date</code>“-Klasse und auf der anderen die „<code>Editor</code>“-Klasse.</p>
<h3 class="western">Date Class</h3>
<p>Als erstes nun die „<code>Date</code>“-Klasse. Sie hat im gesamten System die wohl kleinste Rolle, denn sie managt die Konvertierung von einer <a href="http://de.wikipedia.org/wiki/ISO_8601">internationalen Schreibweise der Zeit</a> (<code>YYYY-MM-DD HH:MM:SS +00:00</code>) in eine deutsche Schreibweise. Dabei unterscheide ich 2 verschiedene Ausgaben. Einmal ist das die Kurzschreibweise des Datums (<code>DD. MM. YYYY</code>) und dann noch die umfangreichere Schreibweise (<code>Tag. Monatsname Jahr</code>).</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">class </span><span style="color: #000000;">Date</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">static </span><span style="color: #660000;">$formatShort</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">static </span><span style="color: #660000;">$formatLong</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">static 	function </span><span style="color: #000000;">setShortFormat(</span><span style="color: #660000;">$format</span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::</span><span style="color: #660000;">$formatShort </span><span style="color: #000000;">= </span><span style="color: #660000;">$format</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">static 	function </span><span style="color: #000000;">setLongFormat(</span><span style="color: #660000;">$format</span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::</span><span style="color: #660000;">$formatLong </span><span style="color: #000000;">= </span><span style="color: #660000;">$format</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">static 	function </span><span style="color: #000000;">getShortFormat(</span><span style="color: #660000;">$date</span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$ts </span><span style="color: #000000;">= strtotime(</span><span style="color: #660000;">$date</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return </span><span style="color: #000000;">strftime(</span><span style="color: #0000ff;">self</span><span style="color: #000000;">::</span><span style="color: #660000;">$formatShort</span><span style="color: #000000;">, </span><span style="color: #660000;">$ts</span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">static 	function </span><span style="color: #000000;">getLongFormat(</span><span style="color: #660000;">$date</span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$ts </span><span style="color: #000000;">= strtotime(</span><span style="color: #660000;">$date</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return </span><span style="color: #000000;">strftime(</span><span style="color: #0000ff;">self</span><span style="color: #000000;">::</span><span style="color: #660000;">$formatLong</span><span style="color: #000000;">, </span><span style="color: #660000;">$ts</span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Um die Darstellung des Formates schnell ändern zu können wird diese in der <a href="http://www.re-design.de/workbook/?p=224">Konfiguration</a> abgespeichert und kann dadurch jeder Zeit geändert werden.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;">[Application]</span></li>
<li> <span style="font-family: Courier New,monospace;">dateformatlong	= 	&#8220;%d. %B %Y&#8221;</span></li>
<li> <span style="font-family: Courier New,monospace;">dateformatshort 	= &#8220;%d. %m. %Y&#8221;</span></li>
</ol>
<p>Ich habe mich bewusst hier für statische Methoden entschieden, um schneller auf die Konvertierungen zuzugreifen. So bekomme ich mit dem Befehl „<code>Date::getLongFormat()</code>“ und dem übergebenen Zeitstempel direkt die deutsche Schreibweise.</p>
<h3 class="western">Editor Class</h3>
<p>Um die Texte online besser editieren zu können habe ich mich für <a href="http://www.fckeditor.net/">FCKeditor</a> als <a href="http://de.wikipedia.org/wiki/WYSIWYG">WYSIWYG</a>-Editor, also als Online-Editor entschieden. Dadurch wird den Redakteuren die Arbeit mit <strong>REDcms</strong> erleichtert. Wobei man nicht vergessen darf dass es nur ein Hilfsmittel ist. Die Kenntnisse über HTML wird trotzdem vorausgesetzt.</p>
<p>In der „<code>Editor</code>“-Klasse, die die „<code>FCKeditor</code>“-Klasse des Online-Editors erweitert, wird nur während der Instanziierung verschiedene Einstellungen schon mal mit geladen. Wie z.B. wo der Editor gespeichert ist, wo die Konfiguration zu finden ist, bzw. welche Sprache der Editor benutzen soll.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">class </span><span style="color: #000000;">Editor </span><span style="color: #0000ff;">extends </span><span style="color: #000000;">FCKeditor</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">function </span><span style="color: #000000;">__construct( </span><span style="color: #660000;">$instanceName </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">parent</span><span style="color: #000000;">::__construct( </span><span style="color: #660000;">$instanceName </span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;BasePath 	= BASEURL.</span><span style="color: #008200;">&#8216;/fckeditor/&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;ToolbarSet 	= </span><span style="color: #008200;">&#8216;REDcms&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Config[</span><span style="color: #008200;">"CustomConfigurationsPath"</span><span style="color: #000000;">] 	= BASEURL.</span><span style="color: #008200;">&#8220;/templates/scripts/myEditorConfig.js&#8221;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Config[</span><span style="color: #008200;">'DefaultLanguage'</span><span style="color: #000000;">] 	= </span><span style="color: #008200;">&#8216;de&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Height 	= </span><span style="color: #ff0000;">400</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;Config[</span><span style="color: #008200;">'LinkBrowser'</span><span style="color: #000000;">] 	= </span><span style="color: #0000ff;">true</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">function </span><span style="color: #000000;">__destruct(){}</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<h3 class="western">Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_11.zip">REDcms_11.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/17/tag-17-wysiwyg-editor/" title="Tag 17 – WYSIWYG-Editor">Tag 17 – WYSIWYG-Editor</a></li><li><a href="http://www.re-design.de/2008/12/15/tag-15-login-class/" title="Tag 15 – Login Class">Tag 15 – Login Class</a></li><li><a href="http://www.re-design.de/2008/12/14/tag-14-template-class/" title="Tag 14 – Template Class">Tag 14 – Template Class</a></li><li><a href="http://www.re-design.de/2008/12/13/tag-13-content-class/" title="Tag 13 – Content Class">Tag 13 – Content Class</a></li><li><a href="http://www.re-design.de/2008/12/10/tag-10-request-class/" title="Tag 10 – Request Class">Tag 10 – Request Class</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 15 – Login Class</title>
		<link>http://www.re-design.de/2008/12/15/tag-15-login-class/</link>
		<comments>http://www.re-design.de/2008/12/15/tag-15-login-class/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 22:00:51 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=246</guid>
		<description><![CDATA[Nachdem ich gestern wiedermal eine sehr umfangreiche Klasse beschrieben habe, heute nun wieder etwas einfacheres – die „Login“-Klasse. Sie regelt das An- und Abmelden am System. Um die angemeldeten User verwalten zu können, nutze ich Sessions. Deshalb wird im Konstruktor mit der „session_start()“-Funktion eine Verbindung zur Session aufgebaut. function __construct() { session_start(); } Nach einer [...]]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich gestern wiedermal eine sehr umfangreiche Klasse beschrieben habe, heute nun wieder etwas einfacheres – die „Login“-Klasse.</p>
<p>Sie regelt das An- und Abmelden am System. Um die angemeldeten User verwalten zu können, nutze ich Sessions. Deshalb wird im Konstruktor mit der „session_start()“-Funktion eine Verbindung zur Session aufgebaut.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">function </span><span style="color: #000000;">__construct()</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> session_start();</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Nach einer erfolgreichen Anmeldung z.B. werden in einer Session-Variablen „$_SESSION['REDcms']“ die Werte des Benutzers abgespeichert. Das geschieht in der  „checkLogin()“-Methode. Sie prüft ob innerhalb der globalen Variablen „$_POST“ die korrekten Angaben sich befinden, die in der Klasse selbst abgespeichert sind.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">checkLogin()</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #660000;">$_POST</span><span style="color: #000000;">[</span><span style="color: #008200;">'user'</span><span style="color: #000000;">] 	== </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::</span><span style="color: #660000;">$user </span><span style="color: #000000;">&amp;&amp; </span><span style="color: #660000;">$_POST</span><span style="color: #000000;">[</span><span style="color: #008200;">'password'</span><span style="color: #000000;">] 	== </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::</span><span style="color: #660000;">$password</span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">] 	= </span><span style="color: #0000ff;">array</span><span style="color: #000000;">();</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">][</span><span style="color: #008200;">'user'</span><span style="color: #000000;">] 	= </span><span style="color: #660000;">$_POST</span><span style="color: #000000;">[</span><span style="color: #008200;">'user'</span><span style="color: #000000;">];</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">][</span><span style="color: #008200;">'access'</span><span style="color: #000000;">] 	= </span><span style="color: #ff0000;">0</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> header(</span><span style="color: #008200;">&#8216;Location: 	&#8216;</span><span style="color: #000000;">.</span><span style="color: #660000;">$_POST</span><span style="color: #000000;">[</span><span style="color: #008200;">'request'</span><span style="color: #000000;">]);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">exit</span><span style="color: #000000;">();</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Natürlich gibt es auch die „logout()“-Methode, die die gespeicherten Werte aus der Session wieder löscht.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">logout()</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">] 	= </span><span style="color: #0000ff;">array</span><span style="color: #000000;">();</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">unset</span><span style="color: #000000;">(</span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">]);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> header(</span><span style="color: #008200;">&#8216;Location: 	&#8216;</span><span style="color: #000000;">.</span><span style="color: #660000;">$_POST</span><span style="color: #000000;">[</span><span style="color: #008200;">'request'</span><span style="color: #000000;">]);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">exit</span><span style="color: #000000;">();</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>So kann über die „isLogged()“-Methode relativ einfach überprüft werden ob der Benutzer angemeldet ist oder nicht. Das ist besonders bei den Verarbeitungsmethoden der „Page“-, „Box“- und „Menu“-Klasse wichtig.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">isLogged()</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">]) 	&amp;&amp; </span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">][</span><span style="color: #008200;">'user'</span><span style="color: #000000;">] 	== </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::</span><span style="color: #660000;">$user</span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return 	true</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return 	false</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Als letztes gibt es noch die „getAdminBox()“-Methode. Sie hat die Aufgabe bei nicht angemeldeten Benutzern das Anmelde-Formular, bzw. bei angemeldeten Benutzern eine zusätzliches Menü anzuzeigen.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">getAdminBox()</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$content </span><span style="color: #000000;">= </span><span style="color: #008200;">&#8216;&lt;h4&gt;Administration&lt;/h4&gt;&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl </span><span style="color: #000000;">= </span><span style="color: #0000ff;">new </span><span style="color: #000000;">Template(TEMPLATEPATH);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #0000ff;">empty</span><span style="color: #000000;">(</span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">]))</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;load(</span><span style="color: #008200;">&#8216;login.tpl.html&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##URL##&#8217;</span><span style="color: #000000;">,		BASEURL.</span><span style="color: #008200;">&#8216;/login.php&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">else</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;"> </span><span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;load(</span><span style="color: #008200;">&#8216;logout.tpl.html&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##URL##&#8217;</span><span style="color: #000000;">,		BASEURL.</span><span style="color: #008200;">&#8216;/logout.php&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##URLPAGE##&#8217;</span><span style="color: #000000;">,	BASEURL.</span><span style="color: #008200;">&#8216;/page/0/add&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##URLBOX##&#8217;</span><span style="color: #000000;">,		BASEURL.</span><span style="color: #008200;">&#8216;/box/0/add&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##URLMENU##&#8217;</span><span style="color: #000000;">,	BASEURL.</span><span style="color: #008200;">&#8216;/menu/0/add&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##USERNAME##&#8217;</span><span style="color: #000000;">, </span><span style="color: #660000;">$_SESSION</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDcms'</span><span style="color: #000000;">][</span><span style="color: #008200;">'user'</span><span style="color: #000000;">]);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #660000;">$_SERVER</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDIRECT_URI'</span><span style="color: #000000;">]))</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##REQUEST##&#8217;</span><span style="color: #000000;">, </span><span style="color: #660000;">$_SERVER</span><span style="color: #000000;">[</span><span style="color: #008200;">'REDIRECT_URL'</span><span style="color: #000000;">]);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">else</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;"> </span><span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##REQUEST##&#8217;</span><span style="color: #000000;">,	BASEURL);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$content </span><span style="color: #000000;">.= </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;get();</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return </span><span style="color: #660000;">$content</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Um die An- und Abmeldung relativ einfach zu machen, habe ich für jeden Prozess eine eigene PHP-Seite erstellt. Der Inhalt dieser Dateien ist sehr überschaubar.</p>
<ol class="Sourcecode">
<li> <span style="color: #ff0000;"><span style="font-family: Courier New,monospace;">&lt;?php</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">error_reporting(E_ALL 	| E_WARNING);</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">require_once </span><span style="color: #008200;">&#8216;includes.php&#8217;</span><span style="color: #000000;">;</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$login </span><span style="color: #000000;">= </span><span style="color: #0000ff;">new </span><span style="color: #000000;">Login();</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$login</span><span style="color: #000000;">-&gt;checkLogin();</span></span></li>
<li> <span style="color: #ff0000;"><span style="font-family: Courier New,monospace;">?&gt;</span></span></li>
</ol>
<ol class="Sourcecode">
<li> <span style="color: #ff0000;"><span style="font-family: Courier New,monospace;">&lt;?php</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">error_reporting(E_ALL 	| E_WARNING);</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">require_once </span><span style="color: #008200;">&#8216;includes.php&#8217;</span><span style="color: #000000;">;</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$login </span><span style="color: #000000;">= </span><span style="color: #0000ff;">new </span><span style="color: #000000;">Login();</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$login</span><span style="color: #000000;">-&gt;logout();</span></span></li>
<li> <span style="color: #ff0000;"><span style="font-family: Courier New,monospace;">?&gt;</span></span></li>
</ol>
<p>Zu einem späteren Zeitpunkt werde ich wahrscheinlich diese separaten Dateien mit in die „index.php“-Datei integrieren.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_10.zip">REDcms_10.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/" title="Tag 16 – Zusatzklassen">Tag 16 – Zusatzklassen</a></li><li><a href="http://www.re-design.de/2008/12/14/tag-14-template-class/" title="Tag 14 – Template Class">Tag 14 – Template Class</a></li><li><a href="http://www.re-design.de/2008/12/13/tag-13-content-class/" title="Tag 13 – Content Class">Tag 13 – Content Class</a></li><li><a href="http://www.re-design.de/2008/12/10/tag-10-request-class/" title="Tag 10 – Request Class">Tag 10 – Request Class</a></li><li><a href="http://www.re-design.de/2008/12/09/tag-9-application-class/" title="Tag 9 – Application Class">Tag 9 – Application Class</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/15/tag-15-login-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 14 – Template Class</title>
		<link>http://www.re-design.de/2008/12/14/tag-14-template-class/</link>
		<comments>http://www.re-design.de/2008/12/14/tag-14-template-class/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 22:00:38 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[redcms]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=241</guid>
		<description><![CDATA[Schon seid vielen Jahren benutzte ich diese Klasse. Immer wenn ich ein kleines Template-System brauche setze ich auf diese Klasse. Die Funktionsweise meiner Klasse ist dabei recht einfach. Als erstes wird im Konstruktor festgelegt wo die Vorlagen zu finden sind, dazu wird ihn der Pfad mit übergeben. Zusätzlich wird die „value“-Eigenschaft mit einem leeren Array [...]]]></description>
			<content:encoded><![CDATA[<p>Schon seid vielen Jahren benutzte ich diese Klasse. Immer wenn ich ein kleines Template-System brauche setze ich auf diese Klasse. Die Funktionsweise meiner Klasse ist dabei recht einfach.</p>
<p>Als erstes wird im Konstruktor festgelegt wo die Vorlagen zu finden sind, dazu wird ihn der Pfad mit übergeben. Zusätzlich wird die „<code>value</code>“-Eigenschaft mit einem leeren Array vorbereitet.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">__construct( </span><span style="color: #660000;">$path </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;path 	= </span><span style="color: #660000;">$path</span><span style="color: #000000;">.</span><span style="color: #008200;">&#8216;/&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;values 	= </span><span style="color: #0000ff;">array</span><span style="color: #000000;">();</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Um aber auch eine konkrete Vorlage zu laden, gibt es in der „<code>Template</code>“-Klasse die „<code>load()</code>“-Methode. Ihr wird der Dateiname übergeben. Die geladene Datei wird als String in die „source“-Eigenschaft abgelegt. Zusätzlich wird die <code>„reload()</code>“-Methode aufgerufen.</p>
<ol class="Sourcecode">
<li>
<p style="margin-bottom: 0cm;" align="justify"><span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">load( </span><span style="color: #660000;">$file </span><span style="color: #000000;">)</span></span></p>
</li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;source 	= file_get_contents( </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;path.</span><span style="color: #660000;">$file </span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;reload();</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Sie kopiert den geladene String in die „<code>template</code>“-Eigenschaft. So muss nicht beim wiederholten Aufrufen der gleichen Vorlage immer wieder erst die Datei von der Festplatte geladen werden.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">reload()</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;template 	= </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;source;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Über die „<code>set()</code>“-Methode werden die Werte mit ihren Schlüsselworten in die Klasse geladen. Dabei werden 2 Parameter erwartet: der Schlüssel mit folgender Schreibweise „<code>##SCHLÜSSELNAME##</code>“ (Name in Großbuchstaben) und optional ein Wert.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">set( </span><span style="color: #660000;">$key</span><span style="color: #000000;">, </span><span style="color: #660000;">$value</span><span style="color: #000000;">=</span><span style="color: #008200;">&#8221; </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;values[</span><span style="color: #660000;">$key</span><span style="color: #000000;">] 	= </span><span style="color: #660000;">$value</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Neben der „<code>set()</code>“-Methode gibt es natürlich auch die „<code>get()</code>“-Methode. Sie hat als Aufgabe aus dem  Template einen brauchbare Quellcode für den Browser zu generieren. Dabei prüft sie als erstes ob überhaupt das Template schon geladen wurde. Danach ruft sie die „<code>parse()</code>“-Methode auf, um das Template mit den Werten zu verarbeiten. Falls der Methode über der „<code>sourcecode</code>“-Parameter der statische Wert <code>Template::DISPLAY_CODE</code> mitgegeben wurde, wird die Ausgabe in lesbaren HTML-Code konvertiert.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">get( </span><span style="color: #660000;">$sourcecode</span><span style="color: #000000;">=</span><span style="color: #0000ff;">true </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">( </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;source==null 	|| </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;source==</span><span style="color: #008200;">&#8221; </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return </span><span style="color: #000000;">null;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;parse();</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">( 	!</span><span style="color: #660000;">$sourcecode </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$out </span><span style="color: #000000;">= </span><span style="color: #008200;">&#8216;&lt;pre&gt;&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$out </span><span style="color: #000000;">.= htmlentities( </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;template 	);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$out </span><span style="color: #000000;">.= </span><span style="color: #008200;">&#8216;&lt;/prev&gt;&#8217;</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">else </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;"> </span><span style="color: #000000;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$out </span><span style="color: #000000;">= </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;template;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return </span><span style="color: #660000;">$out</span><span style="color: #000000;">;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Die „<code>parse()</code>“-Methode hat nun die Aufgabe die Schlüsselworte innerhalb der Vorlage durch die Werte innerhalb der „<code>values</code>“-Eigenschaft zu ersetzen. Dabei prüft sie als erstes ob überhaupt das Template schon geladen ist. Danach ersetzt sie alle Werte. Zum Schluss werden noch alle nicht ersetzten Schlüsselworte in der Vorlage gelöscht, um unschöne Darstellungen zu vermeiden.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">private 	function </span><span style="color: #000000;">parse()</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">( </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;source 	== null || </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;source==</span><span style="color: #008200;">&#8221; </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">die</span><span style="color: #000000;">(</span><span style="color: #008200;">&#8216;TPL-Error: 	file not loaded!&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">foreach </span><span style="color: #000000;">( </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;values </span><span style="color: #0000ff;">as </span><span style="color: #660000;">$key </span><span style="color: #000000;">=&gt; </span><span style="color: #660000;">$value </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> {</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;template 	= str_replace( </span><span style="color: #660000;">$key</span><span style="color: #000000;">, </span><span style="color: #660000;">$value</span><span style="color: #000000;">, </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;template 	);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;template 	= ereg_replace( </span><span style="color: #008200;">&#8216;##[A-Za-z0-9_]+##&#8217;</span><span style="color: #000000;">, </span><span style="color: #008200;">&#8221;</span><span style="color: #000000;">, </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;template);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Als letzte Methode innerhalb der „<code>Template</code>“-Klasse gibt es noch die „<code>write()</code>“-Methode. Sie macht im Grunde genau das was die „<code>get()</code>“-Methode auch macht, nur gibt sie das Ergebnis direkt an den Browser weiter.</p>
<ol class="Sourcecode">
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">write( </span><span style="color: #660000;">$sourcecode</span><span style="color: #000000;">=</span><span style="color: #0000ff;">true </span><span style="color: #000000;">)</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">echo </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;get( </span><span style="color: #660000;">$sourcecode </span><span style="color: #000000;">);</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Wie schon eingangs erklärt, ist diese Klasse eine meiner ersten Klassen die ich konstant in meinen Projekten einsetze. Die Verwendung ist dabei sehr einfach. Als erstes erstellt man eine Vorlagendatei mit folgenden exemplarischen Quellcode:</p>
<ol class="Sourcecode">
<li> <span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;!</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">DOCTYPE</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">html</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #808080;"><span style="font-family: Courier New,monospace;">PUBLIC</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&#8220;-//W3C//DTD 	XHTML 1.0 Transitional//EN&#8221;</span></span><span style="font-family: Courier New,monospace;"> </span><span style="color: #3f7f5f;"><span style="font-family: Courier New,monospace;">&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">html</span> <span style="color: #7f007f;">xmlns</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://www.w3.org/1999/xhtml&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">head</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">meta</span> <span style="color: #7f007f;">http-equiv</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;Content-Type&#8221;</em></span> <span style="color: #7f007f;">content</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;text/html; 	charset=utf-8&#8243;</em></span> <span style="color: #008080;">/&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">title</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##TITLEBAR##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">title</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">head</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">body</span> <span style="color: #7f007f;">lang</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;de&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;page&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;branding&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">h1</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##WEBSITETITLE##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">h1</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">h2</span><span style="color: #008080;">&gt;</span><span style="color: #000000;">##TAGLINE##</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">h2</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;main&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;content&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##CONTENT##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;sidebar&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="color: #000000;"><span style="font-family: Courier New,monospace;"> ##SIDEBAR##</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">div</span> <span style="color: #7f007f;">id</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;copyright&#8221;</em></span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">p</span><span style="color: #008080;">&gt;</span><span style="color: #2a00ff;">&amp;copy;</span><span style="color: #000000;"> 2008 </span><span style="color: #2a00ff;">&amp;ndash;</span><span style="color: #000000;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">a</span> <span style="color: #7f007f;">href</span><span style="color: #000000;">=</span><span style="color: #2a00ff;"><em>&#8220;http://www.re-design.de&#8221;</em></span><span style="color: #008080;">&gt;</span><span style="color: #000000;">RE-Design</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">a</span><span style="color: #008080;">&gt;&lt;/</span><span style="color: #3f7f7f;">p</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">div</span><span style="color: #008080;">&gt;</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">body</span><span style="color: #008080;">&gt;</span></span></li>
<li>
<p style="margin-bottom: 0cm;"><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&lt;/</span></span><span style="color: #3f7f7f;"><span style="font-family: Courier New,monospace;">html</span></span><span style="color: #008080;"><span style="font-family: Courier New,monospace;">&gt;</span></span></p>
</li>
</ol>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;">Um diese Vorlage verwenden zu können muss man in PHP nur folgendes schreiben:</p>
<p style="margin-bottom: 0cm;">
<ol class="Sourcecode">
<li>
<p style="margin-bottom: 0cm;"><span style="color: #ff0000;"><span style="font-family: Courier New,monospace;">&lt;?php</span></span></p>
</li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">include_once </span><span style="color: #008200;">&#8216;core/Template.php&#8217;</span><span style="color: #000000;">;</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$tpl </span><span style="color: #000000;">= </span><span style="color: #0000ff;">new </span><span style="color: #000000;">Template(</span><span style="color: #660000;">&#8216;./templates/layouts&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;load(</span><span style="color: #008200;">&#8216;index.tpl.html&#8217;</span><span style="color: #000000;">);</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##TITLEBAR##&#8217;</span><span style="color: #000000;">, </span><span style="color: #008200;">&#8216;RE-Design 	- Beispiel-Template-Code&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##WEBSITETITLE##&#8217;</span><span style="color: #000000;">, </span><span style="color: #008200;">&#8216;RE-Design&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##TAGLINE##&#8217;</span><span style="color: #000000;">, </span><span style="color: #008200;">&#8216;Template-Klassen-Beispiel&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##CONTENT##&#8217;</span><span style="color: #000000;">, </span><span style="color: #008200;">&#8216;&lt;p&gt;Lorem 	ipsum dolor sit amet, &#8230; et netus et malesuada fames ac turpis 	egestas.&lt;/p&gt;&#8217;</span><span style="color: #000000;">);</span></span></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;set(</span><span style="color: #008200;">&#8216;##SIDEBAR##&#8217;</span><span style="color: #000000;">, </span><span style="color: #008200;">&#8216;&lt;div 	class=&#8221;box&#8221;&gt;&lt;h2&gt;Autor&lt;/h2&gt;&lt;p&gt;Enrico 	Reinsdorf&lt;/p&gt;&lt;/div&gt;&#8217;</span><span style="color: #000000;">);</span></span></li>
<li></li>
<li> <span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">echo </span><span style="color: #660000;">$tpl</span><span style="color: #000000;">-&gt;get(Template::DISPLAY_HTML);</span></span></li>
<li> <span style="color: #ff0000;"><span style="font-family: Courier New,monospace;">?&gt;</span></span></li>
</ol>
<p style="margin-bottom: 0cm;">
<h3 class="western">Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_09.zip">REDcms_09.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/" title="Tag 16 – Zusatzklassen">Tag 16 – Zusatzklassen</a></li><li><a href="http://www.re-design.de/2008/12/15/tag-15-login-class/" title="Tag 15 – Login Class">Tag 15 – Login Class</a></li><li><a href="http://www.re-design.de/2008/12/13/tag-13-content-class/" title="Tag 13 – Content Class">Tag 13 – Content Class</a></li><li><a href="http://www.re-design.de/2008/12/10/tag-10-request-class/" title="Tag 10 – Request Class">Tag 10 – Request Class</a></li><li><a href="http://www.re-design.de/2008/12/09/tag-9-application-class/" title="Tag 9 – Application Class">Tag 9 – Application Class</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/14/tag-14-template-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tag 13 – Content Class</title>
		<link>http://www.re-design.de/2008/12/13/tag-13-content-class/</link>
		<comments>http://www.re-design.de/2008/12/13/tag-13-content-class/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 22:00:19 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=236</guid>
		<description><![CDATA[Ähnliche BeiträgeTag 16 – ZusatzklassenTag 15 – Login ClassTag 14 – Template ClassTag 10 – Request ClassTag 9 – Application Class]]></description>
			<content:encoded><![CDATA[Ähnliche BeiträgeTag 16 – ZusatzklassenTag 15 – Login ClassTag 14 – Template ClassTag 10 – Request ClassTag 9 – Application Class]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/13/tag-13-content-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tag 12 – Database Class</title>
		<link>http://www.re-design.de/2008/12/12/tag-12-database-class/</link>
		<comments>http://www.re-design.de/2008/12/12/tag-12-database-class/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 22:00:15 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[datenbank]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=232</guid>
		<description><![CDATA[Dies wird heute ein sehr kurzer Beitrag, denn ich habe nicht wirklich eine eigene „Database“-Klasse geschrieben. Vielmehr habe ich auf die „DB“-Klasse des PEAR-Frameworks zurückgegriffen, da dieses Framework mittlerweile in fast jeder installiert hat. require_once (&#8216;DB.php&#8217;); class Database extends DB { } Wichtig aus dieser Klasse ist einmal die „connect()“-Methode, die als ersten Parameter die [...]]]></description>
			<content:encoded><![CDATA[<p>Dies wird heute ein sehr kurzer Beitrag, denn ich habe nicht wirklich eine eigene „Database“-Klasse geschrieben. Vielmehr habe ich auf die <a href="http://pear.php.net/manual/de/package.database.php">„DB“-Klasse</a> des <a href="http://pear.php.net/">PEAR-Frameworks</a> zurückgegriffen, da dieses Framework mittlerweile in fast jeder installiert hat.</p>
<ol>
<li><span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">require_once </span><span style="color: #000000;">(</span><span style="color: #008200;">&#8216;DB.php&#8217;</span><span style="color: #000000;">);</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">class </span><span style="color: #000000;">Database </span><span style="color: #0000ff;">extends </span><span style="color: #000000;">DB</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Wichtig aus dieser Klasse ist einmal die „<code>connect()</code>“-Methode, die als ersten Parameter die Verbindungsangaben für die Datenbank als String erfordert. Der Rückgabewert dieser Methode ist dann das Datenbank-Objekt.</p>
<p>Mit diesem Objekt können dann alle SQL-Anfragen abgewickelt werden. Hier kein kleines Beispiel :</p>
<ol>
<li><span style="color: #660000;"><span style="font-family: Courier New,monospace;">$query </span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;"><span style="font-size: x-small;">= </span></span></span><span style="color: #008200;"><span style="font-family: Courier New,monospace;"><span style="font-size: x-small;">&#8216;SELECT 	* FROM page&#8217;</span></span></span><span style="color: #000000;"><span style="font-family: Courier New,monospace;"><span style="font-size: x-small;">;</span></span> </span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #660000;">$res </span><span style="color: #000000;">=&amp; </span><span style="color: #660000;">$</span><span style="color: #000000;">db-&gt;query(</span><span style="color: #660000;">$query</span><span style="color: #000000;">);</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">if </span><span style="color: #000000;">(PEAR::isError(</span><span style="color: #660000;">$res</span><span style="color: #000000;">)) 	{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">die</span><span style="color: #000000;">(</span><span style="color: #660000;">$res</span><span style="color: #000000;">-&gt;getMessage());</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">while </span><span style="color: #000000;">(</span><span style="color: #660000;">$res</span><span style="color: #000000;">-&gt;fetchInto(</span><span style="color: #660000;">$page</span><span style="color: #000000;">))</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> array_push(</span><span style="color: #660000;">$pages</span><span style="color: #000000;">, </span><span style="color: #660000;">$page</span><span style="color: #000000;">);</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<h3 class="western">Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_07.zip">REDcms_07.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/07/tag-7-datenbankstruktur/" title="Tag 7 – Datenbankstruktur">Tag 7 – Datenbankstruktur</a></li><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/12/tag-12-database-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 11 – Configuration Class</title>
		<link>http://www.re-design.de/2008/12/11/tag-11-configuration-class/</link>
		<comments>http://www.re-design.de/2008/12/11/tag-11-configuration-class/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 22:00:39 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=224</guid>
		<description><![CDATA[Jedes System sollte eine einfache Möglichkeit besitzen konfiguriert zu werden. In den meisten Fällen gibt es eine Konfigurationsdatei – so auch bei mir. Allerdings habe ich mir überlegt, die Konfiguration nicht in eine PHP-Datei einzubetten, sondern in eine INI-Datei. So ist es schnell möglich diese einfache Textdatei anzupassen. Allerdings hat die Vorgehensweise auch Nachteile. Da [...]]]></description>
			<content:encoded><![CDATA[<p>Jedes System sollte eine einfache Möglichkeit besitzen konfiguriert zu werden. In den meisten Fällen gibt es eine Konfigurationsdatei – so auch bei mir. Allerdings habe ich mir überlegt, die Konfiguration nicht in eine PHP-Datei einzubetten, sondern in eine <a href="http://de.wikipedia.org/wiki/Initialisierungsdatei">INI-Datei</a>. So ist es schnell möglich diese einfache Textdatei anzupassen.</p>
<p>Allerdings hat die Vorgehensweise auch Nachteile. Da diese besondere Datei nicht vor fremden Augen geschützt ist, kann sie jeder leicht einsehen, der die URL kennt. Um das Ausliefern der Datei von Apache zu verhindern, habe ich die „<code>.htaccess</code>“-Datei angepasst.</p>
<ol>
<li><span style="font-family: Courier New,monospace;">&lt;Files ~ 	&#8220;.(ini)$&#8221;&gt;</span></li>
<li><span style="font-family: Courier New,monospace;">Order 	allow,deny</span></li>
<li><span style="font-family: Courier New,monospace;">Deny from all</span></li>
<li><span style="font-family: Courier New,monospace;">&lt;/Files&gt;</span></li>
</ol>
<p>Kommen wir jetzt zur Konfigurationsdatei. Sie ist in 3 wichtige Bereiche eingeteilt. Der erste Bereich enthält Angaben die für die Webapplikation wichtig sind. Hier ist es z.B. die beiden Datumsformate um eine Kurz- und Langschreibweise des Datums festzulegen.</p>
<ol>
<li><span style="font-family: Courier New,monospace;">[Application]</span></li>
<li><span style="font-family: Courier New,monospace;">dateformatlong	= 	&#8220;%d. %B %Y&#8221;</span></li>
<li><span style="font-family: Courier New,monospace;">dateformatshort	= 	&#8220;%d. %m. %Y&#8221;</span></li>
</ol>
<p>Im zweiten Bereich werden alle wichtigen Zugangsdaten für die Datenbank hinterlegt. In meinen Fall ist das die Serveradresse (<code>host</code>), der Benutzername (<code>user</code>), das dazugehörige Kennwort (<code>password</code>) und der Datanbank-Name (<code>db</code>)</p>
<ol>
<li><span style="font-family: Courier New,monospace;">[Database]</span></li>
<li><span style="font-family: Courier New,monospace;">host			= 	&#8220;localhost&#8221;</span></li>
<li><span style="font-family: Courier New,monospace;">user			= &#8220;demouser&#8221;</span></li>
<li><span style="font-family: Courier New,monospace;">password	= 	&#8220;password&#8221;</span></li>
<li><span style="font-family: Courier New,monospace;">db			= 	&#8220;redcms_advent&#8221;</span></li>
</ol>
<p>Im letzten Bereich werden Informationen abgespeichert, die für das Anzeigen der Website wichtig sind. Da ich zur Zeit nur den Website-Titel und die Tagline brauche, habe ich auch das dort hingeschrieben.</p>
<ol>
<li><span style="font-family: Courier New,monospace;">[Website]</span></li>
<li><span style="font-family: Courier New,monospace;">Title			= 	&#8220;RE-Design&#8221;</span></li>
<li><span style="font-family: Courier New,monospace;">Tagline	= 	&#8220;REDcms Advents&#8221;</span></li>
</ol>
<p>Was muss nun die „<code>Configuration</code>“-Klasse nun alles machen? Im Grunde genommen nur diese „INI“-Datei in einen zweidimensionalen Array laden und Methoden anbieten auf die Werte der Konfiguration zuzugreifen.</p>
<p>Das Laden der Konfigurationsdatei geschieht im Konstruktor. Mit der Methode „<code>getValue()</code>“ und ihrem 2 Parametern für die Sektion und dem Schüssel bekommt man den entsprechenden Wert zurück. Falls man statt einen einzelnen Wert die gesamte Sektion als Array bekommen möchte, so kann man mit der „<code>getSection()</code>“-Methode dies tun.</p>
<ol>
<li><span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">class </span><span style="color: #000000;">Configuration</span></span></li>
<li><span style="font-family: Courier New,monospace;">{</span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">public </span><span style="color: #660000;">$version </span><span style="color: #000000;">= </span><span style="color: #ff0000;">1.0</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">private </span><span style="color: #660000;">$file</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">private </span><span style="color: #660000;">$config</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">__construct(</span><span style="color: #660000;">$file</span><span style="color: #000000;">) 	{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;file 	= </span><span style="color: #660000;">$file</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">try </span><span style="color: #000000;">{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;config 	= parse_ini_file(</span><span style="color: #660000;">$file</span><span style="color: #000000;">, </span><span style="color: #0000ff;">true</span><span style="color: #000000;">);</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> } </span><span style="color: #0000ff;">catch </span><span style="color: #000000;">(Exception </span><span style="color: #660000;">$e</span><span style="color: #000000;">)</span></span></li>
<li><span style="font-family: Courier New,monospace;">&lt; {</span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">die</span><span style="color: #000000;">(</span><span style="color: #008200;">&#8216;Config-Error 	parseIni: &#8216;</span><span style="color: #000000;">.</span><span style="color: #660000;">$e</span><span style="color: #000000;">.</span><span style="color: #008200;">&#8216;: 	&#8216;</span><span style="color: #000000;">.</span><span style="color: #660000;">$file</span><span style="color: #000000;">);</span></span></li>
<li><span style="font-family: Courier New,monospace;"> }</span></li>
<li><span style="font-family: Courier New,monospace;"> }</span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">__destruct() {}</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">getValue(</span><span style="color: #660000;">$key</span><span style="color: #000000;">, </span><span style="color: #660000;">$section</span><span style="color: #000000;">) 	{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;config[</span><span style="color: #660000;">$section</span><span style="color: #000000;">][</span><span style="color: #660000;">$key</span><span style="color: #000000;">];</span></span></li>
<li><span style="font-family: Courier New,monospace;"> }</span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">public 	function </span><span style="color: #000000;">getSection(</span><span style="color: #660000;">$section</span><span style="color: #000000;">) 	{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">return </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;config[</span><span style="color: #660000;">$section</span><span style="color: #000000;">];</span></span></li>
<li><span style="font-family: Courier New,monospace;"> }</span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;">}</span></span></li>
</ol>
<p>Um die „<code>Configuration</code>“-Klasse nicht versehentlich mehrmals zu laden, könnte man sie innerhalb eines Updates als <a href="http://de.wikipedia.org/wiki/Singleton_(Entwurfsmuster)">Singelton-Pattern</a> anlegen und benutzen. Auch wäre später das Ändern von Konfigurationseinstellungen möglich, womit man dann schnell im Administrationsbereich das System anpassen könnte.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_06.zip">REDcms_06.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/11/tag-11-configuration-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tag 10 – Request Class</title>
		<link>http://www.re-design.de/2008/12/10/tag-10-request-class/</link>
		<comments>http://www.re-design.de/2008/12/10/tag-10-request-class/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 22:00:54 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=210</guid>
		<description><![CDATA[Gestern hatte ich sehr ausführlich über die „Application“-Klasse geschrieben. Heute möchte ich über den Inhalt der „Request“-Klassen meines REDcms schreiben. Die wichtigste Verarbeitung findet innerhalb des Konstruktors statt. Dem Konstruktor werden 2 Arrays als Parameter mit übergeben, wobei z.Z. nur der Erste wichtig ist. Es handelt sich hierbei um die „GET“-Werte der URL. Da ja [...]]]></description>
			<content:encoded><![CDATA[<p>Gestern hatte ich sehr ausführlich über die <a href="http://www.re-design.de/workbook/?p=208">„Application“-Klasse</a> geschrieben. Heute möchte ich über den Inhalt der „Request“-Klassen meines <strong>REDcms</strong> schreiben.</p>
<p>Die wichtigste Verarbeitung findet innerhalb des Konstruktors statt. Dem Konstruktor werden 2 Arrays als Parameter mit übergeben, wobei z.Z. nur der Erste wichtig ist. Es handelt sich hierbei um die „GET“-Werte der URL. Da ja per „<a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">mod_rewrite</a>“ und „<a href="http://httpd.apache.org/docs/2.2/howto/htaccess.html">.htaccess</a>“ Anhänge an die „index.php“-Datei gemacht werden.</p>
<p>Als erstes wird der Modus gesetzt, dabei kommen die 4 Klassenkonstanten <code>Request::MODE_PAGE</code>, <code>Request::MODE_BOX</code> und <code>Request::MODE_MENU</code> zum Einsatz.</p>
<p>Als nächstes wird die ID ausgelesen. Falls sie nicht vorhanden ist wird ihr Wert auf 1 gesetzt.</p>
<p>Zum Schluss wird versucht die Aktion aus dem „GET“-Wert zu ermitteln. Falls keiner vorhanden ist, wird standardmäßig die Aktion „show“ benutzt. Auch hier kommen wieder Klassenkonstanten zu Einsatz. Diesmal sind es aber 5 Stück: <code>Request::ACTION_ADD</code>, <code>Request::ACTION_EDIT</code>, <code>Request::ACTION_UPDATE</code>, <code>Request::ACTION_DELETE</code> und <code>Request::ACTION_SHOW</code>.</p>
<ol class="Sourcecode">
<li><span style="font-family: Courier New,monospace;"><span style="color: #0000ff;">function </span><span style="color: #000000;">__construct(</span><span style="color: #660000;">$get</span><span style="color: #000000;">, </span><span style="color: #660000;">$request</span><span style="color: #000000;">)</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">{</span></span></li>
<li><span style="font-family: Courier New,monospace;"> <span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;request = </span><span style="color: #660000;">$request</span><span style="color: #000000;">;</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if </span><span style="color: #000000;">(!</span><span style="color: #0000ff;">empty</span><span style="color: #000000;">(</span><span style="color: #660000;">$get</span><span style="color: #000000;">[</span><span style="color: #008200;">'mode'</span><span style="color: #000000;">])) {</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">switch </span><span style="color: #000000;">(</span><span style="color: #660000;">$get</span><span style="color: #000000;">[</span><span style="color: #008200;">'mode'</span><span style="color: #000000;">]) {</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">case self</span><span style="color: #000000;">::MODE_BOX:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;mode = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::MODE_BOX;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">case self</span><span style="color: #000000;">::MODE_MENU:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;mode = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::MODE_MENU;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">default</span><span style="color: #000000;">:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;mode = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::MODE_PAGE;</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> } </span><span style="color: #0000ff;">else </span><span style="color: #000000;">{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;mode = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::MODE_PAGE;</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if </span><span style="color: #000000;">(!</span><span style="color: #0000ff;">empty</span><span style="color: #000000;">(</span><span style="color: #660000;">$get</span><span style="color: #000000;">[</span><span style="color: #008200;">'id'</span><span style="color: #000000;">]) &amp;&amp; !is_nan(</span><span style="color: #660000;">$get</span><span style="color: #000000;">[</span><span style="color: #008200;">'id'</span><span style="color: #000000;">])) {</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;id = </span><span style="color: #660000;">$get</span><span style="color: #000000;">[</span><span style="color: #008200;">'id'</span><span style="color: #000000;">];</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> } </span><span style="color: #0000ff;">else </span><span style="color: #000000;">{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;id = </span><span style="color: #ff0000;">1</span><span style="color: #000000;">;</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;"> </span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(!</span><span style="color: #0000ff;">empty</span><span style="color: #000000;">(</span><span style="color: #660000;">$get</span><span style="color: #000000;">[</span><span style="color: #008200;">'action'</span><span style="color: #000000;">])){</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">switch </span><span style="color: #000000;">(</span><span style="color: #660000;">$get</span><span style="color: #000000;">[</span><span style="color: #008200;">'action'</span><span style="color: #000000;">]) {</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">case self</span><span style="color: #000000;">::ACTION_ADD:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;action = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::ACTION_ADD;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">case self</span><span style="color: #000000;">::ACTION_EDIT:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;action = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::ACTION_EDIT;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">case self</span><span style="color: #000000;">::ACTION_UPDATE:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;action = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::ACTION_UPDATE;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">case self</span><span style="color: #000000;">::ACTION_DELETE:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;action = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::ACTION_DELETE;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">break</span><span style="color: #000000;">;</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">case self</span><span style="color: #000000;">::ACTION_SHOW:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #0000ff;">default</span><span style="color: #000000;">:</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;action = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::ACTION_SHOW;</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> } </span><span style="color: #0000ff;">else </span><span style="color: #000000;">{</span></span></li>
<li><span style="font-family: Courier New,monospace;"><span style="color: #000000;"> </span><span style="color: #660000;">$this</span><span style="color: #000000;">-&gt;action = </span><span style="color: #0000ff;">self</span><span style="color: #000000;">::ACTION_SHOW;</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;"> }</span></span></li>
<li><span style="color: #000000;"><span style="font-family: Courier New,monospace;">}</span></span></li>
</ol>
<p>Warum arbeite ich nicht mit Strings sondern mit Konstanten, die ja auch Strings beinhalten? Durch die Verwendung von Konstanten gewährleiste ich, dass die Werte unverändert eingesetzt werden können. Ohne Angst haben zu müssen, dass sie versehentlich überschrieben werden. Auch kann ich so später aus den String-Konstanten relativ schnell z.B. Integer-Konstanten machen und die Verwendung bleibt gleicht.</p>
<p>Die restlichen Methoden dieser Klasse sind ausschließlich die „Getter“- und „Setter“-Methoden von Mode, ID und Action.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_05.zip">REDcms_05.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/" title="Tag 16 – Zusatzklassen">Tag 16 – Zusatzklassen</a></li><li><a href="http://www.re-design.de/2008/12/15/tag-15-login-class/" title="Tag 15 – Login Class">Tag 15 – Login Class</a></li><li><a href="http://www.re-design.de/2008/12/14/tag-14-template-class/" title="Tag 14 – Template Class">Tag 14 – Template Class</a></li><li><a href="http://www.re-design.de/2008/12/13/tag-13-content-class/" title="Tag 13 – Content Class">Tag 13 – Content Class</a></li><li><a href="http://www.re-design.de/2008/12/09/tag-9-application-class/" title="Tag 9 – Application Class">Tag 9 – Application Class</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/10/tag-10-request-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 9 – Application Class</title>
		<link>http://www.re-design.de/2008/12/09/tag-9-application-class/</link>
		<comments>http://www.re-design.de/2008/12/09/tag-9-application-class/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 22:00:26 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=208</guid>
		<description><![CDATA[Wie schon im gestrigen Artikel geschrieben, ist die „Application“-Klasse die Hauptklasse meines Systems. Sie sorgt für den reibungslosen Ablauf beim Anfordern einer Seite. Wie funktioniert nun so was? Eigentlich recht simple. Die „index.php“-Datei, die automatisch bei jedem Request, also beim Aufrufen einer Seite, gestartet wird, initialisiert die „Application“-Klasse und speichert sie in der Variable $app [...]]]></description>
			<content:encoded><![CDATA[<p>Wie schon im gestrigen Artikel geschrieben, ist die „Application“-Klasse die Hauptklasse meines Systems. Sie sorgt für den reibungslosen Ablauf beim Anfordern einer Seite.</p>
<p>Wie funktioniert nun so was? Eigentlich recht simple. Die „index.php“-Datei, die automatisch bei jedem Request, also beim Aufrufen einer Seite, gestartet wird, initialisiert die „Application“-Klasse und speichert sie in der Variable $app ab. Somit habe ich die Möglichkeit jeder Zeit weitere Methoden dieser Klasse aufzurufen. Obwohl, eigentlich brauche ich nur 2 Stück, und auch die könnten rein theoretisch reduziert werden.</p>
<h3>„init()“-Methode</h3>
<p>Was passiert bei der Instanziierung? Der Konstruktor ruft die private Methode „init“ auf und diese lädt die zusätzlich benötigten Objekte. Zuerst wird aber das Datumsformat mit „<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">setlocale(LC_ALL, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;de&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span>“ gesetzt.</p>
<p class="MsoBodyText">Danach wird in die „config“-Variable die „Configuration“-Klasse instanziiert. Diese lädt die Konfiguration, die in der „configuration.ini“-Datei hinterlegt ist. Um später auch eine HTML-Ausgabe benutzen zu können, wird die „Template“-Klasse anschließend in die „tpl“-Variable geladen. Ihr wird die Konstante mit dem Pfad zum Template-Ordner übergeben.In einer lokalen Variablen wird aus der Konfiguration der Array mit den Verbindungsangaben für die Datenbank geladen. Und in einer 2. lokalen Variablen wird der String vorbereitet der später für den Aufbau einer Datenbank-Verbindung wichtig ist. Nun wird die Verbindung zur Datenbank hergestellt und in der „db“-Variable abgespeichert. Nach einer Fehlerüberprüfung ob die Verbindung zum Datenbankserver hergestellt werden konnte, werden zum Schluss die Datumsformate auf der Konfiguration in das System integriert.</p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">private function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">init()</span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>setlocale(LC_ALL, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;de&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;config = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">new </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Configuration(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;./configuration.ini&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">new </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Template(TEMPLATEPATH);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$db </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;config-&gt;getSection(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;Database&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$dsn </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;mysql://&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$db</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">[</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">'user'</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">].</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;:&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$db</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">[</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">'password'</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">].</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;@&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$db</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">[</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">'host'</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">].</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;/&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$db</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">[</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">'db'</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">];</span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db = Database::connect(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$dsn</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db-&gt;setFetchMode(DB_FETCHMODE_OBJECT);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">if</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db-&gt;isError(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db))</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">die</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db-&gt;getMessage());</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>Date::setLongFormat(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;config-&gt;getValue(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;dateformatlong&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;Application&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">));</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>Date::setShortFormat(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;config-&gt;getValue(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;dateformatshort&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;Application&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">));</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<h3 style="margin-left: 0cm; text-indent: 0cm;"><!--[if !supportLists]--><!--[endif]-->„main()“-Methode</h3>
<p class="MsoBodyText">Nach der Initialisierung wird über die „index.php“-Datei die „main()“-Methode aufgerufen. Als erstes in dieser Methode wird die „Request“-Klasse in die „request“-Variable geladen. Ihr werden die globalen Variablen $_GET und $_REQUEST übergeben. Dies wird benötigt um anschließend über eine „switch“-Verzweigung zu entscheiden welche Informationen in die Klassenvariable „content“ geladen werden. Zum Schluss wird in die Klassenvariable „sidebar“ die Informationen zum Anzeigen der Sidebar gespeichert.</p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">public function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">main()</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">new </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$_GET</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">,</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$_REQUEST</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">switch </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getMode())</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::MODE_BOX:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;content = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;getBox(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getId());</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::MODE_MENU:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;content = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;getMenu(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getId());</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::MODE_PAGE:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">default</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;content = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;getPage(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getId());</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;sidebar = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;getSidebar(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getId());</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<h4 style="margin-left: 0cm; text-indent: 0cm;"><!--[if !supportLists]--><!--[endif]-->„getBox()“-, „getMenu()“-, „getPage()“-Methode</h4>
<p class="MsoBodyText">Alle drei Methoden besitzen den gleichen Aufbau, weshalb ich hier nur die „getPage()“-Methode erklären möchte.</p>
<p class="MsoBodyText">Als erstes wird die passende Klasse in eine Klassenvariable geladen. Ihr wird die Verbindung zum Datenbankserver mitgegeben. Als nächstes wird über die „request“-Variable und ihrer „getAction()“-Methode entschieden, welche Aktion nun folgen soll. Dabei gibt es 4 zur Auswahl.</p>
<ul>
<li><!--[if !supportLists]--><!--[endif]-->hinzufügen</li>
<li><!--[if !supportLists]--><!--[endif]-->ändern</li>
<li><!--[if !supportLists]--><!--[endif]-->löschen</li>
<li><!--[if !supportLists]-->anzeigen</li>
</ul>
<p class="MsoBodyText">Wobei die letzte Aktion generell immer aufgerufen wird, wenn keine Aktion vorhanden sein sollte. Die habe ich mit eingefügt, falls das System mal keine Aktion in der „request“-Variable findet. Anschließend wird aus der jeweiligen Klasse der Titel für die Titelleiste des Browsers angefordert um ihn später mit dem Titel des Systems zu kombinieren.</p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">private function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">getPage(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">1</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;page = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">new </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Page(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8221;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">switch </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getAction()) {</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_ADD:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;page-&gt;add();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_EDIT:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;page-&gt;edit(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_DELETE:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;page-&gt;delete(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_UPDATE:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;page-&gt;update();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_SHOW:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">default</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;page-&gt;get(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;titlebar = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;page-&gt;getTitle();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">return </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">private function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">getBox(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">1</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;box = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">new </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Box(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8221;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">switch </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getAction()) {</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_ADD:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;box-&gt;add();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_EDIT:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;box-&gt;edit(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_DELETE:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;box-&gt;delete(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_UPDATE:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;box-&gt;update();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_SHOW:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">default</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;box-&gt;get(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;titlebar = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;box-&gt;getTitle();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">return </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">private function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">getMenu(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">1</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;menu = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">new </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Menu(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8221;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">switch </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;request-&gt;getAction()) {</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_ADD:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;menu-&gt;add();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_EDIT:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;menu-&gt;edit(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_DELETE:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;menu-&gt;delete(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_UPDATE:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;menu-&gt;update();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">case </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Request::ACTION_SHOW:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">default</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;menu-&gt;get(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">break</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;titlebar = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;menu-&gt;getTitle();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">return </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<h4 style="margin-left: 0cm; text-indent: 0cm;"><!--[if !supportLists]--><!--[endif]-->„getSidebar()“-Methode</h4>
<p class="MsoBodyText">In der „getSidebar()“-Methode wird als erstes in der lokalen Variable „login“ die Anzeigebox für die Sidebar gespeichert. Danach wird das selbe mit der Navigationsbox gemacht.</p>
<p class="MsoBodyText">Zum Schluss wird dann mit Hilfe der Variable „tpl“ ein Template gefüllt und an die „main()“-Methode zurückgegeben.</p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">private function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">getSidebar(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">1</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$login </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= Login::getAdminBox();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$navi<span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;getMenuBox(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">0</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;load(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;sidebar.tpl.html&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##NAVIGATION##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">,<span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$navi</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##LOGIN##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">,<span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$login</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">return </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;get(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<h5 style="margin-left: 0cm; text-indent: 0cm;"><!--[if !supportLists]-->„getMenuBox()“-Methode</h5>
<p class="MsoBodyText">Hier wird einfach nur mit der „Menu“-Klasse<span> </span>der Navigationsbaum erstellt und an die „getSicebar()“-Methode zurückgegeben.</p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">private function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">getMenuBox(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$page_id</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">1</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;&lt;h4&gt;Navigation&lt;/h4&gt;&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$menu </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">new </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">Menu( </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;db );</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">return </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$content</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$menu</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;getTree( </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$page_id </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<h3 style="margin-left: 0cm; text-indent: 0cm;"><!--[if !supportLists]-->„display()“-Methode</h3>
<p class="MsoBodyText">Die letzte Methode innerhalb der „Application“-Klasse ist die „display()“-Methode. Auch diese wird ähnlich wie die „main()“-Methode von der „index.php“-Datei direkt aufgerufen. Hier laufen dann alle vorherigen Verarbeitungen zusammen.</p>
<p class="MsoBodyText">Als erstes wird der Website-Titel aus der Konfiguration geladen. Danach wird dieser mit dem Seitentitel kombiniert.</p>
<p class="MsoBodyText">Zum Schluss wird das Template geladen, mit den Informationen gefüllt und dann an die „index.php“-Datei zurückgegeben. Diese zeigt den Inhalt schließlich an.</p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">public function </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">display()</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">{</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$website </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">= </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;config-&gt;getSection(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;Website&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;titlebar = </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$website</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">[</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">'Title'</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">].</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216; &#8211; &#8216;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;titlebar;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;load(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;index.tpl.html&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##BASEURL##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, BASEURL);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##TITLEBAR##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;titlebar);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##WEBSITETITLE##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$website</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">[</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">'Title'</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">]);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##TAGLINE##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$website</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">[</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">'Tagline'</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">]);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##CONTENT##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;content);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;set(</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&#8216;##SIDEBAR##&#8217;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;sidebar);</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"><span> </span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">return </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: maroon;">$this</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">-&gt;tpl-&gt;get();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">}</span></p>
<h3 class="MsoNormal">Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_04.zip">REDcms_04.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/" title="Tag 16 – Zusatzklassen">Tag 16 – Zusatzklassen</a></li><li><a href="http://www.re-design.de/2008/12/15/tag-15-login-class/" title="Tag 15 – Login Class">Tag 15 – Login Class</a></li><li><a href="http://www.re-design.de/2008/12/14/tag-14-template-class/" title="Tag 14 – Template Class">Tag 14 – Template Class</a></li><li><a href="http://www.re-design.de/2008/12/13/tag-13-content-class/" title="Tag 13 – Content Class">Tag 13 – Content Class</a></li><li><a href="http://www.re-design.de/2008/12/10/tag-10-request-class/" title="Tag 10 – Request Class">Tag 10 – Request Class</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/09/tag-9-application-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tag 8 – Klassenprogrammierung</title>
		<link>http://www.re-design.de/2008/12/08/tag-8-klassenprogrammierung/</link>
		<comments>http://www.re-design.de/2008/12/08/tag-8-klassenprogrammierung/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 23:00:58 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=201</guid>
		<description><![CDATA[Um ein flexibles aber dennoch stabiles Programmiergerüst zu bekommen, habe ich mich für das objekt-orientierte Programmieren entschieden. Das bedeutet, das die gesamte Funktionalität des Systems in Klassen gekapselt ist. Es gibt insgesamt 12 Klassen. In den folgenden Tagen werde ich die einzelnen Klassen näher erklären. An dieser Stelle möchte ich euch erstmal nur eine kleine [...]]]></description>
			<content:encoded><![CDATA[<p>Um ein flexibles aber dennoch stabiles Programmiergerüst zu bekommen, habe ich mich für das objekt-orientierte Programmieren entschieden. Das bedeutet, das die gesamte Funktionalität des Systems in Klassen gekapselt ist. Es gibt insgesamt 12 Klassen.</p>
<div id="attachment_203" class="wp-caption alignnone" style="width: 310px"><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/klassen.png"><img class="size-medium wp-image-203" title="Klassenübersicht" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/klassen-300x297.png" alt="Klassenübersicht" width="300" height="297" /></a><p class="wp-caption-text">Klassenübersicht</p></div>
<p>In den folgenden Tagen werde ich die einzelnen Klassen näher erklären. An dieser Stelle möchte ich euch erstmal nur eine kleine Übersicht über die verwendeten Klasen geben.</p>
<ul>
<li>Application</li>
<li>Request</li>
<li>Configuration</li>
<li>Database</li>
<li>Content
<ul>
<li>Page</li>
<li>Box</li>
<li>Menu</li>
</ul>
</li>
<li>Template</li>
<li>Login</li>
<li>Editor</li>
<li>Date</li>
</ul>
<p>Ich habe versucht möglichst wenige Klassen zu benutzen, um den Überblick bei der Entwicklung nicht zu verlieren. Wobei die „Application“-Klasse hier ein sehr zentrale Rolle spielt. Weitere wichtige Klassen sind „Page“, „Box“ und „Menu“. Sie beinhalten die eigentliche Verarbeitung der einzelnen Bereiche.</p>
<p>In der „Request“-Klasse werden die Angaben der URL, also der Adressierung verarbeitet. Um REDcms schnell anpassen zu können, habe ich mich für die Verarbeitung von einer externen INI-Datei entschieden. So bekommt der Administrator einen schnellen Zugriff auf die wichtigsten Einstellmöglichkeiten ohne großartig in den einzelnen Klassen suchen zu müssen.</p>
<p>Um eine einfache Trennung zwischen der Programmierung und den HTML-Dateien zubekommen benutze ich eine eigenen „Template“-Klasse. Sie stellt mir alle wichtigen Funktionen für das Verarbeiten zur Verfügung.</p>
<p>Mit der „Login“-Klasse wird die An- und Abmeldung am System geregelt. Weiterhin kann darüber geprüft werden ob ein Benutzer berechtigt, also angemeldet, ist eine Seite bzw. deren Informationen einzusehen.</p>
<p>Um die Datumsausgabe besser zu verarbeiten, habe ich mir eine Hilfsklasse „Date“ erstellt. Damit bin ich in der Lage den Timestamp in ein deutsche Datumsformat zu konvertieren.Und ich habe noch zwei weitere Hilfsklassen erstellt. Wobei ich bei der „Database“-Klasse nur eine Ableitung der „DB“-Klasse des <a href="http://pear.php.net/index.php">PEAR-Framework</a> und bei der „Editor“-Klasse eine Ableitung des <a href="http://fwww.fckeditor.net/">FCKeditors</a>.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/16/tag-16-zusatzklassen/" title="Tag 16 – Zusatzklassen">Tag 16 – Zusatzklassen</a></li><li><a href="http://www.re-design.de/2008/12/15/tag-15-login-class/" title="Tag 15 – Login Class">Tag 15 – Login Class</a></li><li><a href="http://www.re-design.de/2008/12/14/tag-14-template-class/" title="Tag 14 – Template Class">Tag 14 – Template Class</a></li><li><a href="http://www.re-design.de/2008/12/13/tag-13-content-class/" title="Tag 13 – Content Class">Tag 13 – Content Class</a></li><li><a href="http://www.re-design.de/2008/12/10/tag-10-request-class/" title="Tag 10 – Request Class">Tag 10 – Request Class</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/08/tag-8-klassenprogrammierung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 7 – Datenbankstruktur</title>
		<link>http://www.re-design.de/2008/12/07/tag-7-datenbankstruktur/</link>
		<comments>http://www.re-design.de/2008/12/07/tag-7-datenbankstruktur/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 22:00:04 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[datenbank]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=192</guid>
		<description><![CDATA[Ich habe mich bei der Umsetzung meines REDcms für eine mySQL-Datenbank entschieden, da die Verwaltung relativ einfach ist und sie bei den meisten Provider installiert ist. Auch kann man von den Apachefriends ein kostenloses Paket mit Server und Datenbank herunterladen und installieren. Da mein System zur Zeit noch sehr einfach strukturiert ist, reichen mir 3 [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe mich bei der Umsetzung meines <strong>REDcms</strong> für eine mySQL-Datenbank entschieden, da die Verwaltung relativ einfach ist und sie bei den meisten Provider installiert ist. Auch kann man von den Apachefriends ein kostenloses Paket mit Server und Datenbank herunterladen und installieren.</p>
<p>Da mein System zur Zeit noch sehr einfach strukturiert ist, reichen mir 3 Datenbank-Tabellen: Page,  Box und Menu.</p>
<h3 class="western">Page-Tabelle</h3>
<div id="attachment_196" class="wp-caption alignleft" style="width: 181px"><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/datenbank_page.png"><img class="size-full wp-image-196" title="Page Tabelle" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/datenbank_page.png" alt="Page Tabelle" width="171" height="176" /></a><p class="wp-caption-text">Page Tabelle</p></div>
<p>In dieser Tabelle werden alle Informationen abgespeichert die für das Anzeigen einer einzelnen Seite wichtig sind. Wobei nur Basisinformationen abgespeichert werden, denn jede Seite kann ja beliebig viele zusätzliche Boxen haben.</p>
<p>Was wird also nun in dieser Tabelle abgespeichert? Natürlich erstmal die ID der Seite, die für die Adressierung wichtig ist. Weiterhin der Seitentitel, um auch dem Besucher der Website einen aussagekräftige Namen zu präsentieren. Auch habe ich mir überlegt das jede Seite die Möglichkeit hat einen Einführungstext abzuspeichern, sowie den Namen des Autors.</p>
<p>Um die einzelne Seite individuell zu gestalten, wird zusätzlich der Dateiname eines Templates mit abgespeichert.</p>
<h3 class="western">Box-Tabelle</h3>
<div id="attachment_194" class="wp-caption alignleft" style="width: 181px"><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/datenbank_box.png"><img class="size-full wp-image-194" title="Box Tabelle" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/datenbank_box.png" alt="Box Tabelle" width="171" height="210" /></a><p class="wp-caption-text">Box Tabelle</p></div>
<p>Zunächst einmal wird in jeder Box neben der eigenen ID auch die ID der Seite abgespeichert. Weiterhin gibt es auch die Möglichkeit einen Titel, einen Einführungstext und einen Haupttext abzuspeichern. Während der Titel und der Haupttext zwingend notwendig sind, ist der Einführungstext optional. So habe ich mir die Möglichkeit offen gehalten später Übersichtsseiten in mein <strong>REDcms</strong> hinzuzufügen.</p>
<p>&lt;!&#8211; 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 	&#8211;&gt;Auch wird hier wieder eine Template-Datei gefordert, um die Gestaltung individuell anzupassen. Zusätzlich wird noch die Sortierung der einzelnen Boxen innerhalb der Seite mit abgespeichert. Diese Sortierung wird aber in der derzeitigen Version (1.0) noch nicht mitberücksichtigt. Ich habe aber vor in eine der nächsten Versionen auch die Sortierung mit zu implementieren.</p>
<h3 class="western">Menu-Tabelle</h3>
<div id="attachment_195" class="wp-caption alignleft" style="width: 173px"><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/datenbank_menu.png"><img class="size-full wp-image-195" title="Menü Tabelle" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/datenbank_menu.png" alt="Menü Tabelle" width="163" height="176" /></a><p class="wp-caption-text">Menü Tabelle</p></div>
<p>Getrennt von den einzelnen Seiten speichere ich die Menüstruktur ab. Das hat den Vorteil, dass ich so Seiten anlegen kann, die nicht direkt in der Website erscheinen sollen, wie z.B. Übersichtsseiten mit Suchergebnissen oder die Folgeseite eines Formulars oder Fehlerseiten (404-Error, etc.). Auch kann ich so mehrere Menüpunkte auf ein und die selbe Seite verlinken, wenn es nötig sein sollte das der Inhalt öfters angezeigt werden soll.</p>
<p>Hier wird also, wie bei der Box neben der eigen ID auch die ID der Seite abgespeichert. Zusätzlich wird aber auch der anzuzeigende Name des Links und optional ein Titel abgespeichert.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_03.zip">REDcms 03.zip</a></li>
</ul>
<div class="firebugLayoutBox firebugLayoutBoxOffset" style="left: 8px; top: 165px;">
<div class="firebugLayoutBox firebugLayoutBoxMargin" style="padding: 10px;">
<div class="firebugLayoutBox firebugLayoutBoxBorder" style="padding: 1px;"></div>
</div>
</div>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/12/tag-12-database-class/" title="Tag 12 – Database Class">Tag 12 – Database Class</a></li><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/07/tag-7-datenbankstruktur/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 6 – hilfreiche Funktionen</title>
		<link>http://www.re-design.de/2008/12/06/tag-6-hilfreiche-funktionen/</link>
		<comments>http://www.re-design.de/2008/12/06/tag-6-hilfreiche-funktionen/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 22:00:11 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=178</guid>
		<description><![CDATA[Da meine Application relativ klein ist, brauche ich nicht viele Hilfsfunktionen bzw. zusätzliche Dateien. Es werden lediglich 2 Dateien und selbst die können später bei den Optimierungsmaßnahmen vielleicht eingespart werden. Beide Dateien werden auf der obersten Ebene des Systems abgespeichert. So dass der Zugriff schnell stattfinden kann. „include“-Datei Zu einem ist das die „include“-Datei. Sie [...]]]></description>
			<content:encoded><![CDATA[<p>Da meine Application relativ klein ist, brauche ich nicht viele Hilfsfunktionen bzw. zusätzliche Dateien. Es werden lediglich 2 Dateien und selbst die können später bei den Optimierungsmaßnahmen vielleicht eingespart werden. Beide Dateien werden auf der obersten Ebene des Systems abgespeichert. So dass der Zugriff schnell stattfinden kann.</p>
<h3 class="western">„include“-Datei</h3>
<p>Zu einem ist das die „include“-Datei. Sie lädt über den Befehl „<a href="http://de2.php.net/manual/de/function.include-once.php">include_once()</a>“ die einzelnen Dateien die für den reibungslosen Ablauf des Systems benötigt werden. Weiterhin enthält sie eine kleine Funktion, die ich nicht mehr missen möchte.</p>
<ol class="Sourcecode">
<li><code>function code($msg, $code=HTML_CODE)</code></li>
<li><code>{</code></li>
<li><code> $msg = print_r($msg, true);</code></li>
<li><code> if($code == HTML_CODE)</code></li>
<li><code> {</code></li>
<li><code> $msg = htmlentities($msg);</code></li>
<li><code> }</code></li>
<li><code> echo '&lt;div&gt;&lt;pre&gt;'.$msg.'&lt;/pre&gt;&lt;/div&gt;';</code></li>
<li><code>}</code></li>
</ol>
<p>Sie ist sehr hilfreich, da es immer wieder vorkommt Quellcode, oder ähnliche Angaben im Browser zu veröffentlichen. Die Funktion erwartet mindestens einen Parameter – das was sie anzeigen soll. Der 2. Parameter ist hilfreiche wenn man HTML-Quellcode anzeigen möchte, da ja jeder Browser erstmal jeden Quellcode durch seine Render-Engine jagt und somit umwandelt. Standardmäßig wird jede Anzeige konvertiert, außer man setzt den 2. Parameter auf „HTML_RENDER“. Dabei handelt es sich, wie bei „HTML_CODE“ um eine Konstante, die 2. Datei definiert wird.</p>
<p>Auch habe ich noch eine 2. Hilfsfunktion eingebaut, sie aber später wieder daktiviert, weil sie bei den vielen Änderungen an der Struktur des Systems nur im Wege stand. Trotzdem möchte ich die hier kurz aufzeigen. Vielleicht kommt auch sie später wieder mit in die Application.</p>
<ol class="Sourcecode">
<li><code>function __autoload($class_name)</code></li>
<li><code>{</code></li>
<li><code>$path = str_replace('_','/',$class_name);</code></li>
<li><code>$path = strtolower($path);</code></li>
<li></li>
<li><code>require_once('./core/'.$path.'.php');</code></li>
<li><code>}</code></li>
</ol>
<h3 class="western">„defines“-Datei</h3>
<p>In der „defines“-Datei werden alle wichtigen Konstanten geladen, die das System und der Entwickler braucht. Gott sei dank sind das nur 4 Stück.</p>
<ol class="Sourcecode">
<li><code>define('HTML_RENDER',	0);</code></li>
<li><code>define('HTML_CODE',	1);</code></li>
<li><code>define('BASEURL',	dirname($_SERVER['PHP_SELF']));</code></li>
<li><code>define('TEMPLATEPATH',	'layouts');</code></li>
</ol>
<p>Die ersten beiden Zeilen hatte ich ja gerade schon erklärt. Die Definition der BASEURL legt den absoluten Pfad zur Application fest. In meinen Fall ist das z.B. „<a href="http://www.re-design.de/weblabor/REDcms/demo">http://www.re-design.de/weblabor/REDcms/demo</a>“. So kann man später relativ schnell benötigte Dateien nachladen oder URL-Weiterleitungen programmieren.</p>
<p>Die letzte hat eigentlich das gleiche Ziel – schnell auf den Zielordner der Templates zuzugreifen. Wenn ich mir das aber hier jetzt näher ansehe, stelle ich fest dass es wohl auch sinnvoll wäre diese Definition in die Konfiguration des System auszulagern. So hat später der Verwalter des Systems schnelleren Zugriff um diesen Wert zu ändern. Vielleicht werden ich diese Angabe später noch optimieren.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_02.zip">REDcms_02.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/06/tag-6-hilfreiche-funktionen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tag 5 – Interaktion</title>
		<link>http://www.re-design.de/2008/12/05/tag-5-interaktion/</link>
		<comments>http://www.re-design.de/2008/12/05/tag-5-interaktion/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 22:00:39 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=160</guid>
		<description><![CDATA[Die genaue Interaktion des Programmeres mit dem Benutzer ist sehr vielfältig. Als erstes kann man sich von dem Frontend, also dem Bereich den der normale Benutzer sieht, über eine Anmelde-Maske an das Backend, dem Administrationsbereich, anmelden. Danach erscheinen im Administrationskasten 3 weitere Links, um eine neue Seite, eine neue Box oder einen neuen Menüpunkt anzulegen. [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 	 	 --></p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-addmenu.png"></a>Die genaue Interaktion des Programmeres mit dem Benutzer ist sehr vielfältig. Als erstes kann man sich von dem Frontend, also dem Bereich den der normale Benutzer sieht, über eine Anmelde-Maske an das Backend, dem Administrationsbereich, anmelden.</p>
<p>Danach erscheinen im Administrationskasten 3 weitere Links, um eine neue Seite, eine neue Box oder einen neuen Menüpunkt anzulegen. Außerdem kann man über den Button „abmelden&#8221; sich vom Administrationsbereich wieder abmelden.</p>
<p>Weiterhin erscheint hinter jedem Seitentitel, jedem Boxtitel und jedem Menüpunkt zwei Icons. Eins um die Seite, die Box bzw den Menüpunkt zu bearbeiten und eins um es zu löschen.</p>
<p>Es gibt also auch bei meinem CMS die klassischen Möglichkeiten zur Verwaltung von Content: hinzufügen, bearbeiten und löschen.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/layout-anmeldung.png"><img class="size-full wp-image-168 alignnone" title="layout-anmeldung" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/layout-anmeldung.png" alt="" width="190" height="164" /></a><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/layout-administration.png"><img class="size-full wp-image-170 alignnone" title="layout-administration" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/layout-administration.png" alt="" width="190" height="205" /></a><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/layout-navigation.png"><img class="alignnone size-full wp-image-172" title="layout-navigation" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/layout-navigation.png" alt="" width="190" height="103" /></a></p>
<h3>Welche Idee steckt hinter diesen 3 Bereichen?</h3>
<p>Als erstes war mir wichtig die einzelnen Seiten sehr flexibel zu halten. Dazu habe ich mir überlegt, dass die tatsächlichen Texte der Seite in einzelne Boxen zu verpacken. Dadurch kann eine Seite sehr individuell aufgebaut werden.</p>
<h4>Seite-Angaben</h4>
<p>Was beinhaltet nun eine Seite? Eigentlich nur ihren Seitentitel und den Namen des jeweiligen Templates. Alle weiteren Angaben wie Einleitungstext und Autor sind optional.</p>
<h4>Box-Angaben</h4>
<p>Auch in der Box gibt es nicht viele, zwingende Informationen. Hier sind es der Boxtitel, der Haupttext, der Name des jeweiligen Templates und die Auswahl zu welcher Seite die Box gehört. Optional kann aber auch hier ein Einleitungstext und die Position (die Stelle innerhalb der Boxauflistung in der Seite).</p>
<h4>Menü-Angaben</h4>
<p>Hier sind nur 3 Angaben zwingend notwendig: der Name des Menüeintrages, die Zuordnung zu eines bestehenden Seite und ob der Menüeintrag ein Untermenü eines bestehenden Eintrages ist. Optional kann der Link mit einem Titel belegt werden.</p>
<h4>Weitere Angaben</h4>
<p>In allen drei Bereichen besteht die Möglichkeit die Veröffentlichung zu verneinen und damit die Seite, die Box bzw. den Menüpunkt im Frontend nicht anzeigen zu lassen. Außerdem ist schon ein Eingabefeld eingebaut, welches später das Zugriffslevel, also die Berechtigung, definiert.</p>
<p><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-addpage.png"><img class="alignnone size-medium wp-image-175" title="re-design-addpage" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-addpage-167x300.png" alt="" width="167" height="300" /></a><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-addbox.png"><img class="alignnone size-full wp-image-173" title="re-design-addbox" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-addbox.png" alt="" width="173" height="468" /></a><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-addmenu.png"><img class="alignnone size-medium wp-image-174" title="re-design-addmenu" src="http://www.re-design.de/workbook/wp-content/uploads/2008/12/re-design-addmenu-267x300.png" alt="" width="160" height="180" /></a></p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/interaktion.zip">Interaktion.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/05/tag-5-interaktion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 4 – URL-Design</title>
		<link>http://www.re-design.de/2008/12/04/tag-4-url-design/</link>
		<comments>http://www.re-design.de/2008/12/04/tag-4-url-design/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 22:00:59 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=156</guid>
		<description><![CDATA[Das Schwierigste bei der Umsetzung von REDcms war das URL-Design. Ich wollte über eine Seite „index.php“ das alle Anfragen abgearbeitet werden. Früher hat man für jede Anfrage-Art eine eigene PHP-Seite erstellt. Wurde also die Übersichtsseite aufgerufen, dann gab es dafür bspw. eine Seite namens „overview.php“. Wurde hingegen die Detailseite aufgerufen, so gingen alle Befehle an [...]]]></description>
			<content:encoded><![CDATA[<p>Das Schwierigste bei der Umsetzung von <strong>REDcms</strong> war das URL-Design. Ich wollte über eine Seite „index.php“ das alle Anfragen abgearbeitet werden. Früher hat man für jede Anfrage-Art eine eigene PHP-Seite erstellt. Wurde also die Übersichtsseite aufgerufen, dann gab es dafür bspw. eine Seite namens „overview.php“. Wurde hingegen die Detailseite aufgerufen, so gingen alle Befehle an die „detail.php“-Seite.</p>
<p>Bei komplexen bzw. skalierbaren Systemen entsteht dadurch schnell eine Unmenge an bei einzelnen Verarbeitungsdateien. Wenn man nun bedenkt, dass bei diesen Dateien oft ähnliche Verarbeitung zu Gange sind, wird einem schnell klar warum heutige CMS mit einer zentralen Verarbeitungsdatei arbeiten. Auch ich wollte bei <strong>REDcms</strong> diesen Trend verfolgen. Der Nachteil der dadurch entsteht, ist der das alle verarbeitungsrelevanten Befehle an diese zentrale Datei an gehangen werden müssen. Ein Beispiel für einen solchen Anhang wäre folgende URL:</p>
<blockquote><p>„<a href="http://www.domain.tld/index.php?mode=page&amp;id=1&amp;action=show">http://www.domain.tld/index.php?mode=page&amp;id=1&amp;action=show</a>“</p></blockquote>
<p>Solche URLs sind aber nicht gerade Suchmaschinen freundlich. Weswegen man mit der Konfigurationsdatei „.htaccess“ und der Modul-Erweiterung „mod-rewrite“ vom Apache-Server die URLs umschreibt. Eine bessere URL für das vorhergehen Beispiel wäre:</p>
<blockquote><p>„<a href="http://www.domain.tld/page/1/show">http://www.domain.tld/page/1/show</a>“</p></blockquote>
<p>oder zumindest:</p>
<blockquote><p>„<a href="http://www.doamin.tld/page/1">http://www.doamin.tld/page/1</a>“</p></blockquote>
<p>Genau für diesen Zweck gibt es das Modul „mod_rewrite“ mit der man die URLs umschreiben kann.</p>
<h3 class="western">Wie sieht die „.htaccess“-Datei aus?</h3>
<p>Als erstes muss man Rewrite starten und dann braucht man die folgenden 3 Regeln:</p>
<ol>
<li><span style="font-family: Courier New,monospace;">RewriteRule 	^([a-z]+)/*$ index.php?mode=$1&amp;id=1&amp;action=show</span></li>
<li><span style="font-family: Courier New,monospace;">RewriteRule 	^([a-z]+)/([0-9]+)/*$ index.php?mode=$1&amp;id=$2&amp;action=show</span></li>
<li><span style="font-family: Courier New,monospace;">RewriteRule 	^([a-z]+)/([0-9]+)/([a-z]+)$ index.php?mode=$1&amp;id=$2&amp;action=$3</span></li>
</ol>
<p>Die Angabe nach RewriteRule ist das Suchmuster gefolgt von der Ersetzungsangabe. Das bedeutet in der ersten Regel, dass alle Angaben nach der Domain umgeleitet werden in die Ersetzungsangabe wobei die Angabe die im Suchmuster in den runden Klammern ([a-z]+) steht in den Platzhalter $1 in der Ersetzungsangabe eingefügt wird. Dazu ein paar Beispiele:</p>
<ul>
<li>/ 	– /index.php?mode=&amp;id=1&amp;action=show</li>
<li>/<strong>test</strong> – /index.php?mode=<strong>test</strong>&amp;id=1&amp;action=show</li>
<li>/<strong>helloworld</strong> – /index.php?mode=<strong>helloworld</strong>&amp;id=1&amp;action=show</li>
</ul>
<p>So gibt in der zweiten Regel 2 Platzhalter und dementsprechend auch 2 Bereiche mit den runden Klammern und in der dritten Regel alles dreifach.</p>
<h3>Downloads</h3>
<ul>
<li><a href="http://www.re-design.de/workbook/wp-content/uploads/2008/12/redcms_01.zip">REDcms_01.zip</a></li>
</ul>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/04/tag-4-url-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 3 – Ablauf</title>
		<link>http://www.re-design.de/2008/12/03/tag-3-ablauf/</link>
		<comments>http://www.re-design.de/2008/12/03/tag-3-ablauf/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 22:00:41 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=152</guid>
		<description><![CDATA[Wie soll nun also der Ablauf aussehen und was kann eigentlich alles eingestellt werden? Neben dem eigentlichen Frontend, also das was der Besucher der Website zu sehen bekommt, gibt es noch das Backend – den Administrationsbereich. Nach der Eingabe soll an den passenden Stellen Symbole erscheinen an denen REDcms Änderungen erlaubt. Was soll nun genau [...]]]></description>
			<content:encoded><![CDATA[<p>Wie soll nun also der Ablauf aussehen und was kann eigentlich alles eingestellt werden? Neben dem eigentlichen Frontend, also das was der Besucher der Website zu sehen bekommt, gibt es noch das Backend – den Administrationsbereich. Nach der Eingabe soll an den passenden Stellen Symbole erscheinen an denen <strong>REDcms</strong> Änderungen erlaubt.</p>
<h3 class="western">Was soll nun genau alles änderbar sein?</h3>
<p>Grob gesagt bestehen alle CM-Systeme aus einem einfachen Prinzip. Man kann etwas hinzufügen, ändern und löschen, so ist es auch bei meinem CMS. Wie schon am 2. Tag geschrieben, gibt es 3 wichtige Bereiche die man administrieren kann. Der erste ist die eigentliche <strong>Seite</strong>. Hier soll man neue Seiten anlegen, bestehende ändern und löschen können. Das gleiche sollte man natürlich auch für die einzelnen <strong>Box</strong>en auf den Seiten machen können. Zum Schluss gibt es auch noch das <strong>Menü</strong>. Auch hier sollte man einen neuen Menüpunkt hinzufügen können, aber auch bestehende ändern und löschen können.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/03/tag-3-ablauf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 2 – Aufbau</title>
		<link>http://www.re-design.de/2008/12/02/tag-2-aufbau/</link>
		<comments>http://www.re-design.de/2008/12/02/tag-2-aufbau/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 22:00:52 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=149</guid>
		<description><![CDATA[Als erstes möchte ich euch den allgemeinen Ablauf von REDcms erklären, um dann näher auf die Details einzugehen. Wie schon im ersten Artikel geschrieben, gab es bei mir schon lange den Wunsch ein eigenes CM-System zu erstellen. Ich habe mich auch schon oft hingesetzt und angefangen eins zu schreiben, aber meistens scheiterte es nicht nur [...]]]></description>
			<content:encoded><![CDATA[<p>Als erstes möchte ich euch den allgemeinen Ablauf von <strong>REDcms</strong> erklären, um dann näher auf die Details einzugehen. Wie schon im ersten Artikel geschrieben, gab es bei mir schon lange den Wunsch ein eigenes CM-System zu erstellen. Ich habe mich auch schon oft hingesetzt und angefangen eins zu schreiben, aber meistens scheiterte es nicht nur an der fehlenden Zeit, sondern auch an dem geplanten Umfang und der detaillierten Planung. Oft habe ich alles auf einmal erstellen wollen und verstrickte mich in zu viele Fragestellungen; was wäre wenn und warum nicht dies oder jenes mit einbauen. Dies sollte sich mit diesem System ändern.</p>
<p>Als erstes habe ich die Funktionalität von <strong>REDcms</strong> radikal gekürzt, was nicht nur der allgemeinen Machbarkeit dienlich ist, sondern auch der Verständlichkeit. Es gibt also nicht mehr Tausende von Funktionen, sondern mir war es diesmal wichtig die Möglichkeiten sehr einfach und damit überschaubar zu halten.</p>
<h3 class="western">Was kann also nun <strong>REDcms</strong>?</h3>
<p>Eigentlich wollte ich ein CMS schaffen mit dem man neue Seite anlegen und diese in einer Menüstruktur sortiert kann. Weiterhin wollte ich innerhalb der einzelnen Seite Boxen hinzufügen, um den Inhalt besser zu untergliedern. Das was´s schon.</p>
<p>Das Ganze sollte dann über eine einfache Anmeldung administrierbar gemacht werden. Also anmelden, Dinge ändern und dann wieder abmelden. Ich glaube das dies dadurch sehr intuitiv benutzbar wird. So hoffe ich es zumindest, denn bis jetzt hat keiner mein <strong>REDcms</strong> getestet.</p>
<p>Wer also Lust hat in diesem System etwas herum zuspielen, der kann sich mit den folgenden Daten anmelden.</p>
<ul>
<li>Benutzername: admin</li>
<li>Kennwort: demo</li>
</ul>
<p>Bitte beachtet, das sich das CMS Mitternacht wieder in den Urzustand zurücksetzt. Bitte habt dafür Verständnis. Wer Anregungen zur Verbesserung bzw. zur Erweiterung hat, kann an den passenden Stellen einen Kommentar hinterlassen. Auch würde ich mich über jeden gefunden Fehler bzw. Bug freuen, oder auch nicht! Bedenkt aber, dass das System auf Rücksicht der Einfachheit keine Fehlerüberprüfung bei Eingaben macht. Dieses folgt dann bei der Umstellung auf den Produktionsstatus.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/02/tag-2-aufbau/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag 1 &#8211; Einleitung</title>
		<link>http://www.re-design.de/2008/12/01/redcms-einleitung/</link>
		<comments>http://www.re-design.de/2008/12/01/redcms-einleitung/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 22:00:15 +0000</pubDate>
		<dc:creator>Enrico Reinsdorf</dc:creator>
				<category><![CDATA[Adventskalender 2008]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[adventskalender]]></category>
		<category><![CDATA[redcms]]></category>

		<guid isPermaLink="false">http://www.re-design.de/workbook/?p=146</guid>
		<description><![CDATA[Mit dem großen Erfolg letztes Jahr mit meinen Adventskalender 2007 habe ich nicht wirklich gerechnet, deshalb möchte ich das dieses Jahr wiederholen. Im letzten Jahr habe ich aus den verschiedenen Webtechnologien einzelne Themen herausgenommen und darüber berichtet. Dieses Jahr möchte ich mich auf ein Thema konzentrieren. Da ich schon seit sehr langer Zeit ein eigenes [...]]]></description>
			<content:encoded><![CDATA[<p>Mit dem großen Erfolg letztes Jahr mit meinen Adventskalender 2007 habe ich nicht wirklich gerechnet, deshalb möchte ich das dieses Jahr wiederholen. Im letzten Jahr habe ich aus den verschiedenen Webtechnologien einzelne Themen herausgenommen und darüber berichtet. Dieses Jahr möchte ich mich auf ein Thema konzentrieren. Da ich schon seit sehr langer Zeit ein eigenes CM-System erstellen wollte, fand ich dieses als hervorragenden Aufhänger für meinen diesjährigen Adventskalender. Ich hoffe ihr könnt meine Begeisterung teilen und freut euch mit mir über jeden Tag an dem ich mehr von der Konzeption über die Programmierung bis hin zum Design meines eigenen CM-System veröffentliche.</p>
<p>Warum habe ich ein solches System erstellt, werden sich jetzt einige Leser denken. Es gibt doch genug. Das stimmt! Mir geht es auch nicht direkt um die tatsächliche Verwendbarkeit des Systems. Mir geht es hier um die Wissensvermittlung wie solche Systeme funktionieren können.</p>
<p>Seit mittlerweile 11 Jahren bin ich als freier Dozent im Webbereich tätig und gebe natürlich immer wieder Programmier-Seminare. Dort kommt man leider nicht in die Tiefe ein eigenes System zu entwickeln. Und trotzdem kann man mit relativ wenigen Mitteln bzw. Kenntnissen ein solches System erstellen und genau das soll dieser Kalender verdeutlichen.</p>
<p>Um aber nicht völlig bei Null anzufangen, wäre es gut wenn gute HTML- und CSS-Kenntnisse vorhanden sind. Und da das System eine mySQL-Datenbank voraussetzt und in PHP geschrieben ist, sind Kenntnisse in diesem Bereich erforderlich um alles zu verstehen. Aber ich glaube auch ohne diese Kenntnisse kann man einen Großteil dieses Tutorials gut verstehen und nachvollziehen. Falls nicht, bitte ich euch in Kommentaren offene Fragen zu stellen, die ich dann beantworten kann.</p>
<p>Zum Schluss möchte ich meinem System noch einen Namen geben. Ich hoffe ihr findet ihn passend. Mein Projekt nennt sich „<strong>REDcms</strong>“. „RED“ kommen von <strong>RE</strong>-<strong>D</strong>esign und „cms“ naja es ist ja nun mal ein <strong>CM</strong>-<strong>S</strong>ystem.</p>
<p>Wer das CMS testen möchte, der findet in meinem Weblabor das entsprechende <a href="http://www.re-design.de/weblabor/REDcms/demo" target="_blank">Demo</a>. Dort werden später auch alle Releases zum Download veröffentlicht.</p>
<h3  class="related_post_title">Ähnliche Beiträge</h3><ul class="related_post"><li><a href="http://www.re-design.de/2008/12/24/tag-24-abschluss/" title="Tag 24 – Abschluss">Tag 24 – Abschluss</a></li><li><a href="http://www.re-design.de/2008/12/23/tag-23-mehrbenutzer-und-rechtesystem/" title="Tag 23 – Mehrbenutzer- und Rechtesystem">Tag 23 – Mehrbenutzer- und Rechtesystem</a></li><li><a href="http://www.re-design.de/2008/12/22/tag-22-bild-upload-und-rss-feed/" title="Tag 22 – Bild-Upload und RSS-Feed">Tag 22 – Bild-Upload und RSS-Feed</a></li><li><a href="http://www.re-design.de/2008/12/20/276/" title="Tag 20 – CSS-Design">Tag 20 – CSS-Design</a></li><li><a href="http://www.re-design.de/2008/12/19/tag-19-formulare/" title="Tag 19 – Formulare">Tag 19 – Formulare</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.re-design.de/2008/12/01/redcms-einleitung/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

