phpcms-plugins-cvs Mailing List for phpCMS-plugins (Page 15)
Brought to you by:
mjahn
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(40) |
Jun
(38) |
Jul
(36) |
Aug
(46) |
Sep
(13) |
Oct
(1) |
Nov
|
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(2) |
Feb
(19) |
Mar
|
Apr
(43) |
May
(119) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Martin J. <mj...@us...> - 2004-06-05 12:44:32
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16471 Modified Files: Changelog Log Message: separated layout-files Index: Changelog =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/Changelog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Changelog 4 Jun 2004 11:11:56 -0000 1.4 +++ Changelog 5 Jun 2004 12:44:22 -0000 1.5 @@ -1,3 +1,7 @@ +June 6 2004 (mjahn) + * separated layout for framework and layout-elements for the modules + into layout.tpl and layout.xml for better handling of module_layout + June 4 2004 (mjahn) * phpDOC-comments are now in english * optimized layout-module |
From: Martin J. <mj...@us...> - 2004-06-05 12:44:32
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16471/modules/layout Modified Files: class.module_layout.php layout.xml Log Message: separated layout-files Index: layout.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- layout.xml 4 Jun 2004 11:11:58 -0000 1.2 +++ layout.xml 5 Jun 2004 12:44:23 -0000 1.3 @@ -2,26 +2,11 @@ <!DOCTYPE layout SYSTEM "layout.dtd"> <layout> - <document> + <empty> <![CDATA[ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> - <head> - <title>Verwaltungsoberfläche</title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <meta name="description" content="Administrationsoberfläche von phpCMS" /> - <meta name="robots" content="noindex,nofollow" /> - <meta name="author" content="Martin Jahn" /> - <meta name="language" content="de" /> - <meta http-equiv="imagetoolbar" content="no" /> - <link rel="stylesheet" href="./modules/layout/layout.css" type="text/css" /> - </head> - <body> <content /> - </body> -</html> ]]> - </document> + </empty> <block> <![CDATA[ Index: class.module_layout.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/class.module_layout.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- class.module_layout.php 4 Jun 2004 11:32:08 -0000 1.6 +++ class.module_layout.php 5 Jun 2004 12:44:23 -0000 1.7 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.7 2004/06/05 12:44:23 mjahn +* separated layout-files +* * Revision 1.6 2004/06/04 11:32:08 mjahn * several changes * @@ -149,71 +152,89 @@ **/ function displayLayout (&$actiondata) { - $this->_readLayoutFile(); - - // set the left content block - $actiondata = array ('_type'=>'block', '_id'=>'menu', 'id'=>'menu', 'name'=>'menu'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - - // set the phpcms-logo - $actiondata = array ('_type'=>'image', '_root'=>'menu', '_id'=>'logo', 'id'=>'', 'class'=>'', 'src'=>'phpcms.png', 'width'=>'181', 'height'=>'60', 'alt'=>'', 'title'=>'phpCMS-Logo v2'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - - // set the menu-root - $actiondata = array ('_type'=>'ulist', '_root'=>'menu', '_id'=>'mainmenu', 'id'=>'', 'class'=>''); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - - // get the main-menu-tree - $actiondata = array ('_root'=>'mainmenu'); - $this->_callEvent ('DISPLAY_PARSE_MENU_MAIN', $actiondata); - - // set container for statusbar - $actiondata = array ('_type'=>'block', '_root'=>'menu', '_id'=>'statusbar', 'id'=>'', 'class'=>''); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + // parse the layoutfile for the elements + $this->_readLayoutFiles(); - // get the statusbar-entries - $actiondata = array ('_root'=>'statusbar'); - $this->_callEvent ('DISPLAY_PARSE_STATUSBAR', $actiondata); - - // set the copyright-message - $actiondata = array ('_type'=>'paragraph', '_root'=>'menu', '_id'=>'copyright', 'id'=>'', 'class'=>'', 'content'=>'© 2004, Alle Rechte bei phpcms-plugin-Team'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + // read layoutfile for the framework + $output = join ('', file (dirname (__FILE__).'/layout.tpl')); - // set right content block - $actiondata = array ('_type'=>'block', '_id'=>'content', 'id'=>'content', 'class'=>''); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - - // set the submenu block - $actiondata = array ('_type'=>'ulist', '_id'=>'submenu', 'id'=>'submenu', 'class'=>'', '_root'=>'content'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - - // get the error-messages - $actiondata = array ('_root'=>'submenu'); - $this->_callEvent ('DISPLAY_PARSE_MENU_SUB', $actiondata); - - // set the error-message block - $actiondata = array ('_type'=>'block', '_id'=>'error', 'id'=>'', 'class'=>'error', '_root'=>'content'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - - // get the error-messages - $actiondata = array ('_root'=>'error'); - $this->_callEvent ('DISPLAY_PARSE_ERROR', $actiondata); + // get all tags from the framework-layoutfile + $matches = preg_match_all ('°<phpcms-admin:([^(?/>)]*)\s/>°im', $output, $tags); + $tagnames = $tags[1]; + $search = $tags[0]; + $replace = array(); + unset ($tags); - // set the content block - $actiondata = array ('_type'=>'block', '_id'=>'inhalt', 'id'=>'', 'class'=>'content', '_root'=>'content'); - $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - - // get the content - $actiondata = array ('_root'=>'inhalt'); - $this->_callEvent ('DISPLAY_PARSE_CONTENT', $actiondata); + for ($i = 0; $i < $matches; $i++) { + $replace[$i] = ''; + switch ($tagnames[$i]) { + case 'mainmenu': + // set the menu-root + $actiondata = array ('_type'=>'ulist', '_id'=>'mainmenu', 'id'=>'mainmenu'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + // get the main-menu-tree + $actiondata = array ('_root'=>'mainmenu'); + $this->_callEvent ('DISPLAY_PARSE_MENU_MAIN', $actiondata); + if (isset ($this->_ids['mainmenu']['_sub'])) { + $replace[$i] = $this->displayElement ($this->_ids['mainmenu']); + } + break; + + case 'statusbar': + // set container for statusbar + $actiondata = array ('_type'=>'empty', '_id'=>'statusbar'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + // get the statusbar-entries + $actiondata = array ('_root'=>'statusbar'); + $this->_callEvent ('DISPLAY_PARSE_STATUSBAR', $actiondata); + if (isset ($this->_ids['statusbar']['_sub'])) { + $replace[$i] = $this->displayElement ($this->_ids['statusbar']); + } + break; + + case 'submenu': + // set the submenu block + $actiondata = array ('_type'=>'ulist', '_id'=>'submenu', 'id'=>'submenu'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + // get the error-messages + $actiondata = array ('_root'=>'submenu'); + $this->_callEvent ('DISPLAY_PARSE_MENU_SUB', $actiondata); + if (isset ($this->_ids['submenu']['_sub'])) { + $replace[$i] = $this->displayElement ($this->_ids['submenu']); + } + break; + + case 'error': + // set the error-message block + $actiondata = array ('_type'=>'empty', '_id'=>'error'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + // get the error-messages + $actiondata = array ('_root'=>'error'); + $this->_callEvent ('DISPLAY_PARSE_ERROR', $actiondata); + if (isset ($this->_ids['error']['_sub'])) { + $replace[$i] = $this->displayElement ($this->_ids['error']); + } + break; + + case 'content': + // set the content block + $actiondata = array ('_type'=>'empty', '_id'=>'content'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // get the content + $actiondata = array ('_root'=>'content'); + $this->_callEvent ('DISPLAY_PARSE_CONTENT', $actiondata); + if (isset ($this->_ids['content']['_sub'])) { + $replace[$i] = $this->displayElement ($this->_ids['content']); + } + break; + + default:; + } + } - /* - echo '<pre>'; - print_r($this->_elements); - echo '</pre>'; - */ - // generate output - echo $this->displayGroup ($this->_elements); + echo str_replace ($search, $replace, $output); + //print_r($this->_elements); } @@ -235,18 +256,6 @@ } // check if sub-elements exist - - if (isset ($elements[$i]['_sub']) && is_array ($elements[$i]['_sub'])) { - - // get the content of the sub-elements - $content = $this->displayGroup ($elements[$i]['_sub']); - - // merge the sub-element-content with the params of the element - if (!isset ($elements[$i]['content'])) { - $elements[$i]['content'] = $content; - } - } - $o .= $this->displayElement ($elements[$i]); } return $o; @@ -270,6 +279,17 @@ $element['content'] = ''; } + if (isset ($element['_sub']) && is_array ($element['_sub'])) { + + // get the content of the sub-elements + $content = $this->displayGroup ($element['_sub']); + + // merge the sub-element-content with the params of the element + if (!isset ($element['content']) || $element['content'] == '') { + $element['content'] = $content; + } + } + // create the search- and replace-arrays $replace = $search = array(); foreach (array_keys ($element) as $id) { @@ -280,6 +300,7 @@ $replace[] = $element[$id]; } + //print_r ($replace); return str_replace ($search, $replace, $this->_layout[$element['_type']]."\n"); } @@ -291,17 +312,17 @@ * * @access private **/ - function _readLayoutFile () { + function _readLayoutFiles () { $layoutfile = dirname(__FILE__).'/layout.xml'; if (!isset($layoutfile)) { - $actiondata = array ('errortext'=>'Layoutdatei konnte nicht geladen werden!'); + $actiondata = array ('errortext'=>'Layoutdatei layout.xml konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } if (!file_exists ($layoutfile)) { - $actiondata = array ('errortext'=>'Layoutdatei konnte nicht geladen werden!'); + $actiondata = array ('errortext'=>'Layoutdatei layout.xml konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } |
From: Martin J. <mj...@us...> - 2004-06-05 12:44:31
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16471/docs Modified Files: Benutzerhandbuch.lyx Log Message: separated layout-files Index: Benutzerhandbuch.lyx =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/docs/Benutzerhandbuch.lyx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Benutzerhandbuch.lyx 4 Jun 2004 11:11:56 -0000 1.4 +++ Benutzerhandbuch.lyx 5 Jun 2004 12:44:22 -0000 1.5 @@ -122,30 +122,47 @@ Die Module \layout Standard -Folgende Module sollen als Grundausstattung mitgeliefert werden. +Folgende Module werden als Grundausstattung mitgeliefert werden. \layout Itemize -ein DateiManager (auf der class.filemanager_phpcms.php aufbauend) +Dateimanager-Modul \layout Itemize -ein PluginManager (abzustimmen mit obw wegen PluginToolkit) +Modulmanager (automatisches Update, Installation und Löschen von Modulen + ähnlich dem PEAR-Installer) \layout Itemize -ein ModulManager (automatisches Update, Installation und Löschen von Modulen - ähnlich dem PEAR-Installer) +Konfigurations-Modul für phpCMS und das Framework, sowie andere administrative + Aufgaben \layout Itemize -ein KonfigurationsModul für phpCMS (zur komfortablen Konfiguration von phpCMS) +Benutzer- und Rechteverwaltung +\layout Standard + +Zusätzlich werden folgende Module zur Nachinstallation über den Modulmanager + angeboten \layout Itemize -eine BenutzerVerwaltung inkl. - RechteVerwaltung (Administration für LiveUser) +ein Pluginmanager-Modul (abzustimmen mit obw wegen PluginToolkit) \layout Itemize -ein umfangreiches StatistikModul (phpCMS-Statistikdaten graphisch aufbereitet) +ein umfangreiches Statistik-Modul (phpCMS-Statistikdaten graphisch aufbereitet) \layout Itemize ein WebDAV-Modul (für die komfortable Pflege der Internetpräsenz) +\layout Itemize + +Newsletter-Modul +\layout Itemize + +u. + a. +\layout Chapter + +Benutzerhandbuch +\layout Chapter + +Entwickler-Dokumentation \layout Section Die Funktionsweise @@ -338,330 +355,21 @@ aufgerufen. In diesem Parameter stehen alle Werte, die von der das Event auslösenden Funktion übergeben wurden. -\layout Subsection - -Der ObjectHandler -\layout Standard - -Ist noch mit im ActionHandler integriert. - Dabei wird extensiv von call-by-reference Übergaben Gebrauch gemacht. - Damit existiert letztendlich nur der minimal notwendige Speicherverbrauch, - weil es von jedem Objekt nur eine einzige Instanz gibt. -\layout Subsection - -API -\layout Standard - -Coming soon \SpecialChar \ldots{} - -\layout Section - -Die Modulklasse -\layout Standard - -Von ihr leiten sich alle anderen Module ab. -\layout Subsection - -API -\layout Paragraph - -boolean init () -\layout Paragraph - -boolean __registerEvent (string $eventname, string $eventaction) -\layout Paragraph - -boolean __registerAction (string $actionname, string $methodname) -\layout Paragraph - -boolean __callEvent (string $eventname, array $actiondata) -\layout Section - -Beispiel: Programmablauf -\layout Enumerate - -Framework Start -\begin_deeper -\layout Enumerate - -Konfiguration einlesen -\layout Enumerate - -Session starten -\end_deeper -\layout Enumerate - -Grundsystem laden und starten -\begin_deeper -\layout Enumerate - -ActionHandler laden -\layout Enumerate - -EventHandler laden -\end_deeper -\layout Enumerate - -Module laden und initialisieren -\begin_deeper -\layout Enumerate - -Event -\noun on -load_module -\end_deeper -\layout Enumerate - -HTTP-Request-Daten (GET/POST) verarbeiten -\begin_deeper -\layout Enumerate - -Event -\noun on -parse_param -\end_deeper -\layout Enumerate - -Menustruktur abrufen -\begin_deeper -\layout Enumerate - -Event -\noun on -parse_menu -\end_deeper -\layout Enumerate - -Ausgabe abrufen -\begin_deeper -\layout Enumerate - -Event -\noun on -display -\end_deeper -\layout Enumerate - -Framework Ende -\layout Chapter - -Das Framework -\layout Standard - -Das Framework stellt für die einzusetzenden Module diverse Dienstleistungen - zur Verfügung. -\layout Section - -Übersicht über Events und deren Aktionsdaten -\layout Subsection - -Events für das Framework -\layout Subsubsection - - -\noun on -REGISTER_EVENT -\layout Description - -Beschreibung Registriert ein Event im Eventhandler -\layout Subsubsection - - -\noun on -REGISTER_ACTION -\layout Description - -Beschreibung Registriert eine Aktion im Eventhandler -\layout Subsection - -Events für den Emailversand -\layout Subsubsection - - -\noun on -MAIL_SEND_MAIL -\layout Description - -Beschreibung Sendet eine Email -\layout Subsection - -Events für die Fehlerbehandlung -\layout Subsubsection - - -\noun on -ERROR_ERROR -\layout Description - -Beschreibung Gibt eine Fehlermeldung aus und unterbricht die Ausführung - des Programms. -\layout Subsubsection - - -\noun on -ERROR_NOTICE -\layout Description - -Beschreibung Gibt eine Fehlermeldung aus, unterbricht die Ausführung des - Programms aber nicht \layout Chapter Die Module \layout Section -Das Layoutmodul -\layout Standard - -Damit alle Module ihre Oberfläche leicht zusammenstellen können, stellt - das Layoutmodul diverse Elemente zur Verfügung. - Ähnlich dem PEAR-Paket HTML_Quickform stellt es über eine objektorientiert - programmierte Schnittstelle Methoden zur Verfügung, mit denen sich die - Daten der Oberflächenelemente manipulieren lassen. - Das endgültige Design der Oberfläche wird dann nur noch in der zentralen - Template-Datei definiert, die für jedes Element das Aussehen bestimmt. - Damit verfügen alle Module über ein einheitliches Aussehen. -\layout Subsection - -Programmierung der Schnittstelle -\layout Standard - -Die Schnittstelle besteht aus einer Vielzahl an Elementen. - Diese sind über eine Objekthierarchie miteinander verwandt. - Das zentrale Objekt stellt Methoden zur Verfügung, um beliebige Elemente - zu erstellen. - Sollen diese im weiteren Verlauf des Modules noch modifiziert werden, kann - das zentrale Objekt eine Referenz auf das Objekt des Elementes zurückgeben. - Mit dieser kann dann direkt auf die Methoden des Elements zugegriffen werden. +Filemanager-Modul \layout Subsection -Welche Elemente sollen unterstützt werden? -\layout Standard - -Welche Layoutelemente sollen den Modulen zur Verfügung gestellt werden? - Soll es den Modulen ermöglicht werden weitere eigene Template-Elemente - zu definieren (beispielsweise einen Eintrag im Dateimanager, der ja nun - doch komplexer ist). -\layout Itemize - -Bereiche -\layout Itemize - -Absätze -\layout Itemize - -Listen -\begin_deeper -\layout Itemize - -Listenelemente -\end_deeper -\layout Itemize - -Formulare (mit PEAR::HTML_QuickForm) -\begin_deeper -\layout Itemize - -input (hidden, text, password, checkbox, radio) -\layout Itemize - -textarea -\layout Itemize - -Buttons -\end_deeper -\layout Itemize - -Bilder/Logos -\layout Itemize - -Menüstrukturen +Virtuelles Dateisystem \layout Subsection -API -\layout Paragraph - -function addElement ($actiondata) -\layout Standard - -function addSubElement ($actiondata) -\layout Paragraph - -function getElement ($actiondata) -\layout Section - -Das Fehler-Modul +Der Dateimanager \layout Subsection -API -\layout Standard - -Coming soon \SpecialChar \ldots{} - -\layout Section - -Das Log-Modul -\layout Standard - -Coming soon \SpecialChar \ldots{} - -\layout Section - -Das Email-Modul -\layout Standard - -Coming soon \SpecialChar \ldots{} - -\layout Section - -Das Konfigurations-Modul -\layout Standard - -Coming soon \SpecialChar \ldots{} - -\layout Section - -Die Benutzerverwaltung -\layout Standard - -Coming soon \SpecialChar \ldots{} - -\layout Chapter - -Installation -\layout Section - -Vorraussetzungen -\layout Standard - -Folgende PEAR-Pakete werden benötigt -\layout Itemize - -XML_Tree -\begin_deeper -\layout Itemize - -XML_Parser -\end_deeper -\layout Section - -Archiv entpacken -\layout Standard - -Coming soon \SpecialChar \ldots{} - -\layout Section - -Rechtevergabe -\layout Standard - -Folgende Dateien müssen Lese- und Schreibrechte für PHP besitzen: -\layout Chapter - -Konfiguration -\layout Standard - -Coming soon \SpecialChar \ldots{} - +Der Dateieditor \layout Chapter Anhang |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:28
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/log In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699/modules/log Modified Files: class.module_log.php Log Message: several changes Index: class.module_log.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/log/class.module_log.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_log.php 4 Jun 2004 11:11:58 -0000 1.3 +++ class.module_log.php 4 Jun 2004 11:32:08 -0000 1.4 @@ -2,6 +2,8 @@ /** * The logging-module * +* <b>License</b> +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -26,6 +28,9 @@ **/ /* * $Log$ +* Revision 1.4 2004/06/04 11:32:08 mjahn +* several changes +* * Revision 1.3 2004/06/04 11:11:58 mjahn * several changes * |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:28
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699/modules/layout Modified Files: class.module_layout.php Log Message: several changes Index: class.module_layout.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/class.module_layout.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.module_layout.php 4 Jun 2004 11:11:58 -0000 1.5 +++ class.module_layout.php 4 Jun 2004 11:32:08 -0000 1.6 @@ -1,9 +1,9 @@ <?php /** -* the layout-module is eventbased and creates the layout from a tree of layout-elements. +* The layout-module is eventbased and creates the layout from a tree of layout-elements. * These elements contain all the attributes to generate the output. * -* License GPL +* <b>License GPL</b> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.6 2004/06/04 11:32:08 mjahn +* several changes +* * Revision 1.5 2004/06/04 11:11:58 mjahn * several changes * @@ -52,22 +55,15 @@ /** -* standard-class -* -* <p>overview of the events <b>used</b> by this module</p> -* <ul> -* <li><b>LAYOUT_ADD_ELEMENT</b> adds a layout-element at the end of the element-list</li> -* <li><b>DISPLAY</b> displays the content of the modules</li> -* </ul> +* Layout-class * -* <p>overview of the events <b>provided</b> by this module</p> +* <p>Overview about the events <b>provided</b> by this module</p> * <ul> -* <li><b>DISPLAY_GET_CONTENT</b> let the modules create their layout by using the event -* LAYOUT_ADD_ELEMENT</li> -* <li><b>DISPLAY_GET_CONTENTBAR</b> let the modules create their layout for the statusbar -* by using the event LAYOUT_ADD_ELEMENT</li> -* <li><b>DISPLAY_GET_ERRORS</b> let the modules create their layout for error-messages -* using the event LAYOUT_ADD_ELEMENT</li> +* <li><b>DISPLAY_GET_MENU_MAIN</b> let the modules create their main menu</li> +* <li><b>DISPLAY_GET_MENU_SUB</b> let the modules create their sub menu</li> +* <li><b>DISPLAY_GET_CONTENT</b> let the modules create their content</li> +* <li><b>DISPLAY_GET_STATUSBAR</b> let the modules create their statusbar</li> +* <li><b>DISPLAY_GET_ERROR</b> let the modules create their error-messages</li> * </ul> * * @package admin4phpCMS @@ -82,22 +78,22 @@ var $_elements = array (); /** - * @var array Container für Referenzen auf die Layout-Objekte für den Schnellzugriff + * @var array saves references to the layout-elements as quick-links * @access private **/ var $_ids = array (); /** - * @var array Container für die Template-Daten - * @example /home/martin/devel/admin4phpCMS/modules/layout/layout.xml mitgelieferte Templatedatei + * @var array saves the layout-data + * @example /home/martin/devel/admin4phpCMS/modules/layout/layout.xml included example-file * @access private **/ var $_layout = array (); /** - * Initialisierungsmethode + * Initializing * - * Registriert die vom Modul benötigten Events und Aktionen + * Registers the needed and provided events and actions **/ function init () { $this->_registerEvent ('LAYOUT_ADD_ELEMENT', 'doLayoutAddElement'); @@ -119,11 +115,11 @@ * * <p>$actiondata must provide the following information * <ul> - * <li><b>type</b> type of the element in the file {@link /home/martin/devel/admin4phpCMS/modules/layout/layout.xml Example of the layoutfile)</li> + * <li><b>type</b> type of the element in the file {@link /home/martin/devel/admin4phpCMS/modules/layout/layout.xml Example of the layoutfile})</li> * <li><b>id</b> unique id of the element</li> * </ul> * - * @param array $actionhandler Daten des einzufügenden Elementes + * @param array $actionhandler data of the element to insert **/ function addElement (&$actiondata) { @@ -147,7 +143,7 @@ } /** - * generate the output for the framework + * Generate output for the framework * * @param array $actionhandler **/ @@ -222,7 +218,7 @@ } /** - * displays an array of elements + * Displays an array of elements * * This function walks recursively through the element-structure and parses the output of any element. * @@ -257,7 +253,7 @@ } /** - * displays a single element + * Displays a single element * * $element['_type'] specifies, which template is used for displaying this element * @@ -291,7 +287,7 @@ /** - * Einlesen der Templatedatei + * Parse the template-file * * @access private **/ @@ -323,7 +319,7 @@ /** - * save the templatedata into the xml-file + * Save the templatedata into the xml-file * * @access private **/ |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:28
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699/modules/config Modified Files: class.module_config.php Log Message: several changes Index: class.module_config.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/class.module_config.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module_config.php 4 Jun 2004 11:11:57 -0000 1.4 +++ class.module_config.php 4 Jun 2004 11:32:08 -0000 1.5 @@ -3,6 +3,8 @@ * The config module manages the configuration-file config.xml and provide its data * to the other modules. * +* <b>License</b> +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,6 +30,9 @@ /* * $Log$ +* Revision 1.5 2004/06/04 11:32:08 mjahn +* several changes +* * Revision 1.4 2004/06/04 11:11:57 mjahn * several changes * @@ -38,7 +43,7 @@ include_once 'XML/Tree.php'; /** -* the config-classe encapsulates the access to the configfile against the framework +* The config-class encapsulates the access to the configfile against the framework * * @package admin4phpCMS * @subpackage module_config |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:28
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699/modules/mail Modified Files: class.module_mail.php Log Message: several changes Index: class.module_mail.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/mail/class.module_mail.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_mail.php 4 Jun 2004 11:11:58 -0000 1.3 +++ class.module_mail.php 4 Jun 2004 11:32:08 -0000 1.4 @@ -2,6 +2,8 @@ /** * The email-module * +* <b>License</b> +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -26,6 +28,9 @@ **/ /* * $Log$ +* Revision 1.4 2004/06/04 11:32:08 mjahn +* several changes +* * Revision 1.3 2004/06/04 11:11:58 mjahn * several changes * |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:27
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699/modules/debug Modified Files: class.module_debug.php Log Message: several changes Index: class.module_debug.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug/class.module_debug.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.module_debug.php 4 Jun 2004 11:11:57 -0000 1.1 +++ class.module_debug.php 4 Jun 2004 11:32:08 -0000 1.2 @@ -28,13 +28,16 @@ /* * $Log$ +* Revision 1.2 2004/06/04 11:32:08 mjahn +* several changes +* * Revision 1.1 2004/06/04 11:11:57 mjahn * several changes * */ /** -* class for displaying debug-information +* Class for displaying debug-information * * @package admin4phpCMS * @subpackage module_debug |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:27
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699/modules/user Modified Files: class.module_user.php Log Message: several changes Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_user.php 4 Jun 2004 11:11:58 -0000 1.2 +++ class.module_user.php 4 Jun 2004 11:32:09 -0000 1.3 @@ -4,19 +4,21 @@ * * This module is based on the package PEAR::LiveUser. * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. +* <b>License</b> * -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License @@ -28,6 +30,9 @@ /* * $Log$ +* Revision 1.3 2004/06/04 11:32:09 mjahn +* several changes +* * Revision 1.2 2004/06/04 11:11:58 mjahn * several changes * @@ -38,11 +43,11 @@ include_once 'LiveUser/LiveUser.php'; /** -* Klasse für die Benutzerverwaltung und das Rechtesystem +* Class for user- and permission-managment * * @package admin4phpCMS * @subpackage module_user -* @todo Get the class working correctly +* @todo Get the class work completly **/ class module_user extends module { |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:17
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699/include Modified Files: class.actionhandler.php class.eventhandler.php class.framework.php class.module.php Log Message: several changes Index: class.module.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.module.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module.php 4 Jun 2004 11:11:57 -0000 1.4 +++ class.module.php 4 Jun 2004 11:32:07 -0000 1.5 @@ -2,6 +2,8 @@ /** * basic module-class * +* <b>License</b> +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -25,6 +27,9 @@ **/ /* * $Log$ +* Revision 1.5 2004/06/04 11:32:07 mjahn +* several changes +* * Revision 1.4 2004/06/04 11:11:57 mjahn * several changes * Index: class.actionhandler.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.actionhandler.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.actionhandler.php 4 Jun 2004 11:11:57 -0000 1.4 +++ class.actionhandler.php 4 Jun 2004 11:32:07 -0000 1.5 @@ -5,6 +5,8 @@ * The actionhandler is the connection between the action and the correspondending * registered methods and functions. He also manages the objects of the framework. * +* <b>License</b> +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -22,12 +24,15 @@ * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn -* @version $$ +* @version $Id$ * @package admin4phpCMS **/ /* * $Log$ +* Revision 1.5 2004/06/04 11:32:07 mjahn +* several changes +* * Revision 1.4 2004/06/04 11:11:57 mjahn * several changes * @@ -36,7 +41,7 @@ * */ /** -* actionhandler-class +* Actionhandler-class * * The actionhandler class hides the complete action- and object-managment from the framework. * Index: class.framework.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.framework.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.framework.php 4 Jun 2004 11:11:57 -0000 1.5 +++ class.framework.php 4 Jun 2004 11:32:07 -0000 1.6 @@ -9,6 +9,8 @@ * An integrated user- und permission-managment let administrator work fast * and prevents the normal user from destroying the website * +* <b>License</b> +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -26,12 +28,15 @@ * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn -* @version $$ +* @version $Id$ * @package admin4phpCMS **/ /* * $Log$ +* Revision 1.6 2004/06/04 11:32:07 mjahn +* several changes +* * Revision 1.5 2004/06/04 11:11:57 mjahn * several changes * Index: class.eventhandler.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.eventhandler.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.eventhandler.php 4 Jun 2004 11:11:57 -0000 1.4 +++ class.eventhandler.php 4 Jun 2004 11:32:07 -0000 1.5 @@ -5,6 +5,8 @@ * The eventhandler manages the relations between event and actions. * This is a very flexible way of modularizing the framework. * +* <b>License</b> +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -22,12 +24,15 @@ * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn -* @version $$ +* @version $Id$ * @package admin4phpCMS **/ /* * $Log$ +* Revision 1.5 2004/06/04 11:32:07 mjahn +* several changes +* * Revision 1.4 2004/06/04 11:11:57 mjahn * several changes * |
From: Martin J. <mj...@us...> - 2004-06-04 11:32:16
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16699 Modified Files: index.php Log Message: several changes Index: index.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/index.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- index.php 4 Jun 2004 11:11:56 -0000 1.3 +++ index.php 4 Jun 2004 11:32:07 -0000 1.4 @@ -34,6 +34,9 @@ /* * $Log$ +* Revision 1.4 2004/06/04 11:32:07 mjahn +* several changes +* * Revision 1.3 2004/06/04 11:11:56 mjahn * several changes * @@ -42,6 +45,9 @@ * */ +/** +* Defines wether the debug-module shows its data or not +**/ define ('DEBUG', true); /** |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:09
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/layout Modified Files: class.module_layout.php layout.dtd layout.xml Added Files: layout.css Removed Files: class.layout_phpcms.php Log Message: several changes Index: layout.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.xml 30 May 2004 18:03:41 -0000 1.1 +++ layout.xml 4 Jun 2004 11:11:58 -0000 1.2 @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <!DOCTYPE layout SYSTEM "layout.dtd"> <layout> @@ -7,16 +7,17 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> - <title>Verwaltungsoberfläche</title> + <title>Verwaltungsoberfläche</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="description" content="Administrationsoberfläche von phpCMS" /> <meta name="robots" content="noindex,nofollow" /> <meta name="author" content="Martin Jahn" /> <meta name="language" content="de" /> <meta http-equiv="imagetoolbar" content="no" /> + <link rel="stylesheet" href="./modules/layout/layout.css" type="text/css" /> </head> <body> - <content /> + <content /> </body> </html> ]]> @@ -24,7 +25,7 @@ <block> <![CDATA[ - <div class="block"> + <div id="<id />" class="<class />"> <content /> </div> ]]> @@ -33,16 +34,22 @@ <paragraph> <![CDATA[ - <p> + <p id="<id />" class="<class />"> <content /> </p> ]]> </paragraph> + <hr> + <![CDATA[ + <hr id="<id />" class="<class />" /> + ]]> + </hr> + <headline> <![CDATA[ - <h2> + <h2 id="<id />" class="<class />"> <content /> </h2> ]]> @@ -51,16 +58,14 @@ <image> <![CDATA[ - <div> - <img src="<file />" width="<width />" height="<height />" title="<title />" alt="Bild"> - </div> + <img src="<src />" width="<width />" height="<height />" title="<title />" alt="<alt />"> ]]> </image> <form> <![CDATA[ - <form id="<id />" name="<name />" enctype="x-form/multipart"> + <form id="<id />" name="<name />" method="<method />" enctype="x-form/multipart"> <content /> </form> ]]> @@ -143,19 +148,10 @@ </form_button> - <menu_main> - <![CDATA[ - <ul id="menu"> - <entries /> - </ul> - ]]> - </menu_main> - - <menu_main_entry> <![CDATA[ - <li class="<status />"> - <a href="<link />"> + <li class="<class />" id="<id />"> + <a href="?moduleid=<module />&<params />"> <name /> </a> </li> @@ -163,24 +159,41 @@ </menu_main_entry> - <menu_sub> + <ulist> <![CDATA[ - <ul> - <entries /> + <ul id="<id />" class="<class />"> + <content /> </ul> ]]> - </menu_sub> + </ulist> <menu_sub_entry> <![CDATA[ - <li class="<status />"> - <a href="<link />"> - <name /> - </a> + <li class="<class />" id="<id />"> + <a href="?moduleid=<module />&action=<action />&<param />"> + <name /> + </a> </li> ]]> </menu_sub_entry> + + + <list_entry> + <![CDATA[ + <li class="<class />"> + <content /> + </li> + ]]> + </list_entry> + + + <fm_file_entry> + <![CDATA[ + + ]]> + + </fm_file_entry> </layout> \ No newline at end of file Index: class.module_layout.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/class.module_layout.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module_layout.php 30 May 2004 18:03:41 -0000 1.4 +++ class.module_layout.php 4 Jun 2004 11:11:58 -0000 1.5 @@ -1,25 +1,26 @@ <?php /** -* Das Layout-Modul erzeugt durch Ereignisse gesteuert einen Baum aus Objekten. -* Diese Objekte repräsentieren die unterschiedlichen Elemente, die ausgegeben -* werden können. +* the layout-module is eventbased and creates the layout from a tree of layout-elements. +* These elements contain all the attributes to generate the output. * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. +* License GPL * -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> -* @license GPL +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id$ * @package admin4phpCMS @@ -29,6 +30,9 @@ /* * $Log$ +* Revision 1.5 2004/06/04 11:11:58 mjahn +* several changes +* * Revision 1.4 2004/05/30 18:03:41 mjahn * restructuring of some files * @@ -37,17 +41,33 @@ * Revision 1.2 2004/05/30 03:48:55 mjahn * test */ + /** -* include the layout-class +* include the PEAR::XML_Tree-class for parsing the layout.xml-file +* +* There is a little bug in the Node.php in this package. It replaces the entities '<', '>', '"' and '''. +* With this the output is not interpretable for clients **/ -include_once (dirname (__FILE__).'/class.layout_phpcms.php'); +include_once ('XML/Tree.php'); + /** -* Standard-Klasse des Layout-Modules +* standard-class * -* <p>Ãbersicht über die von diesem Modul verwendete Events</p> +* <p>overview of the events <b>used</b> by this module</p> * <ul> -* <li><b>LAYOUT_ADD_ELEMENT</b> fügt ein Layout-Element zum Dokument hinzu.</li> +* <li><b>LAYOUT_ADD_ELEMENT</b> adds a layout-element at the end of the element-list</li> +* <li><b>DISPLAY</b> displays the content of the modules</li> +* </ul> +* +* <p>overview of the events <b>provided</b> by this module</p> +* <ul> +* <li><b>DISPLAY_GET_CONTENT</b> let the modules create their layout by using the event +* LAYOUT_ADD_ELEMENT</li> +* <li><b>DISPLAY_GET_CONTENTBAR</b> let the modules create their layout for the statusbar +* by using the event LAYOUT_ADD_ELEMENT</li> +* <li><b>DISPLAY_GET_ERRORS</b> let the modules create their layout for error-messages +* using the event LAYOUT_ADD_ELEMENT</li> * </ul> * * @package admin4phpCMS @@ -56,7 +76,7 @@ class module_layout extends module { /** - * @var array Container für die Objekthierarchie, die das Layout repräsentiert + * @var array saves the object-hierarchie of the layout-elements * @access private **/ var $_elements = array (); @@ -78,66 +98,198 @@ * Initialisierungsmethode * * Registriert die vom Modul benötigten Events und Aktionen - * @access public **/ function init () { $this->_registerEvent ('LAYOUT_ADD_ELEMENT', 'doLayoutAddElement'); + $this->_registerEvent ('DISPLAY_PARSE_MENU_MAIN', 'doParseMenuMain'); + $this->_registerEvent ('DISPLAY_PARSE_STATUSBAR', 'doParseStatusbar'); + $this->_registerEvent ('DISPLAY_PARSE_MENU_SUB', 'doParseMenuSub'); + $this->_registerEvent ('DISPLAY_PARSE_ERROR', 'doParseError'); + $this->_registerEvent ('DISPLAY_PARSE_CONTENT', 'doParseContent'); + $this->_registerAction ('doLayoutAddElement', 'addElement'); - $this->_registerAction ('doDisplay', 'display'); - $this->_elements =& new layout_phpcms (); + $this->_registerAction ('doDisplay', 'displayLayout'); + + $this->_elements[0] = array ('_type'=>'document', 'id'=>'root'); + } /** - * Fügt der Elementeliste ein neues Element hinzu + * adds an object to the elements-list * - * <p>Das Array $actiondata beinhaltet die Daten für das neue Layout-Objekt</p> + * <p>$actiondata must provide the following information * <ul> - * <li><b>type</b> Typ des Elementes (=Name des Feldes in der Datei layout.xml)</li> - * <li><b>id</b> eindeutige Id des Elementes, dient zur Objekt-Referenzierung</li> + * <li><b>type</b> type of the element in the file {@link /home/martin/devel/admin4phpCMS/modules/layout/layout.xml Example of the layoutfile)</li> + * <li><b>id</b> unique id of the element</li> * </ul> * * @param array $actionhandler Daten des einzufügenden Elementes **/ function addElement (&$actiondata) { - $parent =& $this->_elements; - if (isset ($actiondata['root'])) { - $parent =& $this->_ids[$actiondata['root']]; + + // get a reference to the parental element + $parent =& $this->_elements[0]; + if (isset ($actiondata['_root'])) { + $parent =& $this->_ids[$actiondata['_root']]; } - $id = $actiondata['id']; - $this->_ids[$id] =& $parent->addElement($actiondata); + + $id = ''; + if (!isset ($actiondata['_id'])) { + return false; + } + $this->_ids[$actiondata['_id']] = $actiondata; + + if (isset ($parent['_sub'])) { + $parent['_sub'][] =& $this->_ids[$actiondata['_id']]; + } else { + $parent['_sub'][0] =& $this->_ids[$actiondata['_id']]; + } } /** - * @param string $id Id des gesuchten Objektes - * @return layout_phpcms Referenz auf das gesuchte Objekt + * generate the output for the framework + * + * @param array $actionhandler **/ - function &getElement ($id) { - if (!isset($this->_ids[$id])) { - return false; + function displayLayout (&$actiondata) { + + $this->_readLayoutFile(); + + // set the left content block + $actiondata = array ('_type'=>'block', '_id'=>'menu', 'id'=>'menu', 'name'=>'menu'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // set the phpcms-logo + $actiondata = array ('_type'=>'image', '_root'=>'menu', '_id'=>'logo', 'id'=>'', 'class'=>'', 'src'=>'phpcms.png', 'width'=>'181', 'height'=>'60', 'alt'=>'', 'title'=>'phpCMS-Logo v2'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // set the menu-root + $actiondata = array ('_type'=>'ulist', '_root'=>'menu', '_id'=>'mainmenu', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // get the main-menu-tree + $actiondata = array ('_root'=>'mainmenu'); + $this->_callEvent ('DISPLAY_PARSE_MENU_MAIN', $actiondata); + + // set container for statusbar + $actiondata = array ('_type'=>'block', '_root'=>'menu', '_id'=>'statusbar', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // get the statusbar-entries + $actiondata = array ('_root'=>'statusbar'); + $this->_callEvent ('DISPLAY_PARSE_STATUSBAR', $actiondata); + + // set the copyright-message + $actiondata = array ('_type'=>'paragraph', '_root'=>'menu', '_id'=>'copyright', 'id'=>'', 'class'=>'', 'content'=>'© 2004, Alle Rechte bei phpcms-plugin-Team'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // set right content block + $actiondata = array ('_type'=>'block', '_id'=>'content', 'id'=>'content', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // set the submenu block + $actiondata = array ('_type'=>'ulist', '_id'=>'submenu', 'id'=>'submenu', 'class'=>'', '_root'=>'content'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // get the error-messages + $actiondata = array ('_root'=>'submenu'); + $this->_callEvent ('DISPLAY_PARSE_MENU_SUB', $actiondata); + + // set the error-message block + $actiondata = array ('_type'=>'block', '_id'=>'error', 'id'=>'', 'class'=>'error', '_root'=>'content'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // get the error-messages + $actiondata = array ('_root'=>'error'); + $this->_callEvent ('DISPLAY_PARSE_ERROR', $actiondata); + + // set the content block + $actiondata = array ('_type'=>'block', '_id'=>'inhalt', 'id'=>'', 'class'=>'content', '_root'=>'content'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + // get the content + $actiondata = array ('_root'=>'inhalt'); + $this->_callEvent ('DISPLAY_PARSE_CONTENT', $actiondata); + + /* + echo '<pre>'; + print_r($this->_elements); + echo '</pre>'; + */ + // generate output + echo $this->displayGroup ($this->_elements); + + } + + /** + * displays an array of elements + * + * This function walks recursively through the element-structure and parses the output of any element. + * + * @param array $elements array with the element-arrays + **/ + function displayGroup (&$elements) { + $o = ''; + $num = count ($elements); + for ($i = 0; $i < $num; $i++) { + + // if entry does not exists jump over + if (!isset ($elements[$i])) { + continue; + } + + // check if sub-elements exist + + if (isset ($elements[$i]['_sub']) && is_array ($elements[$i]['_sub'])) { + + // get the content of the sub-elements + $content = $this->displayGroup ($elements[$i]['_sub']); + + // merge the sub-element-content with the params of the element + if (!isset ($elements[$i]['content'])) { + $elements[$i]['content'] = $content; + } + } + + $o .= $this->displayElement ($elements[$i]); } - return $this->_ids[$id]; + return $o; } /** - * Anzeigen der Layout-Felder + * displays a single element * - * @param array $actionhandler + * $element['_type'] specifies, which template is used for displaying this element + * + * @param array $element array with all the attributes for the element **/ - function display (&$actiondata) { - $this->_readLayoutFile (); + function displayElement (&$element) { - if (!isset ($this->_elements->elements) || !is_array ($this->_elements->elements)) { - return false; + // check if there is a layout-template for the type of this element + if (!isset ($element['_type']) || !isset ($this->_layout[$element['_type']])) { + return ''; + } + + if (!isset($element['content'])) { + $element['content'] = ''; } - $o = ''; - for ($i = 0; $i < count($this->_elements->elements); $i++) { - $o .= $this->_elements->elements[$i]->display($this->_layout); + // create the search- and replace-arrays + $replace = $search = array(); + foreach (array_keys ($element) as $id) { + if (substr ($id, 0, 1) == '_') { + continue; + } + $search[] = '<'.$id.' />'; + $replace[] = $element[$id]; } - echo str_replace ('<content />', $o, $this->_layout['document']); + return str_replace ($search, $replace, $this->_layout[$element['_type']]."\n"); } + + + /** * Einlesen der Templatedatei * @@ -153,20 +305,38 @@ } if (!file_exists ($layoutfile)) { - unset ($this->configfile); $actiondata = array ('errortext'=>'Layoutdatei konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } $XML =& new XML_Tree ($layoutfile); - $layout =& $XML->getTreeFromFile (); - foreach ($layout->children as $a) { - if (!isset($a->name)) { + $this->_layoutdata =& $XML->getTreeFromFile (); + $num = count ($this->_layoutdata->children); + for ($i = 0; $i < $num; $i++) { + if (!isset($this->_layoutdata->children[$i]->name)) { continue; } - $this->_layout[$a->name] =& $a->content; + $this->_layout[$this->_layoutdata->children[$i]->name] =& $this->_layoutdata->children[$i]->content; + } + } + + + /** + * save the templatedata into the xml-file + * + * @access private + **/ + function _saveLayoutFile () { + $layoutfile = dirname(__FILE__).'/layout.xml'; + + $fh = fopen ($layoutfile, 'wb'); + if ($fh === false) { + $actiondata = array ('errortext'=>'Layoutdatei konnte nicht geöffnet werden!'); + $this->_callEvent ('ERROR_NOTICE', $actiondata); } + fwrite ($fh, $this->_layoutdata->get()); + fclose ($fh); } } --- class.layout_phpcms.php DELETED --- Index: layout.dtd =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/layout/layout.dtd,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- layout.dtd 30 May 2004 18:03:41 -0000 1.1 +++ layout.dtd 4 Jun 2004 11:11:58 -0000 1.2 @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!ELEMENT layout ( + document, block, paragraph, headline, @@ -18,11 +19,12 @@ menu_sub )> -<!ELEMENT form (#PCDATA)> +<!ELEMENT document (#PCDATA)> <!ELEMENT block (#PCDATA)> <!ELEMENT paragraph (#PCDATA)> <!ELEMENT headline (#PCDATA)> <!ELEMENT image (#PCDATA)> +<!ELEMENT form (#PCDATA)> <!ELEMENT form_input_hidden (#PCDATA)> <!ELEMENT form_input_text (#PCDATA)> <!ELEMENT form_input_password (#PCDATA)> --- NEW FILE: layout.css --- html, body { width:100%; font-size:100.01%; padding:0; border:0; margin:0; background:#fff; } #content { margin-left:190px; padding:0; } .content { padding:0.5em; } #menu { position:fixed; top:0; left:0; height:100%; width:190px; margin:0; padding:0; border-right:0.1em solid #000; border-bottom:0.1em solid #000; } #menu ul { list-style-type:none; padding:0; margin:0; } #menu ul li { padding:0.2em; margin:0.1em; } #menu ul li ul { margin-left:1em; } #menu ul li ul li { margin-left:1em; } .content { background:#fff; } label span { display:block; } textarea { width:95%; height:10em; } #submenu { padding: 3px 0; margin: 0; border-bottom: 1px solid #778; font: bold 12px Verdana, sans-serif; } #submenu li { list-style: none; margin: 0; display: inline; } #submenu li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; border-bottom: none; background: #DDE; text-decoration: none; } #submenu li a:link { color: #448; } #submenu li a:visited { color: #667; } #submenu li a:hover { color: #000; background: #AAE; border-color: #227; } #submenu li#current a { background: white; border-bottom: 1px solid white; } |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:08
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/filemanager Added Files: class.module_filemanager.php Log Message: several changes --- NEW FILE: class.module_filemanager.php --- <?php /** * The filemanager-module * * This module is based on the package PEAR::LiveUser. * * <b>License</b> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id: class.module_filemanager.php,v 1.1 2004/06/04 11:11:57 mjahn Exp $ * @package admin4phpCMS * @subpackage module_filemanager **/ /* * $Log: class.module_filemanager.php,v $ * Revision 1.1 2004/06/04 11:11:57 mjahn * several changes * */ /** * Filemanager-class for administrative work in the filesystem * * @package admin4phpCMS * @subpackage module_filemanager * @todo Get the class working correctly **/ class module_filemanager extends module { function init () { // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doProcess', 'process'); $this->_registerAction ('doParseMenuMain', 'getMenuMain'); $this->_registerAction ('doParseStatusbar', 'getContentBar'); $this->_registerAction ('doParseMenuSub', 'getMenuSub'); $this->_registerAction ('doParseContent', 'getContent'); } function parseParam (&$actiondata) { $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'filemanager'); $this->action = ''; if (isset ($actiondata['request']['action'])) { $this->action = $actiondata['request']['action']; } } function process (&$actiondata) { } function getMenuMain (&$actiondata) { $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'filemanager', '_root'=>'mainmenu', 'id'=>'', 'class'=>'', 'params'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } function getMenuSub (&$actiondata) { if (!$this->display) { return true; } $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'files', 'id'=>'', 'class'=>'', 'param'=>'', 'action'=>''); if ($this->action == '') { $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Hochladen', 'module'=>'filemanager', '_id'=>'uploads', 'action'=>'upload', 'id'=>'', 'class'=>'', 'params'=>''); if ($this->action == 'upload') { $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Backups', 'module'=>'filemanager', '_id'=>'backups', 'action'=>'backup', 'id'=>'', 'class'=>'', 'params'=>''); if ($this->action == 'backup') { $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Editor', 'module'=>'filemanager', '_id'=>'editor', 'action'=>'editor', 'id'=>'', 'class'=>'', 'params'=>''); if ($this->action == 'editor') { $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } function getContent (&$actiondata) { } function getContentBar (&$actiondata) { } } ?> |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:08
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/mail Modified Files: class.module_mail.php Log Message: several changes Index: class.module_mail.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/mail/class.module_mail.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_mail.php 30 May 2004 18:03:42 -0000 1.2 +++ class.module_mail.php 4 Jun 2004 11:11:58 -0000 1.3 @@ -1,5 +1,44 @@ <?php +/** +* The email-module +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* @author Martin Jahn <mj...@us...> +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright Copyright (c) 2004, Martin Jahn +* @version $Id$ +* @package admin4phpCMS +* @subpackage module_mail +* +**/ +/* +* $Log$ +* Revision 1.3 2004/06/04 11:11:58 mjahn +* several changes +* +* +*/ +/** +* Email-class +* +* @package admin4phpCMS +* @subpackage module_mail +* @todo Get the class working correctly +**/ class module_mail extends module { function init () { |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:08
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/error In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/error Modified Files: class.module_error.php Log Message: several changes Index: class.module_error.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/error/class.module_error.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_error.php 30 May 2004 18:03:41 -0000 1.2 +++ class.module_error.php 4 Jun 2004 11:11:57 -0000 1.3 @@ -1,4 +1,45 @@ <?php +/** +* The errorhandler-module +* +* <b>License</b> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* @author Martin Jahn <mj...@us...> +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright Copyright (c) 2004, Martin Jahn +* @version $Id$ +* @package admin4phpCMS +* @subpackage module_error +**/ + +/* +* $Log$ +* Revision 1.3 2004/06/04 11:11:57 mjahn +* several changes +* +*/ + +/** +* Errorhandler-class +* +* @package admin4phpCMS +* @subpackage module_error +* @todo Get the class working correctly +**/ class module_error extends module { function init () { |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:08
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/include Modified Files: class.actionhandler.php class.eventhandler.php class.framework.php class.module.php Log Message: several changes Index: class.module.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.module.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module.php 30 May 2004 18:03:40 -0000 1.3 +++ class.module.php 4 Jun 2004 11:11:57 -0000 1.4 @@ -1,23 +1,23 @@ <?php /** -* Die Basis-Klasse des Modulsystems. +* basic module-class * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. * -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> -* @license GPL +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id$ * @package admin4phpCMS @@ -25,12 +25,15 @@ **/ /* * $Log$ +* Revision 1.4 2004/06/04 11:11:57 mjahn +* several changes +* * Revision 1.3 2004/05/30 18:03:40 mjahn * restructuring of some files * */ /** -* Basis-Klasse mit den grundlegenden Eigenschaften und Methoden eines Modules +* basic class with fundamental properties and methods * * @package admin4phpCMS * @access private Index: class.actionhandler.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.actionhandler.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.actionhandler.php 30 May 2004 18:03:40 -0000 1.3 +++ class.actionhandler.php 4 Jun 2004 11:11:57 -0000 1.4 @@ -2,26 +2,25 @@ /** * Actionhandler * -* Der Actionhandler stellt die Verbindung zwischen einer Aktion und den darauf registrierten -* Funktionsaufrufen her. Gleichzeitig kümmert sich der Actionhandler um die Verwaltung der -* Objekte im Framework. +* The actionhandler is the connection between the action and the correspondending +* registered methods and functions. He also manages the objects of the framework. * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. * -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> -* @license GPL +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $$ * @package admin4phpCMS @@ -29,15 +28,17 @@ /* * $Log$ +* Revision 1.4 2004/06/04 11:11:57 mjahn +* several changes +* * Revision 1.3 2004/05/30 18:03:40 mjahn * restructuring of some files * */ /** -* Actionhandler-Klasse +* actionhandler-class * -* Die Actionhandler-Klasse kapselt die komplette Verwaltung der Aktionen und die Objektverwaltung -* gegenüber der Framework-Klasse +* The actionhandler class hides the complete action- and object-managment from the framework. * * @package admin4phpCMS * @see framework @@ -46,7 +47,7 @@ class actionHandler { /** - * assoziatives Array mit den Relationen Action => Array (Klasse1 => Methode1, Klasse2 => Methode2) + * saves the relations action => array (class => method) * * @var array * @access private @@ -54,7 +55,7 @@ var $_actions = array (); /** - * Array mit den Relationen Klassenname -> Objekt + * saves the relations classname -> object * * In dieser Variablen werden die instanzierten Objekte gespeichert. * Diese können über den Index "Klassenname" aufgefunden werden. @@ -65,7 +66,7 @@ var $_objects = array (); /** - * Konstruktor der Actionhandler-Klasse + * constructor * * @ignore **/ @@ -74,7 +75,7 @@ } /** - * Konstruktor der Actionhandler-Klasse + * constructor * * @ignore **/ @@ -85,13 +86,13 @@ } /** - * gewünschte Aktion ausführen + * execute the action * - * Diese Funktion wird ausschlieÃlich über den Eventhandler aufgerufen. + * This function is called exclusively over the eventhandler-class. * - * @param string $actionname Name der auszuführenden Aktion - * @param array $actiondata Daten für die Aktion - * @return boolean Erfolg oder MiÃerfolg + * @param string $actionname name of the action + * @param array $actiondata parameters of the action + * @return boolean status of success **/ function action ($actionname, &$actiondata) { if (!isset($this->_actions[$actionname])) { @@ -108,13 +109,13 @@ } /** - * Aktion auf eine Funktion registrieren + * registers function onto action * - * Diese Funktion wird ausschlieÃlich über den Eventhandler aufgerufen. - * Die übergebene Methode $actiondata['method'] einer Klasse $actiondata['class'] - * wird auf die Aktion $actiondata['actionname'] registriert. + * This function is called exclusively over the eventhandler-class. + * The method $actiondata['method'] of the class $actiondata['class'] + * will be registered onto the action $actiondata['actionname'] * - * @param array $actiondata Daten für die zu registrierende Aktion + * @param array $actiondata parameters for the action **/ function ®isterAction (&$actiondata) { $actionname = $actiondata['actionname']; @@ -128,17 +129,17 @@ } /** - * Methode zum Laden von zusätzlichen Modulen + * module-loader * - * Diese Funktion wird ausschlieÃlich über den Eventhandler aufgerufen. - * Der Parameter $actiondata muà foglende Daten über das Modul bereit stellen. + * This function is called exclusively over the eventhandler-class. + * The parameter $actiondata has to provide the following information about the module * <ul> - * <li><b>filename</b> der Pfad zur Moduldatei (absoluter Pfad im Dateisystem)</li> - * <li><b>class</b> Name der Modulklasse</li> + * <li><b>filename</b> path to the module-file</li> + * <li><b>class</b> name of the module-class</li> * </ul> * - * @param array $actiondata Daten über das zu ladende Modul - * @return boolean Erfolg oder MiÃerfolg + * @param array $actiondata parameters for the module to load + * @return boolean status of success **/ function &loadModule (&$actiondata) { $modulefile = $actiondata['filename']; @@ -154,21 +155,20 @@ return false; } - require_once ($modulefile); + include_once ($modulefile); $this->_objects[$moduleclass] =& $this->__getInstance ($moduleclass); return true; } /** - * Objecthandler + * object-handler * - * Diese Methode verwaltet Objekte von sämtlichen Modulen und gibt eine Referenz - * auf ein Objekt der gewünschten Klasse zurück. existiert noch kein solches Objekt, - * wird es angelegtm initialisiert und im Objektarray gespeichert + * This method manages the objects of all modules. It returns a reference to an object of asked class. + * If there is no such object yet, it was created and saved in the array $this->_objects * - * @param string $classname Klasse des gewünschten Objektes - * @return mixed false bei MiÃerfolg, sonst Referenz auf ein Objekt der Klasse $classname + * @param string $classname name of the class + * @return mixed false if unsuccessful, reference to object of type $classname otherwise **/ function &__getInstance (&$classname) { if (isset ($this->_objects[$classname])) { Index: class.framework.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.framework.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.framework.php 30 May 2004 18:03:40 -0000 1.4 +++ class.framework.php 4 Jun 2004 11:11:57 -0000 1.5 @@ -1,30 +1,30 @@ <?php /** -* Admin4phpCMS - modulare Administrationsoberfläche +* admin4phpCMS - a modulare administration * -* Diese Software ist ein modulares Framework für Module aller Art. -* Zweck der Software ist es, die Administration einer Website durch verschiedene -* Module für den Administrator so einfach wie möglich zu halten. +* This software is a modulare framework for modules of any kind. +* The purpose of this software is, to make the administration of a website +* as easy as it can be with different modules, * -* Ein integriertes Benutzer- und Rechtemanagment sorgt für den ungehinderten Zugriff -* für den Administrator und verhindert, daà DAUs die Website abschieÃen. +* An integrated user- und permission-managment let administrator work fast +* and prevents the normal user from destroying the website * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. * -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> -* @license GPL +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $$ * @package admin4phpCMS @@ -32,6 +32,9 @@ /* * $Log$ +* Revision 1.5 2004/06/04 11:11:57 mjahn +* several changes +* * Revision 1.4 2004/05/30 18:03:40 mjahn * restructuring of some files * @@ -39,7 +42,7 @@ /** -* Einbinden der notwendigen Dateien +* include the necessary files **/ include_once (dirname(__FILE__).'/class.actionhandler.php'); include_once (dirname(__FILE__).'/class.eventhandler.php'); @@ -63,6 +66,8 @@ $this->eventhandler->event ('REGISTER_EVENT', $actiondata); $actiondata = array ('eventname'=>'PARSE_MENU', 'eventaction'=>'doParseMenu'); $this->eventhandler->event ('REGISTER_EVENT', $actiondata); + $actiondata = array ('eventname'=>'PROCESS', 'eventaction'=>'doProcess'); + $this->eventhandler->event ('REGISTER_EVENT', $actiondata); $actiondata = array ('eventname'=>'DISPLAY_GET_CONTENTS', 'eventaction'=>'doGetContents'); $this->eventhandler->event ('REGISTER_EVENT', $actiondata); $actiondata = array ('eventname'=>'DISPLAY', 'eventaction'=>'doDisplay'); @@ -100,20 +105,12 @@ } // let the modules parse the URI-params - $actiondata = array ('get'=>$_GET, 'post'=>$_POST, 'request'=>$_REQUEST); + $actiondata = array ('get'=>$_GET, 'post'=>$_POST, 'request'=>$_REQUEST, 'cookie'=>$_COOKIE); $this->eventhandler->event ('PARSE_PARAM', $actiondata); // let the modules do their work $actiondata = array (); $this->eventhandler->event ('PROCESS', $actiondata); - - // get the menudata from the modules - $actiondata = array (); - $this->eventhandler->event ('PARSE_MENU', $actiondata); - - // let the modules parse their output - $actiondata = array (); - $this->eventhandler->event ('DISPLAY_GET_CONTENTS', $actiondata); // let the modules print their output $actiondata = array (); Index: class.eventhandler.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/include/class.eventhandler.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.eventhandler.php 30 May 2004 18:03:40 -0000 1.3 +++ class.eventhandler.php 4 Jun 2004 11:11:57 -0000 1.4 @@ -1,26 +1,26 @@ <?php /** -* Eventhandler +* Eventhandler * -* Der Eventhandler stellt die Verbindung zwischen einem Event und der richtigen Aktion her. -* Damit ist eine sehr flexible Modularisierung des Frameworks möglich. +* The eventhandler manages the relations between event and actions. +* This is a very flexible way of modularizing the framework. * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. * -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> -* @license GPL +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $$ * @package admin4phpCMS @@ -28,14 +28,17 @@ /* * $Log$ +* Revision 1.4 2004/06/04 11:11:57 mjahn +* several changes +* * Revision 1.3 2004/05/30 18:03:40 mjahn * restructuring of some files * */ /** -* Eventhandler-Klasse +* eventhandler-class * -* Die Eventhandler-Klasse kapselt die Verwaltung der Events gegenüber dem Framework +* The eventhandler-class hides the managment of the events and correspondending action from the framework * * @see framework * @see actionHandler @@ -43,12 +46,16 @@ **/ class eventHandler { + /** + * @var array saves the events anmd their relation to the actions + * @access private + **/ var $_events = array (); /** * Konstruktor * - * @param actionhandler $actionhandler Referenz zum Actionhandler-Objekt + * @param actionhandler $actionhandler saves the reference to the actionhandler-object * @ignore **/ function eventHandler (&$actionhandler) { @@ -56,9 +63,9 @@ } /** - * Konstruktor + * constructor * - * @param actionhandler $actionhandler Referenz zum Actionhandler-Objekt + * @param actionhandler $actionhandler referenze to the actionhandler-object * @ignore **/ function __construct (&$actionhandler) { @@ -71,33 +78,33 @@ } /** - * Die Eventfunktion dient zum Ausführen von Events + * execute event * - * @param string $eventname Name des auszulösenden Events - * @param array $actiondata Parameter für die zum Event gehörende Action - * @return boolean Erfolg oder MiÃerfolg + * @param string $eventname name of the event + * @param array $actiondata parameter for the event + * @return boolean status of success **/ function &event ($eventname, &$actiondata) { - //echo '<p>Event: '.$eventname.'</p>'; if (!isset($this->_events[$eventname])) { return false; } $action = $this->_events[$eventname]; + //echo '<p>Event: '.$eventname.'-> '.$action.'</p>'; return $this->_actionHandler->action($action, $actiondata); } /** - * Registriert eine Action auf ein Event + * registers an action onto an event * - * Funktionsparameter - * <ul> - * <li><b>string $actiondata['eventname']</b> Name des Events</li> - * <li><b>string $actionname['eventaction']</b> Name der zum Event gehörenden Aktion</li> + * parameter: + * <ul> + * <li><b>string $actiondata['eventname']</b> name of the event</li> + * <li><b>string $actionname['eventaction']</b> name of the action</li> * </ul> * - * @param array $actiondata Parameter für die zum Event gehörende Action - * @return boolean Erfolg oder MiÃerfolg + * @param array $actiondata parameters for event and action + * @return boolean status of success **/ function ®isterEvent (&$actiondata) { $eventname = $actiondata['eventname']; |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:08
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/log In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/log Modified Files: class.module_log.php Log Message: several changes Index: class.module_log.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/log/class.module_log.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_log.php 30 May 2004 18:03:42 -0000 1.2 +++ class.module_log.php 4 Jun 2004 11:11:58 -0000 1.3 @@ -1,5 +1,43 @@ <?php +/** +* The logging-module +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* @author Martin Jahn <mj...@us...> +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright Copyright (c) 2004, Martin Jahn +* @version $Id$ +* @package admin4phpCMS +* @subpackage module_log +* +**/ +/* +* $Log$ +* Revision 1.3 2004/06/04 11:11:58 mjahn +* several changes +* +*/ +/** +* Logging-class +* +* @package admin4phpCMS +* @subpackage module_log +* @todo Get the class working correctly +**/ class module_log extends module { |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:08
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/user Modified Files: class.module_user.php Log Message: several changes Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.module_user.php 30 May 2004 18:03:43 -0000 1.1 +++ class.module_user.php 4 Jun 2004 11:11:58 -0000 1.2 @@ -1,15 +1,63 @@ <?php +/** +* User- and permissionmanagment +* +* This module is based on the package PEAR::LiveUser. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* @author Martin Jahn <mj...@us...> +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright Copyright (c) 2004, Martin Jahn +* @version $Id$ +* @package admin4phpCMS +* @subpackage module_user +**/ -require_once 'LiveUser/LiveUser.php'; +/* +* $Log$ +* Revision 1.2 2004/06/04 11:11:58 mjahn +* several changes +* +*/ +/** +* include necessary files +**/ +include_once 'LiveUser/LiveUser.php'; +/** +* Klasse für die Benutzerverwaltung und das Rechtesystem +* +* @package admin4phpCMS +* @subpackage module_user +* @todo Get the class working correctly +**/ class module_user extends module { + /** + * @var object Benutzer- und Rechtemanagment-Objekt + * @access private + **/ + var $_USER; + function init () { $liveuserConfig = array( 'session' => array('name' => 'PHPSESSID','varname' => 'loginInfo'), 'login' => array('username' => 'handle', 'password' => 'passwd'), 'cookie' => array('name' => 'loginInfo', 'path' => '/', 'domain' => 'localhost', 'lifetime' => 60), - 'autoInit' => false, + 'autoInit' => true, 'authContainers' => array(0 => array('type' => 'XML', 'file' => dirname(__FILE__).'/Auth_XML.xml', 'loginTimeout' => 60*30, @@ -23,42 +71,132 @@ 'file' => dirname(__FILE__).'/Perm_XML.xml' ) ); - $this->USER = LiveUser::factory($liveuserConfig); - $this->USER->init(); + $this->_USER = LiveUser::factory($liveuserConfig); + // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doProcess', 'process'); - $this->_registerAction ('doParseMenu', 'getMenu'); - $this->_registerAction ('doGetContents', 'getContent'); + $this->_registerAction ('doParseMenuMain', 'getMenuMain'); + $this->_registerAction ('doParseStatusbar', 'getContentBar'); + $this->_registerAction ('doParseMenuSub', 'getMenuSub'); + $this->_registerAction ('doParseContent', 'getContent'); + + // provide my own actions to the eventhandler $this->_registerEvent ('USER_GET_DATA', 'doGetUserData'); $this->_registerAction ('doGetUserData', 'getUserData'); $this->_registerEvent ('USER_SET_DATA', 'doSetUserData'); $this->_registerAction ('doSetUserData', 'setUserData'); + $this->_registerEvent ('USER_GET_STATUS', 'doGetUserStatus'); + $this->_registerAction ('doGetUserStatus', 'getUserStatus'); } function parseParam (&$actiondata) { - if (isset ($actiondata['_post']['logout'])) { - $this->USER->logout; - } elseif (isset ($actiondata['_get']['logout'])) { - $this->USER->logout (); + $logout = false; + $username = ''; + $password = ''; + if (isset ($actiondata['post']['logout'])) { + $logout = true; + } elseif (isset ($actiondata['get']['logout'])) { + $logout = true; + } + $passwd = ''; + if (isset ($actiondata['post']['passwd'])) { + $passwd = $actiondata['post']['passwd']; + $logout = false; + } + $username = ''; + if (isset ($actiondata['post']['handle'])) { + $username = $actiondata['post']['handle']; + $logout = false; } + $this->_USER->init($username, $password, $logout); + + + $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'user'); + + $this->action = ''; + if (isset ($actiondata['request']['action'])) { + $this->action = $actiondata['request']['action']; + } + } function process (&$actiondata) { } - function getMenu (&$actiondata) { + function getUserStatus (&$actiondata) { + $actiondata ['loggedin'] = $this->_USER->isLoggedIn (); } - function getContent (&$actiondata) { - if ($this->USER->isLoggedIn ()) { - return true; + function getMenuMain (&$actiondata) { + $root = $actiondata['_root']; + $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Benutzerverwaltung', 'module'=>'user', '_id'=>'usermenu', '_root'=>'mainmenu', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + } + + function getMenuSub (&$actiondata) { + if (!$this->_USER->isLoggedIn ()) { + return true; } - $actiondata = array ('id'=>'1', 'type'=>'paragraph', 'content'=>'Irgendein komischer Inhalt steht hier drin :);)'); + if (!$this->display) { + return true; + } + + $root = $actiondata['_root']; + + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Benutzerübersicht', 'module'=>'user', '_id'=>'useroverview', 'action'=>'', 'id'=>'', 'class'=>'', 'param'=>''); + if ($this->action == '') { + $actiondata['id'] = 'current'; + } + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Rechteübersicht', 'module'=>'user', '_id'=>'usermenuchg', 'action'=>'rights', 'id'=>'', 'class'=>'', 'param'=>''); + if ($this->action == 'rights') { + $actiondata['id'] = 'current'; + } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + } + + function getContent (&$actiondata) { + if (!$this->_USER->isLoggedIn ()) { + + $root = $actiondata['_root']; + + $actiondata = array ('_id'=>'benutzerlogin', '_root'=>$root, '_type'=>'headline', 'content'=>'Benutzerlogin', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_id'=>'method', '_type'=>'form_input_hidden', 'value'=>'post', 'name'=>'method','_root'=>'loginform', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_id'=>'handle', '_type'=>'form_input_text', 'label'=>'Benutzername', 'value'=>'Benutzername', 'name'=>'handle','_root'=>'loginform', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_id'=>'passwd', '_type'=>'form_input_password', 'value'=>'', 'label'=>'Passwort', 'name'=>'passwd','_root'=>'loginform', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + + $actiondata = array ('_id'=>'submit', '_type'=>'form_button', 'value'=>'Absenden', 'name'=>'submit','text'=>'Absenden', '_root'=>'loginform', 'id'=>'', 'class'=>''); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + return; + } + if (!$this->display) { + return true; + } } + function getContentBar (&$actiondata) { + if ($this->_USER->isLoggedIn ()) { + + $root = $actiondata['_root']; + + $actiondata = array ('_id'=>'1', '_root'=>$root, '_type'=>'paragraph', 'content'=>$this->_USER->getProperty ('handle').' (<a href="?logout=logout">abmelden</a>)'); + $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + } + + } function getUserData (&$actiondata) { } |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:07
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/docs Modified Files: Benutzerhandbuch.lyx Log Message: several changes Index: Benutzerhandbuch.lyx =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/docs/Benutzerhandbuch.lyx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Benutzerhandbuch.lyx 28 May 2004 12:07:42 -0000 1.3 +++ Benutzerhandbuch.lyx 4 Jun 2004 11:11:56 -0000 1.4 @@ -633,8 +633,15 @@ Vorraussetzungen \layout Standard -Coming soon \SpecialChar \ldots{} +Folgende PEAR-Pakete werden benötigt +\layout Itemize +XML_Tree +\begin_deeper +\layout Itemize + +XML_Parser +\end_deeper \layout Section Archiv entpacken |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:07
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/debug Added Files: class.module_debug.php Log Message: several changes --- NEW FILE: class.module_debug.php --- <?php /** * The debugging-module * * <b>License</b> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn * @version $Id: class.module_debug.php,v 1.1 2004/06/04 11:11:57 mjahn Exp $ * @package admin4phpCMS * @subpackage module_debug **/ /* * $Log: class.module_debug.php,v $ * Revision 1.1 2004/06/04 11:11:57 mjahn * several changes * */ /** * class for displaying debug-information * * @package admin4phpCMS * @subpackage module_debug * @todo Get the class working correctly **/ class module_debug extends module { function init () { $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doProcess', 'process'); $this->_registerAction ('doParseContent', 'getContent'); } function parseParam (&$actiondata) { $this->uri = $actiondata; } function process (&$actiondata) { } function getContent (&$actiondata) { if (DEBUG != true) return; $root = $actiondata['_root']; $actiondata = array ('_id'=>'trennerdebug', '_type'=>'hr', 'id'=>'', 'class'=>'', '_root'=>$root); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $this->uri['events'] =& $this->_event->_events; $this->uri['actions'] =& $this->_event->_actionHandler->_actions; foreach ($this->uri as $type=>$data) { if (!is_array ($data)) { continue; } // check if there is any data in the array if (count ($data) == 0) { continue; } // set the headline $actiondata = array ('_id'=>'request_'.$type, '_type'=>'headline', 'content'=>strtoupper ($type), 'id'=>'', 'class'=>'', '_root'=>$root); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); // set the unordered list $actiondata = array ('_id'=>'list_'.$type, '_type'=>'ulist', 'id'=>'', 'class'=>'', '_root'=>$root); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); // walk through the array-structure foreach ($data as $id=>$value) { if (is_array ($value)) { $value = 'Array ('.join(', ', $value).')'; } $content = '$_'.strtoupper($type).'[\''.$id.'\'] = '.$value; // set the list-entry with content $actiondata = array ('_id'=>$type.$id, '_type'=>'list_entry', 'content'=>$content, '_root'=>'list_'.$type); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } } } function getUserData (&$actiondata) { } function setUserData (&$actiondata) { } } ?> |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:07
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823/modules/config Modified Files: class.module_config.php config.xml Log Message: several changes Index: config.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/config.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- config.xml 30 May 2004 18:03:40 -0000 1.1 +++ config.xml 4 Jun 2004 11:11:57 -0000 1.2 @@ -5,9 +5,12 @@ <config name="userfile" value="Auth_XML.xml" /> <config name="permfile" value="Perm_XML.xml" /> </module> - <module id="layout" name="layout-service" include="class.module_layout.php" class="module_layout"> - <config name="tplfile" value="layout/layout.xml" /> + <module id="layout" name="layout-service" include="class.module_layout.php" class="module_layout" /> + <module id="debug" name="debug-service" include="class.module_debug.php" class="module_debug" /> + <module id="filemanager" name="filemanager" include="class.module_filemanager.php" class="module_filemanager"> + <config name="startupdir" value="/" /> </module> + <module id="error" name="error-service" include="class.module_error.php" class="module_error" /> <module id="mail" name="email-service" include="class.module_mail.php" class="module_mail"> <config name="admin-email" value="ma...@mj..." /> Index: class.module_config.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/class.module_config.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_config.php 30 May 2004 18:03:40 -0000 1.3 +++ class.module_config.php 4 Jun 2004 11:11:57 -0000 1.4 @@ -1,11 +1,80 @@ <?php +/** +* The config module manages the configuration-file config.xml and provide its data +* to the other modules. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* @author Martin Jahn <mj...@us...> +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright Copyright (c) 2004, Martin Jahn +* @version $Id$ +* @package admin4phpCMS +* @subpackage module_config +* +**/ -require_once 'XML/Tree.php'; +/* +* $Log$ +* Revision 1.4 2004/06/04 11:11:57 mjahn +* several changes +* +*/ +/** +* include the PEAR::XML_Tree class +**/ +include_once 'XML/Tree.php'; +/** +* the config-classe encapsulates the access to the configfile against the framework +* +* @package admin4phpCMS +* @subpackage module_config +**/ class module_config extends module { - var $configfile; + /** + * @var string path to the configfile + * @access private + **/ + var $_configfile = ''; + + /** + * @var array saves the configuration-data in an array-structur + * @access private + **/ + var $_config = array (); + /** + * registers events and actions provided to the framework + * + * Events: + * <ul> + * <li><b>CONFIG_READ</b> read and parse the configfile + * $actiondata['configfile'] contains the path to the configfile</li> + * <li><b>CONFIG_GET</b> get configuration-data + * $actiondata['module'] contains the id of the module + * $actiondata['config'] returns the configuration of the module + * if no module-id is given, it will return the full configuration-array + * <li><b>CONFIG_SAVE</b> saves the configuration in a file + * $actiondata['configfile'] path to save the config in; + * if no path is given, it saves to configfile from read-method</li> + * <li><b>CONFIG_SET_FILE</b> sets path to configfile + * $actiondata['configfile'] contains the path to configfile</li> + * </ul> + **/ function init () { $this->_registerEvent ('CONFIG_READ', 'doReadConfig'); $this->_registerAction ('doReadConfig', 'readConfig'); @@ -17,53 +86,80 @@ $this->_registerAction ('doSetConfigFile', 'setConfigFile'); } + /** + * read and parse the configfile + * + * @example /home/martin/devel/admin4phpCMS/modules/config/config.xml sample configfile + * @param array $actiondata $actiondata['configfile'] contains the path to the configfile + **/ function readConfig (&$actiondata) { if (isset ($actiondata['configfile'])) { - $this->configfile = $actiondata ['configfile']; + $this->_configfile = $actiondata ['configfile']; } else { - $this->configfile = dirname (__FILE__).'/config.xml'; + $this->_configfile = dirname (__FILE__).'/config.xml'; } - if (!isset($this->configfile)) { + if (!isset($this->_configfile)) { $actiondata = array ('errortext'=>'Konfigurationsdatei konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } - if (!file_exists ($this->configfile)) { - unset ($this->configfile); + if (!file_exists ($this->_configfile)) { + unset ($this->_configfile); $actiondata = array ('errortext'=>'Konfigurationsdatei konnte nicht geladen werden!'); $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } - $XML =& new XML_Tree ($this->configfile); + $XML =& new XML_Tree ($this->_configfile); $configdata =& $XML->getTreeFromFile (); for ($i = 0; $i < count ($configdata->children); $i++) { - $this->config[$configdata->children[$i]->attributes['id']] =& $configdata->children[$i]; + $this->_config[$configdata->children[$i]->attributes['id']] =& $configdata->children[$i]; } return true; } + /** + * get configuration data + * + * $actiondata['module'] contains the id of the module + * $actiondata['config'] return the configuration of the module + * if there is no module-id, it returns the full config-array + * + * @param array $actiondata + **/ function getConfig (&$actiondata) { - if (!isset($actiondata['module']) || !isset ($this->config[$actiondata['module']])) { - $actiondata['config'] =& $this->config; + if (!isset($actiondata['module']) || !isset ($this->_config[$actiondata['module']])) { + $actiondata['config'] =& $this->_config; } else { - $actiondata['config'] =& $this->config[$actiondata['module']]; + $actiondata['config'] =& $this->_config[$actiondata['module']]; } return true; } + /** + * save configuration in a file + * + * $actiondata['configfile'] contains the full path to the file + * if there is not given an path, i will overwrite the config-file given in the read-method + * + * @param array $actiondata + **/ function saveConfig (&$actiondata) { } + /** + * commit the path to the configfile + * + * $actiondata['configfile'] contains the path to the configuraton-file + * + * @param array $actiondata + **/ function setConfigFile (&$actiondata) { - $this->configfile = $actiondata['configfile']; + $this->_configfile = $actiondata['configfile']; } } - - - ?> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-06-04 11:12:06
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12823 Modified Files: Changelog index.php Added Files: phpcms.png Log Message: several changes --- NEW FILE: phpcms.png --- (This appears to be a binary file; contents omitted.) Index: Changelog =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/Changelog,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Changelog 30 May 2004 18:03:39 -0000 1.3 +++ Changelog 4 Jun 2004 11:11:56 -0000 1.4 @@ -1,11 +1,16 @@ +June 4 2004 (mjahn) + * phpDOC-comments are now in english + * optimized layout-module + * created the basics for module-programming + May 30 2004 (mjahn) - * included some new basic modules (user, layout, error) - * created templatefile layout.xml with DTD - * created configfile config.xml with DTD - * included PEAR::LiveUser into framework + * included some new basic modules (user, layout, error) + * created templatefile layout.xml with DTD + * created configfile config.xml with DTD + * included PEAR::LiveUser into framework May 21 2004 (mjahn) - * created classes for actionhandler, eventhandler and application - * began programming of the configuration-module - * simple email-module - * first devel-version \ No newline at end of file + * created classes for actionhandler, eventhandler and application + * began programming of the configuration-module + * simple email-module + * first devel-version \ No newline at end of file Index: index.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.php 30 May 2004 18:03:39 -0000 1.2 +++ index.php 4 Jun 2004 11:11:56 -0000 1.3 @@ -1,42 +1,49 @@ <?php /** -* Admin4phpCMS - modulare Administrationsoberfläche +* Admin4phpCMS - modulare administration-gui * -* Diese Software ist ein modulares Framework für Module aller Art. -* Zweck der Software ist es, die Administration einer Website durch verschiedene -* Module für den Administrator so einfach wie möglich zu halten. +* This script contains a modulare framework for several module. +* This software was written to make the administration of a website as easy +* as possible for the webmasters. * -* Ein integriertes Benutzer- und Rechtemanagment sorgt für den ungehinderten Zugriff -* für den Administrator und verhindert, daà DAUs die Website abschieÃen. +* An integrated user- and permission-managment guarantees full access for the +* admin but restricted access for normal users. * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. +* <b>License</b> * -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Martin Jahn <mj...@us...> -* @license GPL +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @copyright Copyright (c) 2004, Martin Jahn -* @version $$ +* @version $Id$ * @package admin4phpCMS **/ /* * $Log$ +* Revision 1.3 2004/06/04 11:11:56 mjahn +* several changes +* * Revision 1.2 2004/05/30 18:03:39 mjahn * restructuring of some files * */ +define ('DEBUG', true); + /** * PEAR-Pakete einbinden **/ @@ -50,8 +57,5 @@ $a = new framework(); $a->run(); -echo '<hr /><pre>'; -print_r($a); -echo '</pre>'; - +unset ($a); ?> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-06-04 06:22:38
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23036/filemanager Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager added to the repository |
From: Martin J. <mj...@us...> - 2004-06-04 06:22:38
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23036/debug Log Message: Directory /cvsroot/phpcms-plugins/admin4phpCMS/modules/debug added to the repository |
From: Martin J. <mj...@us...> - 2004-05-30 18:04:22
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9898/modules/config Modified Files: class.module_config.php Added Files: config.dtd config.xml Log Message: restructuring of some files --- NEW FILE: config.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE framework SYSTEM "config.dtd"> <framework> <module id="user" name="user-service" include="class.module_user.php" class="module_user"> <config name="userfile" value="Auth_XML.xml" /> <config name="permfile" value="Perm_XML.xml" /> </module> <module id="layout" name="layout-service" include="class.module_layout.php" class="module_layout"> <config name="tplfile" value="layout/layout.xml" /> </module> <module id="error" name="error-service" include="class.module_error.php" class="module_error" /> <module id="mail" name="email-service" include="class.module_mail.php" class="module_mail"> <config name="admin-email" value="ma...@mj..." /> <config name="from-email" value="fra...@ma..." /> </module> <module id="log" name="log-service" include="class.module_log.php" class="module_log"> <config name="logfile" value="log/framework.log" /> <config name="logrotate" /> <config name="logrotate-days" value="2" /> <config name="chmod" value="0606" /> </module> </framework> Index: class.module_config.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/config/class.module_config.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- class.module_config.php 28 May 2004 12:07:43 -0000 1.2 +++ class.module_config.php 30 May 2004 18:03:40 -0000 1.3 @@ -1,46 +1,56 @@ <?php require_once 'XML/Tree.php'; + class module_config extends module { var $configfile; function init () { - $this->__registerEvent ('CONFIG_READ', 'doReadConfig'); - $this->__registerAction ('doReadConfig', 'readConfig'); - $this->__registerEvent ('CONFIG_GET', 'doGetConfig'); - $this->__registerAction ('doGetConfig', 'getConfig'); - $this->__registerEvent ('CONFIG_SAVE', 'doSaveConfig'); - $this->__registerAction ('doSaveConfig', 'saveConfig'); - $this->__registerEvent ('CONFIG_SET_FILE', 'doSetConfigFile'); - $this->__registerAction ('doSetConfigFile', 'setConfigFile'); + $this->_registerEvent ('CONFIG_READ', 'doReadConfig'); + $this->_registerAction ('doReadConfig', 'readConfig'); + $this->_registerEvent ('CONFIG_GET', 'doGetConfig'); + $this->_registerAction ('doGetConfig', 'getConfig'); + $this->_registerEvent ('CONFIG_SAVE', 'doSaveConfig'); + $this->_registerAction ('doSaveConfig', 'saveConfig'); + $this->_registerEvent ('CONFIG_SET_FILE', 'doSetConfigFile'); + $this->_registerAction ('doSetConfigFile', 'setConfigFile'); } function readConfig (&$actiondata) { if (isset ($actiondata['configfile'])) { $this->configfile = $actiondata ['configfile']; + } else { + $this->configfile = dirname (__FILE__).'/config.xml'; } if (!isset($this->configfile)) { $actiondata = array ('errortext'=>'Konfigurationsdatei konnte nicht geladen werden!'); - $this->__callEvent ('ERROR_NOTICE', $actiondata); + $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } if (!file_exists ($this->configfile)) { unset ($this->configfile); $actiondata = array ('errortext'=>'Konfigurationsdatei konnte nicht geladen werden!'); - $this->__callEvent ('ERROR_NOTICE', $actiondata); + $this->_callEvent ('ERROR_NOTICE', $actiondata); return false; } $XML =& new XML_Tree ($this->configfile); - $this->configdata =& $XML->getTreeFromFile (); + $configdata =& $XML->getTreeFromFile (); + for ($i = 0; $i < count ($configdata->children); $i++) { + $this->config[$configdata->children[$i]->attributes['id']] =& $configdata->children[$i]; + } return true; } function getConfig (&$actiondata) { - $actiondata['config'] =& $this->configdata; + if (!isset($actiondata['module']) || !isset ($this->config[$actiondata['module']])) { + $actiondata['config'] =& $this->config; + } else { + $actiondata['config'] =& $this->config[$actiondata['module']]; + } return true; } --- NEW FILE: config.dtd --- <?xml version="1.0" encoding="UTF-8"?> <!ELEMENT framework (module)+> <!ELEMENT module (config)+> <!ATTLIST module name CDATA #IMPLIED id ID #REQUIRED class CDATA #REQUIRED include CDATA #REQUIRED > <!ELEMENT config (#PCDATA)> <!ATTLIST config name ID #REQUIRED value CDATA #IMPLIED > |