[Phpcms-plugins-cvs] admin4phpCMS/include class.actionhandler.php,1.3,1.4 class.eventhandler.php,1.3
Brought to you by:
mjahn
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']; |