phpcms-plugins-cvs Mailing List for phpCMS-plugins (Page 13)
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-07-29 03:47:30
|
Update of /cvsroot/phpcms-plugins/guestbook4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24168 Modified Files: edit.php guestbook.xml new.php view.php Added Files: rss.php README GPL .cvsignore Log Message: updated the header of the files included GPL and README --- NEW FILE: GPL --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. --- NEW FILE: rss.php --- <?php /** * Guestbook4phpCMS - a simple XML-guestbook with RSS-Feed * * <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: rss.php,v 1.1 2004/07/29 03:47:19 mjahn Exp $ * @package guestbook4phpCMS **/ /* * $Log: rss.php,v $ * Revision 1.1 2004/07/29 03:47:19 mjahn * updated the header of the files * included GPL and README * */ header ('Content-Type: xml/text'); include_once (dirname(__FILE__).'/include/config.inc.php'); include_once (dirname(__FILE__).'/include/class.guestbook4phpCMS.php'); $GB = &new guestbook4phpCMS ($CONFIG['datafile']); echo $GB->rss (); ?> Index: guestbook.xml =================================================================== RCS file: /cvsroot/phpcms-plugins/guestbook4phpCMS/guestbook.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- guestbook.xml 22 Apr 2004 07:56:16 -0000 1.1.1.1 +++ guestbook.xml 29 Jul 2004 03:47:19 -0000 1.2 @@ -1,24 +1,65 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="iso-8859-1"?> <guestbook> <guest> + <text>Das Problem mit dem "Zeichen-Salat"" habe ich auch ab und zu. +Schön, dass Du das GB mittlerweile auch Tabellenfrei gestalten konntest - ich "raufe" immer noch mit Deinem Patch von Alex's GB herum, und irgendwie funktioniert das auch nicht so recht. Mal sehen, vielleicht gibt's in Bälde ein Martin-Gästebuch zum Download incl. mail2Crypt?! + +BTW: Nur eine Kleinigkeit: IMHO heißt [quote]obligatorisch[/quote] verpflichtend - also sind doch alle Deine Felder zwangsweise einzugeben, oder irre ich mich da? ;-) +[quote]mandatorisch[/quote] oder [quote]fakultativ[/quote] wäre mir schon eher lieber *sfg* + +Alexander</text> + <name>Alexander</name> + <place>Innsbruck, A</place> + <email>ale...@st...</email> + <hp>http://stroeher.info</hp> + <time>1080847132</time> + <comment>Recht hast du und darum sei es jetzt geändert :) + Und vielleicht gibt es wirklich bald ein [quote]Martin-Gästebuch[/quote]</comment> + </guest> + <guest> + <text>@ Martin, + +Mir ist da heute etwas an Deiner Seite aufgefallen. +Wenn ich http://martin-jahn.info/index.htm aufrufe bekomme ich manchmal die index.htm zum Download angeboten. Manchmal bekomme ich die Seite auch als wirren Zeichensalat ( GZip Komprimierung ? angezeigt. +Wenn ich oft genug F5 drücke bekomme ich die Seite immer erfolgreich angezeigt. + +Ansonsten kann ich nur sagen. Weiter so und danke für Deine vielen guten phpcms Erweiterungen !</text> + <name>Lumi01</name> + <place>Deutschland &amp; Vietnam</place> + <email /> + <hp>www.viet-friends-world.com</hp> + <time>1080811068</time> + <comment /> + </guest> + <guest> + <text>So, nachdem ich mir schnell ein kleines Gästebuch-Skript selber geschrieben habe (dank PEAR nur ca. 150 Zeilen), sind die Layout-Tabellen jetzt auch in diesem Bereich Vergangenheit. Die Einträge werden jetzt in XML-Dateien verwaltet. +Wenn ihr noch Vorschläge für Features habt könnt ihr sie mir gerne zukommen lassen.</text> + <name>Martin Jahn</name> + <place>Kreischa</place> + <email>ma...@ma...</email> + <hp>http://martin-jahn.info/</hp> + <time>1080579188</time> + <comment /> + </guest> + <guest> <time>1080484876</time> <name>Michael</name> - <email/> - <hp/> + <email /> + <hp /> <place>Wilhelmshaven</place> <text>Hi Martin, <br /> <br /> -toll, deine vielen PlugIns für phpcms. Nur bei der Bildergalere sehe ich noch cniht so richtig durch. Eine Demo oder eine bessere Anleitung wären nicht schelcht. <br /> +toll, deine vielen PlugIns für phpcms. Nur bei der Bildergalere sehe ich noch nicht so richtig durch. Eine Demo oder eine bessere Anleitung wären nicht schelcht. <br /> <br /> Ansonsten Daumen hoch für Dich.<br /> <br /> Michael</text> - <comment/> + <comment /> </guest> <guest> <time>1080078678</time> <name>peter</name> - <email/> + <email /> <hp>www.rahe-online.de</hp> <place>Berlin</place> <text>Zur Zeit ist dein &lt;TR&gt;/&lt;TD&gt; Salat etwas verwirrend..:-)) -aber das wird schon wieder, danke für das nette Fehlerseiten Script!<br /> @@ -31,7 +72,7 @@ <time>1078782851</time> <name>Martin Jahn</name> <email>ma...@ma...</email> - <hp/> + <hp /> <place>Kreischa</place> <text>Hallo,<br /> <br /> @@ -41,47 +82,21 @@ <br /> Also, viel Spaß auf meinen Seiten wünscht<br /> Martin Jahn</text> - <comment/> - </guest> - <guest> - <text>So, nachdem ich mir schnell ein kleines Gästebuch-Skript selber geschrieben habe (dank PEAR nur ca. 150 Zeilen), sind die Layout-Tabellen jetzt auch in diesem Bereich Vergangenheit. Die Einträge werden jetzt in XML-Dateien verwaltet. -Wenn ihr noch Vorschläge für Features habt könnt ihr sie mir gerne zukommen lassen.</text> - <name>Martin Jahn</name> - <place>Kreischa</place> - <email>ma...@ma...</email> - <hp>http://martin-jahn.info/</hp> - <time>1080579188</time> - <comment/> - </guest> - <guest> - <text>@ Martin, - -Mir ist da heute etwas an Deiner Seite aufgefallen. -Wenn ich http://martin-jahn.info/index.htm aufrufe bekomme ich manchmal die index.htm zum Download angeboten. Manchmal bekomme ich die Seite auch als wirren Zeichensalat ( GZip Komprimierung ? angezeigt. -Wenn ich oft genug F5 drücke bekomme ich die Seite immer erfolgreich angezeigt. - -Ansonsten kann ich nur sagen. Weiter so und danke für Deine vielen guten phpcms Erweiterungen !</text> - <name>Lumi01</name> - <place>Deutschland & Vietnam</place> - <email/> - <hp>www.viet-friends-world.com</hp> - <time>1080811068</time> - <comment/> + <comment /> </guest> <guest> - <text>Das Problem mit dem [quote]Zeichen-Salat[/quote] habe ich auch ab und zu. -Schön, dass Du das GB mittlerweile auch Tabellenfrei gestalten konntest - ich [quote]raufe[/quote] immer noch mit Deinem Patch von Alex's GB herum, und irgendwie funktioniert das auch nicht so recht. Mal sehen, vielleicht gibt's in Bälde ein Martin-Gästebuch zum Download incl. mail2Crypt?! + <text>Hallo Martin, -BTW: Nur eine Kleinigkeit: IMHO heißt [quote]obligatorisch[/quote] verpflichtend - also sind doch alle Deine Felder zwangsweise einzugeben, oder irre ich mich da? ;-) -[quote]mandatorisch[/quote] oder [quote]fakultativ[/quote] wäre mir schon eher lieber *sfg* +tolle Page. Mal schauen ob was f&#252;r mich dabei ist. :-) +Danke f&#252;r Deine freundliche Unterst&#252;tzung beim Eintrichten von PHPCMS. -Alexander</text> - <name>Alexander</name> - <place>Innsbruck, A</place> - <email>ale...@st...</email> - <hp>http://stroeher.info</hp> - <time>1080847132</time> - <comment>Recht hast du und darum sei es jetzt geändert :) - Und vielleicht gibt es wirklich bald ein [quote]Martin-Gästebuch[/quote]</comment> +Gru&#223; +Michael </text> + <name>Michael</name> + <place>Birkenfeld</place> + <email>in...@co...</email> + <hp>www.comaction.de</hp> + <time>1090262212</time> + <comment /> </guest> </guestbook> \ No newline at end of file Index: view.php =================================================================== RCS file: /cvsroot/phpcms-plugins/guestbook4phpCMS/view.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- view.php 22 Apr 2004 07:56:16 -0000 1.1.1.1 +++ view.php 29 Jul 2004 03:47:19 -0000 1.2 @@ -1,111 +1,42 @@ <?php /** -* gb4phpcms - Plugin für phpCMS -* -* @author: Martin Jahn <ma...@ma...> -* @license: GPL -* @version: 0.1 -* @package gb4phpcms -* -* Das Plugin erkennt in einer Contentdatei alle vorkommenden Begriffe aus einer Glossardatei. -* Diese Begriffe werden dann markiert und werden im Broswer mit Kurzbeschreibungen angezeigt -* werden. Die Glossardatei kann darueber hinaus auch als normale Contentdatei verwendet werden. -* Damit ist es auch moeglich die Begriffe mit Links zur Glossardatei zu versehen. -* -* Dieses Plugin/Skript veroeffentliche ich so wie es ist und gebe deshalb auch keinerlei Garantie, -* dass es richtig funktioniert. Ausserdem uebernehme ich keinerlei Haftung fuer eventuelle durch -* die Anwendung des Plugins/Skriptes entstehenden Schaeden. +* Guestbook4phpCMS - a simple XML-guestbook with RSS-Feed * -* Falls du Verbesserungsvorschlaege oder Wuensche bezueglich des Skriptes hast melde dich bei -* Martin Jahn <ma...@ma...> +* <b>License</b> * -* Viel Spass +* 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. * -* Dieses Script ist kostenlos für private und kommerzielle Nuzung. -* Es wird unter den Bedingungen der GNU General Public License, wie von der Free -* Software Foundation herausgegeben, verteilt. Eine Kopie der GPL sollte im Zip-File -* enthalten sein. Das Script darf (im Rahmen der GPL) nach belieben genutzt, weiter- -* gegeben und modifiziert werden. Dieser Copyright-Hinweis muss jedoch in jedem Fall -* unverändert im Script belassen werden. +* 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. * -* Ich übernehme keinerlei Verantwortung für Schäden, die durch die Nutzung dieses -* Scripts entstehen. Bei Fehlern würde ich jedoch gerne informiert werden, damit -* ich diese ausbügeln kann. Auch für den Fall, dass Ihr Verbesserungen vornehmt, -* Verbesserungsvorschläge oder -wünsche habt, wäre ich dankbar für eine Benachrichtigung. +* 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 guestbook4phpCMS **/ -include_once(dirname(__FILE__).'/../pear.inc.php'); -include_once(dirname(__FILE__).'/class.template.php'); -include_once(dirname(__FILE__).'/class.bbcode.php'); -include_once('XML/Unserializer.php'); - -function sortiere($a, $b) { - if ($a['time'] == $b['time']) { - return 0; - } - return $a['time'] < $b['time'] ? 1 : -1; -} - -function bbcode ($text) { - $parser = new bbcode(); - return $parser->qparse($text); -} - -$unserializer = &new XML_Unserializer(); - -$unserializer->unserialize(dirname(__FILE__).'/guestbook.xml', true); -$data = $unserializer->getUnserializedData(); -$data = $data['guest']; - -uasort($data, 'sortiere'); - -$TPL = &new cTemplate(); -$TPL->load(dirname(__FILE__).'/gb.tpl'); -$TPL->parse(); - -$o = explode("\n", $TPL->process('GB.PRE')); - -$kontaktfields = array('email','hp'); - -$i = 1; - -foreach ($data as $entry) { - $entry['time'] = strftime('am %d. %m. %Y um %H:%M', $entry['time']); - $entry['counter'] = $i++; - if (isset($entry['hp']) && $entry['hp'] != '' && strpos($entry['hp'], '://') == 0) { - $entry['hp'] = 'http://'.$entry['hp']; - } - $kontakt = false; - foreach ($entry as $id=>$value) { - if (!isset($value) || trim($value) == '') { - $TPL->delField('GB.'.strtoupper($id)); - $TPL->delField(strtoupper($id)); - continue; - } - - if (in_array($id, $kontaktfields)) { - $kontakt = true; - } - - $TPL->setFieldValue('GB.'.strtoupper($id), $TPL->getFieldValue('GB.TPL.'.strtoupper($id))); - $TPL->setFieldValue(strtoupper($id), str_replace("\n", '<br />', strip_tags(trim($value)))); - } - - $TPL->delField('GB.KONTAKT'); - if ($kontakt) { - $TPL->setFieldValue('GB.KONTAKT', $TPL->getFieldValue('GB.TPL.KONTAKT')); - } - - $o = array_merge($o, explode("\n", bbcode($TPL->process('GB.NORMAL')))); -} - -$o = array_merge($o, explode("\n", $TPL->process('GB.PAST'))); +/* +* $Log$ +* Revision 1.2 2004/07/29 03:47:19 mjahn +* updated the header of the files +* included GPL and README +* +*/ -include_once($PHPCMS_INCLUDEPATH.'/class.mail2crypt_phpcms.php'); -$Mail2Crypt = new Mail2Crypt(); -$o = @$Mail2Crypt->crypt_mailto($o); +include_once (dirname(__FILE__).'/include/config.inc.php'); +include_once (dirname(__FILE__).'/include/class.guestbook4phpCMS.php'); -echo join("\n", $o); +$GB = &new guestbook4phpCMS ($CONFIG['datafile']); +echo $GB->view (); ?> \ No newline at end of file --- NEW FILE: README --- --- NEW FILE: .cvsignore --- pear* Index: edit.php =================================================================== RCS file: /cvsroot/phpcms-plugins/guestbook4phpCMS/edit.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- edit.php 22 Apr 2004 07:56:16 -0000 1.1.1.1 +++ edit.php 29 Jul 2004 03:47:19 -0000 1.2 @@ -1,41 +1,39 @@ <?php /** -* gb4phpCMS - Plugin für phpCMS -* -* @author: Martin Jahn <ma...@ma...> -* @license: GPL -* @version: 0.1 -* @package gb4phpcms -* -* Das Plugin erkennt in einer Contentdatei alle vorkommenden Begriffe aus einer Glossardatei. -* Diese Begriffe werden dann markiert und werden im Broswer mit Kurzbeschreibungen angezeigt -* werden. Die Glossardatei kann darueber hinaus auch als normale Contentdatei verwendet werden. -* Damit ist es auch moeglich die Begriffe mit Links zur Glossardatei zu versehen. -* -* Dieses Plugin/Skript veroeffentliche ich so wie es ist und gebe deshalb auch keinerlei Garantie, -* dass es richtig funktioniert. Ausserdem uebernehme ich keinerlei Haftung fuer eventuelle durch -* die Anwendung des Plugins/Skriptes entstehenden Schaeden. +* Guestbook4phpCMS - a simple XML-guestbook with RSS-Feed * -* Falls du Verbesserungsvorschlaege oder Wuensche bezueglich des Skriptes hast melde dich bei -* Martin Jahn <ma...@ma...> +* <b>License</b> * -* Viel Spass +* 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. * -* Dieses Script ist kostenlos für private und kommerzielle Nuzung. -* Es wird unter den Bedingungen der GNU General Public License, wie von der Free -* Software Foundation herausgegeben, verteilt. Eine Kopie der GPL sollte im Zip-File -* enthalten sein. Das Script darf (im Rahmen der GPL) nach belieben genutzt, weiter- -* gegeben und modifiziert werden. Dieser Copyright-Hinweis muss jedoch in jedem Fall -* unverändert im Script belassen werden. +* 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. * -* Ich übernehme keinerlei Verantwortung für Schäden, die durch die Nutzung dieses -* Scripts entstehen. Bei Fehlern würde ich jedoch gerne informiert werden, damit -* ich diese ausbügeln kann. Auch für den Fall, dass Ihr Verbesserungen vornehmt, -* Verbesserungsvorschläge oder -wünsche habt, wäre ich dankbar für eine Benachrichtigung. +* 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 guestbook4phpCMS **/ -include(dirname(__FILE__).'/../pear.inc.php'); +/* +* $Log$ +* Revision 1.2 2004/07/29 03:47:19 mjahn +* updated the header of the files +* included GPL and README +* +*/ +include_once (dirname(__FILE__).'/config.inc.php'): + include(dirname(__FILE__).'/class.template.php'); include_once(dirname(__FILE__).'/class.bbcode.php'); Index: new.php =================================================================== RCS file: /cvsroot/phpcms-plugins/guestbook4phpCMS/new.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- new.php 22 Apr 2004 07:56:16 -0000 1.1.1.1 +++ new.php 29 Jul 2004 03:47:19 -0000 1.2 @@ -1,96 +1,98 @@ <?php /** -* gb4phpcms - Plugin für phpCMS -* -* @author: Martin Jahn <ma...@ma...> -* @license: GPL -* @version: 0.1 -* @package gb4phpcms -* -* Das Plugin erkennt in einer Contentdatei alle vorkommenden Begriffe aus einer Glossardatei. -* Diese Begriffe werden dann markiert und werden im Broswer mit Kurzbeschreibungen angezeigt -* werden. Die Glossardatei kann darueber hinaus auch als normale Contentdatei verwendet werden. -* Damit ist es auch moeglich die Begriffe mit Links zur Glossardatei zu versehen. +* Guestbook4phpCMS - a simple XML-guestbook with RSS-Feed * -* Dieses Plugin/Skript veroeffentliche ich so wie es ist und gebe deshalb auch keinerlei Garantie, -* dass es richtig funktioniert. Ausserdem uebernehme ich keinerlei Haftung fuer eventuelle durch -* die Anwendung des Plugins/Skriptes entstehenden Schaeden. +* <b>License</b> * -* Falls du Verbesserungsvorschlaege oder Wuensche bezueglich des Skriptes hast melde dich bei -* Martin Jahn <ma...@ma...> +* 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. * -* Viel Spass +* 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. * -* Dieses Script ist kostenlos für private und kommerzielle Nuzung. -* Es wird unter den Bedingungen der GNU General Public License, wie von der Free -* Software Foundation herausgegeben, verteilt. Eine Kopie der GPL sollte im Zip-File -* enthalten sein. Das Script darf (im Rahmen der GPL) nach belieben genutzt, weiter- -* gegeben und modifiziert werden. Dieser Copyright-Hinweis muss jedoch in jedem Fall -* unverändert im Script belassen werden. +* 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 * -* Ich übernehme keinerlei Verantwortung für Schäden, die durch die Nutzung dieses -* Scripts entstehen. Bei Fehlern würde ich jedoch gerne informiert werden, damit -* ich diese ausbügeln kann. Auch für den Fall, dass Ihr Verbesserungen vornehmt, -* Verbesserungsvorschläge oder -wünsche habt, wäre ich dankbar für eine Benachrichtigung. +* @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 guestbook4phpCMS +**/ + +/* +* $Log$ +* Revision 1.2 2004/07/29 03:47:19 mjahn +* updated the header of the files +* included GPL and README * +*/ +/** +* include the configuration-file **/ +include_once (dirname(__FILE__).'/include/config.inc.php'); -include_once(dirname(__FILE__).'/../pear.inc.php'); +/** +* include the gusetbook-class +**/ +include_once (dirname(__FILE__).'/include/class.guestbook4phpCMS.php'); -include_once('XML/Unserializer.php'); -include_once('XML/Serializer.php'); +/** +* include the necessary PEAR-classes +**/ include_once('HTML/QuickForm.php'); -include_once('Mail.php'); -function process_data() { - global $GB; - $admin_mail = 'ma...@ma...'; - $admin_from = 'gae...@ma...'; - $dataset = $GB; - - $dataset['time'] = time(); - $dataset['comment'] = ''; - print_r($dataset); - - $unserializer = &new XML_Unserializer(); - $unserializer->unserialize(dirname(__FILE__).'/guestbook.xml', true); - $data = $unserializer->getUnserializedData(); - $data = $data['guest']; - $data[] = $dataset; +if (!function_exists ('xmlentities')) { + function xmlentities($string, $quote_style=ENT_COMPAT) { + $trans = get_html_translation_table(HTML_ENTITIES, $quote_style); + foreach ($trans as $key => $value) + $trans[$key] = '&#'.ord($key).';'; + return strtr($string, $trans); + } +} - $options = array ('indent'=>' ', 'linebreak'=>"\n", 'addDecl'=>true, 'tagName'=>'guestbook', 'defaultTagName'=>'guest'); - $serializer = &new XML_Serializer($options); - $result = $serializer->serialize($data); - $fh = fopen(dirname(__FILE__).'/guestbook.xml', 'wb'); - fwrite($fh, $serializer->getSerializedData()); - fclose($fh); - - $mailtext = 'Im Gästebuch auf martin-jahn.info haben wurde von '.$GB['name'].' folgendes eingetragen: - '.$GB['text'].' - '; +/** +* callback-function for the PEAR::HTML_QuickForm-Package +**/ +function process_data() { + global $GLOBALS, $CONFIG; + $GBdata =& $_POST['GBnewdata']; + print_r ($GBdata); + $GBdata = array_map (create_function ('$a', 'return xmlentities ($a);'), $GBdata); + $dataset = array_merge ($GBdata, array ('time' => time(), 'comment' => '')); + $GBook =& new guestbook4phpCMS ($CONFIG['datafile']); + $GBook->add ($dataset); + $GBook->save (); - $MAIL =& Mail::factory('mail'); - $MAIL->send($admin_mail, array('Subject'=>'Gästebucheintrag', 'From'=>$admin_from), $mailtext); + $mailtext = 'Im Gästebuch auf martin-jahn.info haben wurde von '.$dataset ['name'].' folgendes eingetragen: '.$dataset ['text']; + mail ($CONFIG ['admin_mail'], 'Gästebucheintrag', $mailtext, 'From: '.$CONFIG ['admin_from']."\r\n"); } -$FORM = new HTML_QuickForm ('formular', 'post'); -$FORM->addElement ('textarea', 'GB[text]', 'Eintrag'); -$FORM->addElement ('text', 'GB[name]', 'Name'); -$FORM->addElement ('submit', 'submit', 'Eintragen'); -$FORM->addElement ('text', 'GB[place]', 'Ort'); -$FORM->addElement ('text', 'GB[email]', 'Email'); -$FORM->addElement ('text', 'GB[hp]', 'Website'); +// create object for the input-form +$FORM = new HTML_QuickForm ('', 'post'); -$FORM->addRule ('GB[text]', 'Bitte geben Sie Ihre Nachricht ein', 'required', null, 'client'); -$FORM->addRule ('GB[text]', 'Bitte geben Sie Ihre Nachricht ein', 'required'); +// set structure of the input-form +$FORM->addElement ('textarea', 'GBnewdata[text]', 'Eintrag'); +$FORM->addElement ('text', 'GBnewdata[name]', 'Name'); +$FORM->addElement ('submit', 'submit', 'Eintragen'); +$FORM->addElement ('text', 'GBnewdata[place]', 'Ort'); +$FORM->addElement ('text', 'GBnewdata[email]', 'Email'); +$FORM->addElement ('text', 'GBnewdata[hp]', 'Website'); -$FORM->addRule ('GB[email]', 'Bitte geben Sie eine korrekte Emailadresse ein', 'email', null, 'client'); -$FORM->addRule ('GB[email]', 'Bitte geben Sie eine korrekte Emailadresse ein', 'email'); +// set validation-rules for the input-form on client-side +$FORM->addRule ('GBnewdata[text]', 'Bitte geben Sie Ihre Nachricht ein', 'required', null, 'client'); +$FORM->addRule ('GBnewdata[email]', 'Bitte geben Sie eine korrekte Emailadresse ein', 'email', null, 'client'); -/** -* customize the templates for the formula -**/ +// set validation-rules for the input-form on server-side +$FORM->addRule ('GBnewdata[text]', 'Bitte geben Sie Ihre Nachricht ein', 'required'); +$FORM->addRule ('GBnewdata[email]', 'Bitte geben Sie eine korrekte Emailadresse ein', 'email'); +// customize the templates for the formula $TPL =& $FORM->defaultRenderer (); $TPL->setFormTemplate ('<form {attributes}>'."\n".'{content}</form>'."\n"); $TPL->setHeaderTemplate ('<h2>{header}</h2>'."\n"); @@ -98,8 +100,10 @@ $TPL->setElementTemplate ('<div <!-- BEGIN required -->class="required"<!-- END required -->>'."\n".' {label}<br />'."\n".' {element}'."\n".'<!-- BEGIN error --> <p class="error">{error}</p><!-- END error -->'."\n".'</div>'."\n"); if ($FORM->validate()) { + // process form-data $FORM->process('process_data', false); } else { + // display form $FORM->display(); } ?> \ No newline at end of file |
Update of /cvsroot/phpcms-plugins/guestbook4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24168/include Added Files: class.guestbook4phpCMS.php config.inc.php class.template.php xmlwriterclass.php rss_writer_class.php class.bbcode.php Log Message: updated the header of the files included GPL and README --- NEW FILE: class.guestbook4phpCMS.php --- <?php include_once(dirname(__FILE__).'/class.template.php'); include_once(dirname(__FILE__).'/class.bbcode.php'); include_once (dirname (__FILE__).'/rss_writer_class.php'); require_once('XML/Serializer.php'); require_once('XML/Unserializer.php'); error_reporting (E_ALL); class guestbook4phpCMS { var $_xml_options = array ('indent'=>' ', 'linebreak'=>"\n", 'addDecl'=>true, 'tagName'=>'guestbook', 'defaultTagName'=>'guest', 'encoding'=>'iso-8859-1'); var $_loaded = false; var $_datafile = ''; function guestbook4phpCMS ($datafile = '') { return $this->__construct ($datafile); } function __construct ($datafile = '') { if ($datafile != '' && !$this->load ($datafile)) { return false; } $this->docroot = realpath ($_SERVER ['DOCUMENT_ROOT']); return true; } function load ($datafile) { if (!file_exists ($datafile)) { return false; } $this->_datafile = $datafile; $unserializer =& new XML_Unserializer(); $unserializer->unserialize($datafile, true); $this->data =& $unserializer->getUnserializedData(); if (!is_array ($this->data)) { $this->_loaded = false; return false; } $this->_DATA =& $this->data['guest']; if (!is_array ($this->_DATA)) { $this->_loaded = false; return false; } usort($this->_DATA, array ('guestbook4phpCMS', 'compare')); $this->_loaded = true; } function save ($datafile = '') { global $CONFIG; if (isset ($this->_datafile) && $this->_datafile != '' && $datafile == '') { $datafile = $this->_datafile; } if (!file_exists ($datafile) || !is_writeable ($datafile) || !$this->_loaded) { return false; } $serializer = &new XML_Serializer($this->_xml_options); $result = $serializer->serialize($this->_DATA); $fh = fopen($datafile, 'wb'); fwrite($fh, $serializer->getSerializedData()); fclose($fh); $fh = fopen($_SERVER['DOCUMENT_ROOT'].$CONFIG ['rss-file'], 'wb'); fwrite($fh, $this->rss (0, -1, true)); fclose($fh); } function parse () { } function compare ($a, $b) { if ($a['time'] == $b['time']) return 0; return $a['time'] > $b['time'] ? 1 : -1; } function bbcode ($text) { $parser = new bbcode(); return $parser->qparse($text); } function view ($start = 0, $count = -1) { if (!$this->_loaded) { return 'false'; } $TPL = &new cTemplate(); $TPL->load(dirname(__FILE__).'/../gb.tpl'); $TPL->parse(); $o = explode("\n", $TPL->process('GB.PRE')); $kontaktfields = array('email','hp'); $num = count ($this->_DATA); if ($count != -1 && $start + $count < $num - 1) { $num = $start + $count; } for ($i = $num - 1; $i >= $start; $i--) { $entry = $this->_DATA [$i]; $entry['time'] = strftime('am %d. %m. %Y um %H:%M', $entry['time']); $entry['counter'] = $i + 1; if (isset($entry['hp']) && $entry['hp'] != '' && strpos($entry['hp'], '://') == 0) { $entry['hp'] = 'http://'.$entry['hp']; } $kontakt = false; foreach ($entry as $id=>$value) { if (!isset($value) || trim($value) == '') { $TPL->delField('GB.'.strtoupper($id)); $TPL->delField(strtoupper($id)); continue; } if (in_array($id, $kontaktfields)) { $kontakt = true; } $TPL->setFieldValue('GB.'.strtoupper($id), $TPL->getFieldValue('GB.TPL.'.strtoupper($id))); $TPL->setFieldValue(strtoupper($id), str_replace("\n", '<br />', strip_tags(trim($value)))); } $TPL->delField('GB.KONTAKT'); if ($kontakt) { $TPL->setFieldValue('GB.KONTAKT', $TPL->getFieldValue('GB.TPL.KONTAKT')); } $o = array_merge($o, explode("\n", $this->bbcode($TPL->process('GB.NORMAL')))); } $o = array_merge($o, explode("\n", $TPL->process('GB.PAST'))); // process output with phpCMS-MAIL2CRYPT if available if (isset ($GLOBALS ['PHPCMS_INCLUDEPATH']) && file_exists ($GLOBALS ['PHPCMS_INCLUDEPATH'].'/class.mail2crypt_phpcms.php')) { include_once($GLOBALS ['PHPCMS_INCLUDEPATH'].'/class.mail2crypt_phpcms.php'); $Mail2Crypt = new Mail2Crypt(); $o = @$Mail2Crypt->crypt_mailto($o); } return join("\n", $o); } function rss ($start = 0, $count = -1, $no_header = true) { global $CONFIG; if (!$this->_loaded) { return false; } // First create an object of the class. $rss_writer_object=new rss_writer_class; // Second: choose the version of specification that the generated RSS document should conform. $rss_writer_object->specification="1.0"; // Third: Specify the URL where the RSS document will be made available. $rss_writer_object->about = 'http://'.$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']; /* * Specify the URL of an optional XSL stylesheet. * This lets the document be rendered automatically in XML capable browsers * such as Internet Explore 5, Mozilla 5/Netscape 6 or better. */ $rss_writer_object->stylesheet = $CONFIG ['rss-xsl-web'];//"http://mjahn.homelinux.org/guestbook.xsl"; /* * When generating RSS version 1.0, you may declare additional * namespaces that enable the use of more property tags defined * by extension modules of the RSS specification. */ $rss_writer_object->rssnamespaces["dc"]="http://purl.org/dc/elements/1.1/"; /* * Define the properties of the channel. */ $properties=array(); $properties["description"] = $CONFIG ['rss-desc']; $properties["link"] = $CONFIG ['rss-link']; $properties["title"] = $CONFIG ['rss-title']; $properties["dc:date"] = strftime ('', time ());//"2004-05-14T23:30:00Z"; $rss_writer_object->addchannel($properties); // add the rss-items $num = count ($this->_DATA); if ($count != -1 && $start + $count < $num - 1) { $num = $start + $count; } for ($i = $start; $i < $num; $i++) { $properties=array(); $properties["description"] = $this->_DATA[$i]['text']; $properties["link"] = $CONFIG ['rss-link']; $properties["title"]=$this->_DATA[$i]['name'].' aus '.$this->_DATA[$i]['place'].' schrieb'; $properties["dc:date"] = strftime ('', time ()); //"2002-05-06T00:00:00Z"; $rss_writer_object->additem($properties); } // generate RSS document. if($rss_writer_object->writerss($output)) { if (!$no_header) { Header("Content-Type: text/xml; charset=\"".$rss_writer_object->outputencoding."\""); Header("Content-Length: ".strval(strlen($output))); } return $output; } else { if (!$no_header) { Header("Content-Type: text/plain"); } return ("Error: ".$rss_writer_object->error); } } function add ($dataset = array ()) { if (count ($dataset) == 0) { return false; } if (!$this->_loaded) { return false; } $this->_DATA[] = $dataset; } function del ($id) { } } ?> --- NEW FILE: xmlwriterclass.php --- <?php if(!defined("METAL_LIBRARY_XML_XML_WRITER_CLASS")) { define("METAL_LIBRARY_XML_XML_WRITER_CLASS",1); /* * * Copyright © (C) Manuel Lemos 2001-2002 * * @(#) $Id: xmlwriterclass.php,v 1.1 2004/07/29 03:47:19 mjahn Exp $ * */ class xml_writer_class { /* * Protected variables * */ var $structure=array(); var $nodes=array(); /* * Public variables * */ var $stylesheet=""; var $stylesheettype="text/xsl"; var $dtdtype=""; var $dtddefinition=""; var $dtdurl=""; var $outputencoding="utf-8"; var $inputencoding="iso-8859-1"; var $linebreak="\n"; var $indenttext=" "; var $generatedcomment="Generated by: http://www.phpclasses.org/xmlwriter \$Revision: 1.1 $"; var $error=""; /* * Protected functions * */ Function escapedata($data) { $position=0; $length=strlen($data); $escapeddata=""; for(;$position<$length;) { $character=substr($data,$position,1); $code=Ord($character); switch($code) { case 34: $character="""; break; case 38: $character="&"; break; case 39: $character="'"; break; case 60: $character="<"; break; case 62: $character=">"; break; default: if($code<32) $character=("&#".strval($code).";"); break; } $escapeddata.=$character; $position++; } return $escapeddata; } Function encodedata($data,&$encodeddata) { if(!strcmp($this->inputencoding,$this->outputencoding)) $encodeddata=$this->escapedata($data); else { switch(strtolower($this->outputencoding)) { case "utf-8": if(!strcmp(strtolower($this->inputencoding),"iso-8859-1")) { $encoded_data=utf8_encode($this->escapedata($data)); $encodeddata=$encoded_data; } else { $this->error=("can not encode iso-8859-1 data in ".$this->outputencoding); return 0; } break; case "iso-8859-1": if(!strcmp(strtolower($this->inputencoding),"utf-8")) { $decoded=utf8_decode($data); $encodeddata=$this->escapedata($decoded); } else { $this->error=("can not encode utf-8 data in ".$this->outputencoding); return 0; } break; default: $this->error=("can not encode data in ".$this->inputencoding); return 0; } } return 1; } Function writetag(&$output,$path,$indent) { $tag=$this->structure[$path]["Tag"]; $output.=("<".$tag); $attributecount=count($this->structure[$path]["Attributes"]); if($attributecount>0) { $attributes=$this->structure[$path]["Attributes"]; Reset($attributes); $end=(GetType($key=Key($attributes))!="string"); for(;!$end;) { $output.=(" ".$key."=\"".$attributes[$key]."\""); Next($attributes); $end=(GetType($key=Key($attributes))!="string"); } } $elements=$this->structure[$path]["Elements"]; if($elements>0) { $output.=">"; $doindent=$this->structure[$path]["Indent"]; $elementindent=(($doindent) ? $this->linebreak.$indent.$this->indenttext : ""); $element=0; for(;$element<$elements;) { $elementpath=($path.",".strval($element)); $output.=$elementindent; if(IsSet($this->nodes[$elementpath])) { if(!($this->writetag($output,$elementpath,$indent.$this->indenttext))) return 0; } else $output.=$this->structure[$elementpath]; $element++; } $output.=((($doindent) ? $this->linebreak.$indent : "")."</".$tag.">"); } else $output.="/>"; return 1; } /* * Public functions * */ Function write(&$output) { if(strcmp($this->error,"")) return 0; if(!(IsSet($this->structure["0"]))) { $this->error="XML document structure is empty"; return 0; } $output=("<?xml version=\"1.0\" encoding=\"".$this->outputencoding."\"?>".$this->linebreak); if(strcmp($this->dtdtype,"")) { $output.=("<!DOCTYPE ".$this->structure["0"]["Tag"]." "); switch($this->dtdtype) { case "INTERNAL": if(!strcmp($this->dtddefinition,"")) { $this->error="it was not specified a valid internal DTD definition"; return 0; } $output.=("[".$this->linebreak.$this->dtddefinition.$this->linebreak."]"); break; case "SYSTEM": if(!strcmp($this->dtdurl,"")) { $this->error="it was not specified a valid system DTD url"; return 0; } $output.="SYSTEM"; if(strcmp($this->dtddefinition,"")) $output.=(" \"".$this->dtddefinition."\""); $output.=(" \"".$this->dtdurl."\""); break; case "PUBLIC": if(!strcmp($this->dtddefinition,"")) { $this->error="it was not specified a valid public DTD definition"; return 0; } $output.=("PUBLIC \"".$this->dtddefinition."\""); if(strcmp($this->dtdurl,"")) $output.=(" \"".$this->dtdurl."\""); break; default: $this->error="it was not specified a valid DTD type"; return 0; } $output.=(">".$this->linebreak); } if(strcmp($this->stylesheet,"")) { if(!strcmp($this->stylesheettype,"")) { $this->error="it was not specified a valid stylesheet type"; return 0; } $output.=("<?xml-stylesheet type=\"".$this->stylesheettype."\" href=\"".$this->stylesheet."\"?>".$this->linebreak); } if(strcmp($this->generatedcomment,"")) $output.=("<!-- ".$this->generatedcomment." -->".$this->linebreak); return $this->writetag($output,"0",""); } Function addtag($tag,&$attributes,$parent,&$path,$indent) { if(strcmp($this->error,"")) return 0; $path=((!strcmp($parent,"")) ? "0" : ($parent.",".strval($this->structure[$parent]["Elements"]))); if(IsSet($this->structure[$path])) { $this->error=("tag with path ".$path." is already defined"); return 0; } $encodedattributes=array(); Reset($attributes); $end=(GetType($attribute_name=Key($attributes))!="string"); for(;!$end;) { $encodedattributes[$attribute_name]=""; if(!($this->encodedata($attributes[$attribute_name],$encoded_data))) return 0; $encodedattributes[$attribute_name]=$encoded_data; Next($attributes); $end=(GetType($attribute_name=Key($attributes))!="string"); } $this->structure[$path]=array( "Tag"=>$tag, "Attributes"=>$encodedattributes, "Elements"=>0, "Indent"=>$indent ); $this->nodes[$path]=1; if(strcmp($parent,"")) $this->structure[$parent]["Elements"]=($this->structure[$parent]["Elements"]+1); return 1; } Function adddata($data,$parent,&$path) { if(strcmp($this->error,"")) return 0; if(!(IsSet($this->structure[$parent]))) { $this->error=("the parent tag path".$path."is not defined"); return 0; } if(!strcmp($data,"")) return 1; $path=($parent.",".strval($this->structure[$parent]["Elements"])); if(!($this->encodedata($data,$encoded_data))) return 0; $this->structure[$path]=$encoded_data; $this->structure[$parent]["Elements"]=($this->structure[$parent]["Elements"]+1); return 1; } Function adddatatag($tag,&$attributes,$data,$parent,&$path) { return $this->addtag($tag,$attributes,$parent,$path,0) && $this->adddata($data,$path,$datapath); } }; } ?> --- NEW FILE: class.template.php --- <?php class cTemplate { var $limiter = array ('{', '}'); var $tpl = array(); function load ($tplfilename) { if (!file_exists($tplfilename)) { return false; } $this->filename = $tplfilename; } function parse () { $beginlen = strlen($this->limiter[0]); $endlen = strlen($this->limiter[1]); $cofi = file($this->filename); reset($cofi); // einen DUMMY für ersten Text übernehmen $vol = ''; //durch die Zeilen iterieren und zuordung aus //geklammerten anweisungen lesen while( list($key,$val) = each($cofi)) { //$val = trim($val); //Start gefunden ? if ( substr($val,0,$beginlen) == $this->limiter[0] ) { //Das Ende der Klammer finden $end = strpos($val,$this->limiter[1],$beginlen); //Den Inhalt der Klammer als Key übernehmen $vol = trim(substr($val,$beginlen, $end-1)); //Den Rest der Zeile dem Key zuordnen $this->tpl[$vol] = isset($this->tpl[$vol]) ? $this->tpl[$vol].substr($val,$end+$endlen) : substr($val,$end+$endlen); continue; } //Zeile dem aktuellen Key zuordnen $this->tpl[$vol] .= $val; } } function process ($fieldname) { $outtext = ''; $text = $this->tpl[$fieldname]; $replaces = $this->tpl; $beginlen = strlen($this->limiter[0]); $endlen = strlen($this->limiter[1]); $count = 0; $pos = strpos($text,$this->limiter[0], $count); while( $pos > 0) { $endpos = strpos($text,$this->limiter[1],$pos + $beginlen); if ( $endpos > 0) { $tag = trim(substr($text,$pos+$beginlen, ($endpos-($pos+$beginlen)) ) ); if (isset($replaces[$tag])) { $text = substr($text,0,$pos) . $replaces[$tag] . substr($text,$endpos+$endlen); $count = $pos;// + strlen($replaces[$tag]); } else { $text = substr($text,0,$pos) . substr($text,$endpos+$endlen); $count = $pos; } } else { break; } $pos = @strpos($text,$this->limiter[0], $count); //echo 'process['.$fieldname.'] = '.$text."\n"; } return $text; } function setFieldValue ($fieldname, $value) { $this->tpl[$fieldname] = $value; } function getFieldValue ($fieldname) { if (!isset($this->tpl[$fieldname])) { return false; } return $this->tpl[$fieldname]; } function delField ($fieldname) { if (!isset($this->tpl[$fieldname])) { return false; } unset ($this->tpl[$fieldname]); } } ?> --- NEW FILE: rss_writer_class.php --- <?php if(!defined("METAL_LIBRARY_XML_RSS_WRITER_CLASS")) { define("METAL_LIBRARY_XML_RSS_WRITER_CLASS",1); include_once (dirname (__FILE__).'/xmlwriterclass.php'); /* * * Copyright © (C) Manuel Lemos 2002 * * @(#) $Id: rss_writer_class.php,v 1.1 2004/07/29 03:47:19 mjahn Exp $ * */ class rss_writer_class extends xml_writer_class { /* * Protected variables * */ var $root=""; var $channel=""; var $image=""; var $textinput=""; var $items=0; var $itemsequence=""; /* * Public variables * */ var $specification="1.0"; var $about=""; var $rssnamespaces=array(); var $allownoitems=0; var $generatedcomment="Generated by: http://www.phpclasses.org/rsswriter \$Revision: 1.1 $"; /* * Protected functions * */ function addrssproperties(&$properties,$parent,&$required,&$optional,$scope) { $noattributes=array(); $required_properties=0; Reset($properties); $end=(GetType($property=Key($properties))!="string"); for(;!$end;) { if(IsSet($required[$property])) { if($required[$property]) { $this->error=("required ".$scope." property \"".$property."\" is already set"); return 0; } $required[$property]=1; $required_properties++; } else { if(IsSet($optional[$property])) { if($optional[$property]) { $this->error=("optional ".$scope." property \"".$property."\" is already set"); return 0; } $optional[$property]=1; } else { if(GetType($colon=strpos($property,":",0))=="integer") { $namespace=substr($property,0,$colon); if(!(!strcmp($namespace,"rdf") || IsSet($this->rssnamespaces[$namespace]))) $this->error=("the name space of property \"".$property."\" was not declared"); } else $this->error=("\"".$property."\" is not a supported ".$scope." property"); } } if(!($this->adddatatag($property,$noattributes,$properties[$property],$parent,$path))) return 0; Next($properties); $end=(GetType($property=Key($properties))!="string"); } if($required_properties<count($required)) { Reset($required); $end=(GetType($property=Key($required))!="string"); for(;!$end;) { if(!($required[$property])) { $this->error=("it was not specified the required ".$scope." property \"".$property."\""); return 0; } Next($required); $end=(GetType($property=Key($required))!="string"); } } return 1; } /* * Public functions * */ Function addchannel(&$properties) { if(strcmp($this->error,"")) return 0; if(strcmp($this->channel,"")) { $this->error="a channel was already added"; return 0; } $channel_attributes=array(); switch($this->specification) { case "0.9": $root="rdf:RDF"; $attributes=array("xmlns:rdf"=>"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns"=>"http://my.netscape.com/rdf/simple/0.9/"); $required=array("description"=>0,"link"=>0,"title"=>0); $optional=array(); break; case "0.91": $root="rss"; $attributes=array("version"=>$this->specification); $required=array("description"=>0,"language"=>0,"link"=>0,"title"=>0); $optional=array("copyright"=>0,"docs"=>0,"lastBuildDate"=>0,"managingEditor"=>0,"pubDate"=>0,"rating"=>0,"webMaster"=>0); break; case "1.0": if(!strcmp($this->about,"")) { $this->error="it was not specified the about URL attribute"; return 0; } $root="rdf:RDF"; $attributes=array("xmlns:rdf"=>"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns"=>"http://purl.org/rss/1.0/"); Reset($this->rssnamespaces); $end=(GetType($namespace=Key($this->rssnamespaces))!="string"); for(;!$end;) { if(!strcmp($namespace,"rdf")) { $this->error="the rdf namespace is being redeclared"; return 0; } $attributes[("xmlns:".$namespace)]=$this->rssnamespaces[$namespace]; Next($this->rssnamespaces); $end=(GetType($namespace=Key($this->rssnamespaces))!="string"); } $channel_attributes=array("rdf:about"=>$this->about); $required=array("description"=>0,"link"=>0,"title"=>0); $optional=array(); break; default: $this->error="it was not specified a supported RSS specification version"; return 0; } $this->addtag($root,$attributes,"",$path,1); $this->root=$path; if(!($this->addtag("channel",$channel_attributes,$this->root,$path,1))) return 0; if(!($this->addrssproperties($properties,$path,$required,$optional,"channel"))) return 0; $this->channel=$path; return 1; } Function additem(&$properties) { if(strcmp($this->error,"")) return 0; if(!strcmp($this->channel,"")) { $this->error="the channel was not yet added"; return 0; } if(strcmp($this->textinput,"")) { $this->error="items can not be added to the channel after defining the textinput"; return 0; } $attributes=array(); switch($this->specification) { case "0.9": $parent=$this->root; break; case "0.91": $parent=$this->channel; break; case "1.0": if(IsSet($properties["link"])) $attributes["rdf:about"]=$properties["link"]; $parent=$this->root; break; default: $this->error="it was not specified a supported RSS specification version"; return 0; } if(!($this->addtag("item",$attributes,$parent,$path,1))) return 0; $required=array("link"=>0,"title"=>0); $optional=array("description"=>0); if(!($this->addrssproperties($properties,$path,$required,$optional,"item"))) return 0; if(!strcmp($this->specification,"1.0")) { if(!strcmp($this->itemsequence,"")) { $attributes=array(); if(!($this->addtag("items",$attributes,$this->channel,$path,1) && $this->addtag("rdf:Seq",$attributes,$path,$path,1))) return 0; $this->itemsequence=$path; } $attributes=array("rdf:resource"=>$properties["link"]); if(!($this->addtag("rdf:li",$attributes,$this->itemsequence,$path,0))) return 0; } $this->items++; return 1; } Function addimage(&$properties) { if(strcmp($this->error,"")) return 0; if(!strcmp($this->channel,"")) { $this->error="the channel was not yet added"; return 0; } if(strcmp($this->image,"")) { $this->error="the channel image was already associated"; return 0; } if($this->items!=0) { $this->error="the image can only be defined before adding the channel items"; return 0; } $attributes=array(); switch($this->specification) { case "0.9": $parent=$this->root; break; case "0.91": $parent=$this->channel; break; case "1.0": if(IsSet($properties["url"])) $attributes["rdf:about"]=$properties["url"]; $parent=$this->root; break; default: $this->error="it was not specified a supported RSS specification version"; return 0; } if(!($this->addtag("image",$attributes,$parent,$path,1))) return 0; $this->image=$path; $required=array("link"=>0,"title"=>0,"url"=>0); $optional=array("description"=>0,"width"=>0,"height"=>0); if(!($this->addrssproperties($properties,$this->image,$required,$optional,"image"))) return 0; if(!strcmp($this->specification,"1.0")) { $attributes=array("rdf:resource"=>$properties["url"]); return $this->addtag("image",$attributes,$this->channel,$path,0); } return 1; } Function addtextinput(&$properties) { if(strcmp($this->error,"")) return 0; if(!strcmp($this->channel,"")) { $this->error="the channel was not yet added"; return 0; } if(strcmp($this->textinput,"")) { $this->error="the channel text input was already associated"; return 0; } if($this->items==0 && !$this->allownoitems) { $this->error="it were not specified any items before defining the channel text input"; return 0; } $attributes=array(); switch($this->specification) { case "0.9": $parent=$this->root; break; case "0.91": $parent=$this->channel; break; case "1.0": if(IsSet($properties["link"])) $attributes["rdf:about"]=$properties["link"]; $parent=$this->root; break; default: $this->error="it was not specified a supported RSS specification version"; return 0; } if(!($this->addtag("textinput",$attributes,$parent,$path,1))) return 0; $this->textinput=$path; $required=array("description"=>0,"link"=>0,"name"=>0,"title"=>0); $optional=array(); if(!($this->addrssproperties($properties,$this->textinput,$required,$optional,"textinput"))) return 0; if(!strcmp($this->specification,"1.0")) { $attributes=array("rdf:resource"=>$properties["link"]); return $this->addtag("textinput",$attributes,$this->channel,$path,0); } return 1; } Function writerss(&$output) { if(strcmp($this->error,"")) return 0; if(!strcmp($this->channel,"")) { $this->error="it was not defined the RSS channel"; return 0; } if($this->items==0 && !$this->allownoitems) { $this->error="it were not defined any RSS channel items"; return 0; } switch($this->specification) { case "0.9": $this->dtdtype="PUBLIC"; $this->dtddefinition="-//Netscape Communications//DTD RSS 0.9//EN"; $this->dtdurl="http://my.netscape.com/publish/formats/rss-0.9.dtd"; break; case "0.91": $this->dtdtype="PUBLIC"; $this->dtddefinition="-//Netscape Communications//DTD RSS 0.91//EN"; $this->dtdurl="http://my.netscape.com/publish/formats/rss-0.91.dtd"; break; case "1.0": $this->dtdtype=""; break; default: $this->error="it was not specified a supported RSS specification version"; return 0; } return $this->write($output); } }; } ?> --- NEW FILE: config.inc.php --- <?php /** * Guestbook4phpCMS - a simple XML-guestbook with RSS-Feed * * <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: config.inc.php,v 1.1 2004/07/29 03:47:19 mjahn Exp $ * @package guestbook4phpCMS **/ /* * $Log: config.inc.php,v $ * Revision 1.1 2004/07/29 03:47:19 mjahn * updated the header of the files * included GPL and README * */ /** * Set the path to the PEAR-repository * * You may insert the path to the directory with the necessary PEAR-packages. * This script needs the following PEAR-packages: * <ul> * <li>PEAR</li> * <li>XML_Serializer</li> * <li>XML_Parser</li> * <li>XML_Util</li> * <li>HTML_Common</li> * <li>HTML_BBCodeParser</li> * <li>HTML_QuickForm</li> * </ul> * * If you have not installed PEAR on your webserver, please download these packages * from http://pear.php.net/packages.php and put them into a sub-directory in this directory, * i.e. pear/. Then put the path to the directory into the following line, where * <ul> * <li><b>dirname (__FILE__)</b> is the directory of the actual file</li> * </ul> * * If you have installed the pear packages into the subdirectory pear/, you may not have to * change anything. **/ ini_set ('include_path', dirname(__FILE__).'/../pear/:'.ini_get ('include_path')); error_reporting (E_ALL); $CONFIG = array (); global $CONFIG; $CONFIG ['datafile'] = dirname(__FILE__).'/../guestbook.xml'; $CONFIG ['admin_mail'] = 'ma...@ma...'; $CONFIG ['admin_from'] = 'gae...@ma...'; $CONFIG ['rss-file'] = '/gaestebuch.xml'; $CONFIG ['rss-desc'] = 'Gästebuch'; $CONFIG ['rss-link'] = 'http://mjahn.homelinux.org/gaestebuch.xml'; $CONFIG ['rss-title'] = 'martin-jahn.info'; $CONFIG ['rss-xsl-web'] = 'http://martin-jahn.info/gaestebuch.xsl'; ?> --- NEW FILE: class.bbcode.php --- <?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Stijn de Reede <sj...@gm...> | // +----------------------------------------------------------------------+ // // $Id: class.bbcode.php,v 1.1 2004/07/29 03:47:19 mjahn Exp $ // /** * @package HTML_BBCodeParser * @author Stijn de Reede <sj...@gm...> */ require_once('HTML/BBCodeParser.php'); class bbcode extends HTML_BBCodeParser { /** * An array of tags parsed by the engine * * @access private * @var array */ var $_definedTags = array( 'quote' => array('htmlopen' => 'q', 'htmlclose' => 'q', 'allowed' => 'all', 'attributes'=> array('quote' =>'cite=%2$s%1$s%2$s')), 'code' => array('htmlopen' => 'code', 'htmlclose' => 'code', 'allowed' => 'all', 'attributes'=> array()), 'b' => array( 'htmlopen' => 'strong', 'htmlclose' => 'strong', 'allowed' => 'all', 'attributes'=> array()), 'u' => array( 'htmlopen' => 'u', 'htmlclose' => 'u', 'allowed' => 'all', 'attributes'=> array()), 'url' => array( 'htmlopen' => 'a', 'htmlclose' => 'a', 'allowed' => 'none^img', 'attributes'=> array( 'url' => 'href=%2$s%1$s%2$s', 't' => 'target=%2$s%1$s%2$s') ) ); /** * Executes statements before the actual array building starts * * This method should be overwritten in a filter if you want to do * something before the parsing process starts. This can be useful to * allow certain short alternative tags which then can be converted into * proper tags with preg_replace() calls. * The main class walks through all the filters and and calls this * method if it exists. The filters should modify their private $_text * variable. * * @return none * @access private * @see $_text * @author Stijn de Reede <sj...@gm...> */ function _preparse() { $options = PEAR::getStaticProperty('HTML_BBCodeParser','_options'); $o = $options['open']; $c = $options['close']; $oe = $options['open_esc']; $ce = $options['close_esc']; $pattern = array( "!(^|\s|\()((((http(s?)|ftp)://)|www)[-a-z0-9.]+\.[a-z]{2,4}[^\s()]*)!i", "!".$oe."url(".$ce."|\s.*".$ce.")(.*)".$oe."/url".$ce."!iU"); $replace = array( "\\1".$o."url".$c."\\2".$o."/url".$c, $o."url=\\2\\1\\2".$o."/url".$c); $this->_preparsed = preg_replace($pattern, $replace, $this->_text); } } ?> |
From: Martin J. <mj...@us...> - 2004-07-29 03:47:06
|
Update of /cvsroot/phpcms-plugins/guestbook4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24065/include Log Message: Directory /cvsroot/phpcms-plugins/guestbook4phpCMS/include added to the repository |
From: Martin J. <mj...@us...> - 2004-07-28 12:59:17
|
Update of /cvsroot/phpcms-plugins/formular4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6854 Added Files: .cvsignore Log Message: added subdirectory pear --- NEW FILE: .cvsignore --- pear* |
From: Martin J. <mj...@us...> - 2004-07-28 11:05:57
|
Update of /cvsroot/phpcms-plugins/formular4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22456 Added Files: form4phpcms.php Log Message: extended the comments --- NEW FILE: form4phpcms.php --- <?php /** * Form4phpCMS - a simple form-engine for phpCMS * * <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: form4phpcms.php,v 1.1 2004/07/28 11:05:48 mjahn Exp $ * @package form4phpCMS **/ /* * $Log: form4phpcms.php,v $ * Revision 1.1 2004/07/28 11:05:48 mjahn * extended the comments * */ /** * Set the path to the PEAR-repository * * You may insert the path to the directory with the necessary PEAR-packages. * This script needs the following PEAR-packages: * <ul> * <li>PEAR</li> * <li>XML_Serializer</li> * <li>XML_Tree</li> * <li>XML_Parser</li> * <li>XML_Util</li> * <li>MAIL</li> * <li>HTML_QuickForm</li> * <li>HTML_Common</li> * </ul> * * If you have not installed PEAR on your webserver, please download these packages * from http://pear.php.net/packages.php and put them into a sub-directory in this directory, * i.e. pear/. Then put the path to the directory into the following line, where * <ul> * <li><b>dirname (__FILE__)</b> is the directory of the actual file</li> * </ul> * * If you have installed the pear packages into the subdirectory pear/, you may not have to * change anything. **/ ini_set ('include_path', dirname (__FILE__).'/pear/:'. ini_get ('include_path')); /** * Set the path to the configfile * * <ul> * <li><b>dirname (__FILE__)</b> is the directory of the actual file</li> * </ul> **/ $configfile = dirname (__FILE__).'/form4phpcms.conf.xml'; // include the class-file include_once (dirname (__FILE__).'/include/class.form4phpcms.php'); // initialize a new object ... $FORM = new form4phpcms ($configfile); if (PEAR::isError ($FORM)) { return true; } // ... and start the application $FORM->start (); // at the end clean the varscope unset ($FORM); ?> |
From: Martin J. <mj...@us...> - 2004-07-28 10:57:07
|
Update of /cvsroot/phpcms-plugins/formular4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20743 Added Files: form4phpcms.data.xml Log Message: set initial data structure --- NEW FILE: form4phpcms.data.xml --- <?xml version="1.0" encoding="iso-8859-15"?> <xml> <entry> <subject /> <message /> <name /> <email /> </entry> <entry> <subject /> <message /> <name /> <email /> </entry> </xml> |
From: Martin J. <mj...@us...> - 2004-07-28 10:55:03
|
Update of /cvsroot/phpcms-plugins/formular4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20478 Added Files: form4phpcms.conf.xml Log Message: rearranged the config-data --- NEW FILE: form4phpcms.conf.xml --- <?xml version="1.0" encoding="iso-8859-15"?> <xml> <mail:from>Kontaktformular <ko...@ma...></mail:from> <mail:to>ma...@mj...</mail:to> <mail:body>%name schrieb am %dd.%mm.%YY um %HH:%MM: %message </mail:body> <formular> <select name="KONTAKT[subject]" title="Bitte wählen Sie einen Betreff aus" label="Betreff"> <option>Admin4phpCMS</option> <option>Autodescgen</option> <option>Community</option> <option>Error4phpCMS</option> <option>Install4phpCMS</option> <option>Lexiword</option> <option>Photo4phpCMS</option> <option>Prev-Next-Navigation</option> <option>SearchLog</option> <option>Smarty4phpCMS</option> <option>TopReferer</option> <option>PHP allgemein</option> <option>Sonstiges</option> </select> <textarea name="KONTAKT[message]" title="Bitte geben Sie Ihre Fragen ein" label="Nachricht" /> <submit name="KONTAKT[submit]" label="Senden" title="Anfrage absenden" /> <text name="KONTAKT[name]" title="Bitte geben Sie Ihren Namen ein" label="Name" /> <text name="KONTAKT[email]" title="Bitte geben Sie Ihre Emailadresse" label="Email" /> <check name="KONTAKT[copy]" title="wünschen Sie eine Kopie der Email an Ihre Adresse?" label="Kopie an Ihre Emailadresse" /> </formular> </xml> |
From: Martin J. <mj...@us...> - 2004-07-28 10:54:35
|
Update of /cvsroot/phpcms-plugins/formular4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20418/include Added Files: class.form4phpcms.php Log Message: email notification and datafile insert --- NEW FILE: class.form4phpcms.php --- <?php /** * Form4phpCMS - a simple form-engine for phpCMS * * <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.form4phpcms.php,v 1.1 2004/07/28 10:54:26 mjahn Exp $ * @package form4phpCMS **/ /* * $Log: class.form4phpcms.php,v $ * Revision 1.1 2004/07/28 10:54:26 mjahn * email notification and datafile insert * */ /** * include necessary PEAR-packages */ include_once ('XML/Serializer.php'); include_once ('XML/Unserializer.php'); include_once ('XML/Tree.php'); include_once ('HTML/QuickForm.php'); include_once ('Mail.php'); /** * @package form4phpCMS **/ class form4phpcms { var $_xml_options = array ('indent'=>"\t", 'linebreak'=>"\n", 'addDecl'=>true, 'tagName'=>'xml', 'defaultTagName'=>'entry', 'encoding'=>'iso-8859-15'); var $_configfile = ''; var $_datafile = ''; function form4phpcms ($configfile = '') { register_shutdown_function (array (&$this, '__destruct')); return $this->__construct ($configfile); } function loadConfigFile ($configfile) { $this->_configfile = $configfile; return $this->_loadConfigFile (); } function start () { $this->_createFormData (); if ($this->FORM->validate ()) { // process form-data $this->FORM->process (array (&$this, '_processFormData'), false); } $this->FORM->display (); } /** * @access private **/ function _loadConfigFile () { if (!file_exists ($this->_configfile)) { return false; } $XML =& new XML_Tree ($this->_configfile); $tree =& $XML->getTreeFromFile (); $num = count ($tree->children); for ($i = 0; $i < $num; $i++) { $this->_config [$tree->children [$i]->name] =& $tree->children [$i]; } } /** * @access private **/ function _saveConfigFile () { } /** * @access private **/ function _loadDataFile () { // check for existing datafile if (!file_exists ($this->_datafile) && !is_writeable (dirname ($this->_datafile))) { echo '1'; return false; } // create datafile if not exists if (!file_exists ($this->_datafile)) { $fh = fopen ($this->_datafile, 'wb'); fclose ($fh); $this->_data = array (); echo '2'; return true; } // parse XML data from file into array $XML =& new XML_Unserializer (); if (!$XML->unserialize ($this->_datafile, true)) { return false; } $this->_data =& $XML->getUnserializedData (); if (PEAR::isError ($this->_data)) { return false; } $this->_data = $this->_data ['entry']; return true; } /** * @access private **/ function _saveDataFile () { // check for existing data if (!isset ($this->_data)) { return false; } // check for existing datafile if (!file_exists ($this->_datafile) && !is_writeable (dirname ($this->_datafile))) { return false; } // check for write-permissions if (!is_writeable ($this->_datafile)) { return false; } // serialize the data into an XML-structure $XML =& new XML_Serializer ($this->_xml_options); $XML->serialize ($this->_data); $data = $XML->getSerializedData (); // write serialized data into file $fh = fopen ($this->_datafile, 'wb'); fwrite ($fh, $data); fclose ($fh); } /** * @access private **/ function _processFormData () { $this->_datafile = realpath (dirname (__FILE__).'/../form4phpcms.data.xml'); $this->_loadDataFile (); $this->_data [] = array_merge ($_POST ['KONTAKT'], array ('time'=>time ())); $this->_sendMail ($_POST ['KONTAKT'] ['subject'], $_POST ['KONTAKT'] ['message']); $this->_saveDataFile (); echo '<!--'; print_r ($this); echo '-->'; } function _sendMail ($subject, $text) { $MAIL =& MAIL::factory ('mail'); $MAIL->send ($this->_config ['mail:to']->content, array ('From'=>$this->_config ['mail:from']->content, 'Subject'=>$subject), $text); } /** * @access private **/ function _createFormData () { $this->FORM =& new HTML_QuickForm ('formmailer'); if (PEAR::isError ($this->FORM)) { echo '1'; return false; } $TPL =& $this->FORM->defaultRenderer(); $TPL->setFormTemplate('<form {attributes}>'."\n".'{content}</form>'."\n"); $TPL->setHeaderTemplate('<h2>{header}</h2>'."\n"); $TPL->setRequiredNoteTemplate(''); $TPL->setElementTemplate('<div <!-- BEGIN required -->class="required"<!-- END required -->>'."\n".' {label}<br />'."\n".' {element}'."\n".'<!-- BEGIN error --> <p class="error">{error}</p><!-- END error -->'."\n".'</div>'."\n"); $num = count ($this->_config ['formular']->children); for ($i = 0; $i < $num; $i++) { $this->_createFormElements ($this->_config ['formular']->children [$i]); } } /** * @access private **/ function _createFormElements (&$data) { switch ($data->name) { case 'select': $this->FORM->addElement('select', $data->attributes ['name'], $data->attributes ['label']); $select =& $this->FORM->getElement($data->attributes ['name']); $select->setsize(1); $select->setMultiple(false); $num = count ($data->children); for ($i = 0; $i < $num; $i++) { if ($i == 0) { $select->addOption($data->children [$i]->content, $data->children [$i]->content,'selected="selected"'); continue; } $select->addOption($data->children [$i]->content, $data->children [$i]->content); } break; case 'text': $this->FORM->addElement ('text', $data->attributes ['name'], $data->attributes ['label']); break; case 'textarea': $this->FORM->addElement ('textarea', $data->attributes ['name'], $data->attributes ['label'], 'cols="40" rows="10"'); break; case 'submit': $this->FORM->addElement ('submit', $data->attributes ['name'], $data->attributes ['label']); break; case 'check': $this->FORM->addElement ('checkbox', $data->attributes ['name'], '', $data->attributes ['label']); break; default:; } } /** * @access private **/ function __construct ($configfile = '') { if ($configfile == '') { echo '1'; return true; } return $this->loadConfigFile ($configfile); } /** * @access private **/ function __destruct () { } } ?> |
From: Martin J. <mj...@us...> - 2004-07-27 13:15:03
|
Update of /cvsroot/phpcms-plugins/lexiword In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23607 Modified Files: lexiword.php Log Message: fixed some little bugs Index: lexiword.php =================================================================== RCS file: /cvsroot/phpcms-plugins/lexiword/lexiword.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- lexiword.php 22 Apr 2004 08:05:49 -0000 1.1.1.1 +++ lexiword.php 27 Jul 2004 13:14:54 -0000 1.2 @@ -2,9 +2,9 @@ /** * LexiWord - Plugin für phpCMS * -* @author: Martin Jahn <ma...@ma...> +* @author: Martin Jahn <mj...@us...> * @license: GPL -* @version: 0.2beta +* @version: $Id$ * @package lexiword * * Das Plugin erkennt in einer Contentdatei alle vorkommenden Begriffe aus einer Glossardatei. @@ -47,15 +47,24 @@ * * 5. Fertig ;-) Gucken ob es funktioniert :-) **/ +/* +* $Log$ +* Revision 1.2 2004/07/27 13:14:54 mjahn +* fixed some little bugs +* +*/ /** +* 2004-07-27 +* Bugfix: +* Links werden nun richtig ersetzt +* Suchbegriffe können nun auch Leerzeichen beinhalten. +* * 2004-04-19 * Bugfix: * Die Begriffe wurden bisher mit der Schreibweise ersetzt, * wie sie in der Glossardatei steht. Ab sofort wird die Schreibweise * so beibehalten, wie sie vorgefunden wird -* Bugfix: -* **/ @@ -111,7 +120,7 @@ * * Die Namen der Tags müssen mit | getrennt werden. **/ -$ignoreTags = 'a|link|q|code'; +$ignoreTags = 'a|link|q|code|h2'; /* ############################################## @@ -141,9 +150,9 @@ * eventuell an eigene Formatierungen in der Glossardatei anpassen */ preg_match_all('$<dt>(.*?)</dt>\s*?<dd>(.*?)</dd>(\s*?<dd>.*?([http://|mailto:|ftp://]+://[^\s<>"]+).*?</dd>)*$sm',$lexikon,$entries); -/* echo '<!--'; + echo '<!--'; print_r($entries); - echo '-->';*/ + echo '-->'; /** * $entries ist ein Array * @@ -159,18 +168,18 @@ /** * erstelle die Arrays für Suchen und Ersetzen */ - for ($i = 0; $i<$max; $i++) { - $search[] = trim($entries[1][$i]); + for ($i = 0; $i<$max; $i++) { + $search[] = trim($entries[1][$i]); if (isset($entries[4][$i]) && trim($entries[4][$i])!='') { - $item = str_replace(array('%desc', '%link'),array(trim($entries[2][$i]),trim($entries[1][$i]), trim($entries[4][$i])) ,$formatlink); + $item = str_replace(array('%desc', '%link'), array (trim ($entries [2] [$i]), trim ($entries [4] [$i])), $formatlink); } else { - $item = str_replace(array('%desc'),array(trim($entries[2][$i]),trim($entries[1][$i])) ,$format); + $item = str_replace(array('%desc'),array(trim($entries[2][$i]),trim($entries[1][$i])) ,$format); } - $replace[] = $item; - } + $replace[] = $item; + } - foreach ($fields as $field) { - if (isset($PageContent->{$field})) { + foreach ($fields as $field) { + if (isset($PageContent->{$field})) { $content = join('',$PageContent->{$field}); // Ersetze die phpcms-Variablen, so daß sie in der RegEx wegen /e nicht mit ausgewertet werden @@ -183,7 +192,7 @@ if (trim($content)!='') { $max = count($search); for ($i=0; $i<$max; $i++) { - $s = $search[$i]; + $s = str_replace (' ', '\s', $search[$i]); $r = $replace[$i]; /* Auslesen des Textes aus dem Contentfeld */ if ($match_only_whole_words) { @@ -219,7 +228,5 @@ * klar singular/plural-Erkennung... ;-) * plus: Bindestriche gelten als Trenner zwischen zwei Worten... * Quotes und Klammern dito... -* Ausschluß von durch zwei Marken definierter Bereiche (z.B. innerhalb von Überschriften, Links, etc.) -* möglichst konfigurierbar **/ ?> \ No newline at end of file |
From: Martin J. <mj...@us...> - 2004-07-26 15:48:04
|
Update of /cvsroot/phpcms-plugins/formular4phpCMS/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv570/include Log Message: Directory /cvsroot/phpcms-plugins/formular4phpCMS/include added to the repository |
From: Martin J. <mj...@us...> - 2004-07-24 09:07:48
|
Update of /cvsroot/phpcms-plugins/prev-next In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26558 Modified Files: prev-next.php Added Files: .project Log Message: update for eclipse Index: prev-next.php =================================================================== RCS file: /cvsroot/phpcms-plugins/prev-next/prev-next.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- prev-next.php 19 May 2003 06:18:35 -0000 1.2 +++ prev-next.php 24 Jul 2004 09:07:39 -0000 1.3 @@ -1,117 +1,236 @@ -<? -/* - prev-next.php - Plugin für phpCMS +<?php +/** +* PrevNext - Plugin für phpCMS +* +* @author: Martin Jahn <ma...@ma...> +* @license: GPL +* @version: 0.2beta +* @package prevnext +* +* Das Skript erstellt auf der Basis des Menüs von phpCMS eine vor-zurück Navigation +* für die aktuelle Menüklasse. Dazu wird der aktuelle Menüpunkt und, wenn +* vorhanden, die vorhergehende und die darauf folgende Seite gesucht. +* +* Anschließend werden die Links per Tag-Ersetzung in deine phpCMS-Seite eingefügt. +* +* Dieses Plugin/Skript veroeffentliche ich so wie es ist und gebe deshalb auch keinerlei Garantie, +* dass es richtig funktioniert. Ausserdem uebernehme ich keinerlei Haftung fuer eventuelle durch +* die Anwendung des Plugins/Skriptes entstehenden Schaeden. +* +* Falls du Verbesserungsvorschlaege oder Wuensche bezueglich des Skriptes hast melde dich bei +* Martin Jahn <ma...@ma...> +* +* Viel Spass +* +* Dieses Script ist kostenlos für private und kommerzielle Nuzung. +* Es wird unter den Bedingungen der GNU General Public License, wie von der Free +* Software Foundation herausgegeben, verteilt. Eine Kopie der GPL sollte im Zip-File +* enthalten sein. Das Script darf (im Rahmen der GPL) nach belieben genutzt, weiter- +* gegeben und modifiziert werden. Dieser Copyright-Hinweis muss jedoch in jedem Fall +* unverändert im Script belassen werden. +* +* Ich übernehme keinerlei Verantwortung für Schäden, die durch die Nutzung dieses +* Scripts entstehen. Bei Fehlern würde ich jedoch gerne informiert werden, damit +* ich diese ausbügeln kann. Auch für den Fall, dass Ihr Verbesserungen vornehmt, +* Verbesserungsvorschläge oder -wünsche habt, wäre ich dankbar für eine Benachrichtigung. +**/ - Das Skript erstellt auf der Basis des Menüs von phpCMS eine prev-next Navigation - für die aktuelle Menüklasse. Dazu wird der aktuelle Menüpunkt gesucht und dann wenn - vorhanden die vorhergehende und die darauf folgende Seite gesucht. +/** +* template for the links +* +* you may use all fieldnames you have defined in the menu-file with a leading % +* i.e. if you use MNAME in your menufile, you may use %MNAME in the template-declarations +* the active-parts are used, if the page exists +* the passiv-parts are used, if the page does not exist +**/ +$tpl['first']['active'] = '<a href="%LINK" title="%MNAME - %TEXT">|<</a>'; +$tpl['first']['passiv'] = '<span class="passiv">|<</span>'; +$tpl['prev']['active'] = '<a href="%LINK" title="%MNAME - %TEXT">«</a>'; +$tpl['prev']['passiv'] = '<span class="passiv">«</span>'; +$tpl['top']['active'] = '<a href="%LINK" title="%MNAME - %TEXT">^</a>'; +$tpl['top']['passiv'] = '<span class="passiv">^</span>'; +$tpl['next']['active'] = '<a href="%LINK" title="%MNAME - %TEXT">»</a>'; +$tpl['next']['passiv'] = '<span class="passiv">»</span>'; +$tpl['last']['active'] = '<a href="%LINK" title="%MNAME - %TEXT">>|</a>'; +$tpl['last']['passiv'] = '<span class="passiv">>|</span>'; - Anschließend werden die Links per Tag-Ersetzung in deine phpCMS-Seite eingefügt. - Autor: Martin Jahn (mja...@we...) +/** +* name of the tag to replace in the template-/content-file +**/ +$tag_id['first'] = '<phpcms:first />'; +$tag_id['prev'] = '<phpcms:prev />'; +$tag_id['top'] = '<phpcms:top />'; +$tag_id['next'] = '<phpcms:next />'; +$tag_id['last'] = '<phpcms:last />'; - Version: 0.1 / 02.02.2003 +/** +* recursion through the menu-levels +* +* value: number of levels for recursion +* 0: no recursion +* 1: one menu-level-recursion +* 2: two menu-level-recursion +**/ +$recursion = 0; - Homepage: http://martin.et-studium.de/ - eMail: ma...@et... - Copyright: Martin Jahn +/** +* add the new tags in before the existing tags? +**/ +$in_front = false; - Dieses Script ist kostenlos für private und kommerzielle Nuzung. - Es wird unter den Bedingungen der GNU General Public License, wie von der Free - Software Foundation herausgegeben, verteilt. - Eine Kopie der GPL sollte im Zip-File enthalten sein. - Das Script darf (im Rahmen der GPL) nach belieben genutzt, weitergegeben und - modifiziert werden. - Dieser Copyright-Hinweis muss jedoch in jedem Fall unverändert im Script be- - lassen werden. +/*************************************************** +** you may not change anything below this line, ** +** except if you knew, what you do ;) ** +***************************************************/ +$e = 0; +$m = 0; +$menues = 0; +$entries = 0; +$index = array(); +/** +* do nothing in phpCMS-EDIT-mode +**/ +if (isset($DEFAULTS->EDIT)) { + return; +} - Ich übernehme keinerlei Verantwortung für Schäden, die durch die Nutzung dieses - Scripts entstehen. - Bei Fehlern würde ich jedoch gerne informiert werden, damit ich diese ausbügeln - kann. - Auch für den Fall, dass Ihr Verbesserungen vornehmt, Verbesserungsvorschläge - oder -wünsche habt, wäre ich dankbar für eine Benachrichtigung. - Viel Spaß !!! +/** +* helper function for the template-engine +**/ +function ext_string(&$item, $key, $prefix) { + $item = $prefix.$item; +} - Martin -*/ -$dir_prev = '<<'; -$dir_next = '>>'; +/** +* iterating through the menu-array until we found the $page-name +**/ +function getMenuEntry($data = '') { + global $MENU; + if ($data == '') { + return false; + } + $menues = count ($MENU->menuFieldValues); + + for ($m = 0; $m < $menues; $m++) { + $entries = count ($MENU->menuFieldValues[$m]); + for ($e = 0; $e < $entries; $e++) { + if (in_array ($data, $MENU->menuFieldValues[$m][$e])) { + return array($m, $e, $entries); + } + } + } + return false; -$nolink = '%dir%'; -$link = '<link "%link%,_self,%name%">%dir%</link>'; -// Dateinamen der aktuellen Seite bestimmen -$page = $CHECK_PAGE->path."/".$CHECK_PAGE->name.$CHECK_PAGE->parms; +} -// Rekursiv in Unterverzeichnisse linken -// 0 -> gehe in der Menüdatei bis zum letzten Eintrag mit der URL -// 1 -> bleibe auf der ersten Menüebene, in der sich die aktuelle Seite befindet -// - zum Beispiel nützlich, wenn du im Haupt- und Untermenü die gleiche Seite zweimal drin stehen hast -// - bei 0 wird auf die Untermenüseite verlinkt -// - bei 1 wird auf die Hauptmenüseite verlinkt -$stop_at_first = 0; +/** +* Dateinamen der aktuellen Seite bestimmen +**/ +$page['LINK_PARAM'] = $CHECK_PAGE->path."/".$CHECK_PAGE->name.$CHECK_PAGE->parms; +$page['LINK'] = $CHECK_PAGE->path."/".$CHECK_PAGE->name; -// im Stealth-Mode noch den Parser vor den Link hängen -if ($GLOBALS['DEFAULTS']['STEALTH'] == 'off') { - $prelink = $GLOBALS['DEFAULTS']['SCRIPT_PATH'].'/'.$GLOBALS['DEFAULTS']['SCRIPT_NAME'].'?file='; +/** +* iterating through the menu-array until we found the $page-name +**/ +if (!($index['actual'] = getMenuEntry($page['LINK']))) { + $index['actual'] = getMenuEntry($page['LINK_PARAM']); } -// einzelne Menüklassen durchlaufen: MAIN, SUB1 .... -// Anzahl der Menüpunkte in der obersten Ebene -$x = count($GLOBALS['MENU']->menuFieldValues); -$stop = 0; +if (!$index['actual']) { + return; +} -for($xtmp=0; $xtmp<$x; $xtmp++) { +/** +* set data for first-page link +**/ +if ($index['actual'][1] > 0 && isset($MENU->menuFieldValues[$index['actual'][0]][0])) { + $index['first'] = array($index['actual'][0], 0); +} else { + $index['first'] = false; +} - // Anzahl der Menüpunkte in der zweiten Ebene - $y=count($GLOBALS['MENU']->menuFieldValues[$xtmp]); - for($ytmp=0; $ytmp<$y; $ytmp++) { +/** +* set data for previous-page link +**/ +if ($index['actual'][1] > 0 && isset($MENU->menuFieldValues[$index['actual'][0]][$index['actual'][1] - 1])) { + $index['prev'] = array($index['actual'][0], $index['actual'][1] - 1); +} else { + $index['prev'] = false; +} - // befindet sich die aktuelle Datei in dieser Ebene ? - if (in_array ($page , $GLOBALS['MENU']->menuFieldValues[$xtmp][$ytmp])) { +/** +* set data for next-page link +**/ +if ($index['actual'][1] < $index['actual'][2] - 1 && isset($MENU->menuFieldValues[$index['actual'][0]][$index['actual'][1] + 1])) { + $index['next'] = array($index['actual'][0], $index['actual'][1] + 1); +} else { + $index['next'] = false; +} - // existiert ein nachfolgender Menüpunkt ? - if (isset($GLOBALS['MENU']->menuFieldValues[$xtmp][$ytmp+1])) { - $next = $GLOBALS['MENU']->menuFieldValues[$xtmp][$ytmp+1]; - } else { - unset($next); - } - //$next = $GLOBALS['MENU']->menuFieldValues[$xtmp][$ytmp+1]; +/** +* set data for last-page link +**/ +if ($index['actual'][1] != $index['actual'][2] - 1 && isset($MENU->menuFieldValues[$index['actual'][0]][$index['actual'][1] - 1])) { + $index['last'] = array($index['actual'][0], $index['actual'][2] - 1); +} else { + $index['last'] = false; +} - // existiert ein vorhergehender Menüpunkt ? - if (isset($GLOBALS['MENU']->menuFieldValues[$xtmp][$ytmp-1])) { - $prev = $GLOBALS['MENU']->menuFieldValues[$xtmp][$ytmp-1]; - } else { - unset($prev); - } - //$prev = $GLOBALS['MENU']->menuFieldValues[$xtmp][$ytmp-1]; +/** +* get the menu-class of the current page +**/ +$search = $MENU->menuFieldNames[$index['actual'][0]]; +array_walk($search, 'ext_string', '%'); +$replace = $MENU->menuFieldValues[$index['actual'][0]][$index['actual'][1]]; +$page['LINK'] = $page; +$page['CLASS'] = str_replace($search, $replace, '%CLASS'); - if ($stop_at_first == 1) { - $stop = 1; - } - } - if ($stop==1) { - break 2; - } - } +/** +* set data for the top-page link +**/ +if (strpos ($page['CLASS'], '.') > 0) { + $page['PARENT_CLASS'] = substr ($page['CLASS'], 0, strrpos($page['CLASS'], '.')); + if (in_array($page['PARENT_CLASS'], $MENU->menuKlasse)) { + $index['top'] = getMenuEntry ($page['PARENT_CLASS']); + } else { + $index['top'] = false; + } } -// Tag für den Link auf die nachfolgende Seite -$current=count($Tags); -$Tags[$current][0]='<!-- NEXTPAGE //-->'; -if ((isset($next)) || (strlen(trim($next[3]))==0)) { - $Tags[$current][1]='nix next'; -} else { - $Tags[$current][1]= '<link "'.$prelink.$next[2].',_self,Weiter">>></a>'; +/** +* generate the necessary tags for the content +**/ +reset($index); +foreach ($index as $id=>$data) { + if (!isset($tpl[$id])) { + continue; + } + if ($data === false) { + $Tags[] = array($tag_id[$id], $tpl[$id]['passiv']); + continue; + } + $search = $MENU->menuFieldNames[$data[0]]; + array_walk($search, 'ext_string', '%'); + $replace = $MENU->menuFieldValues[$data[0]][$data[1]]; + $tag_data = array($tag_id[$id], str_replace($search, $replace, $tpl[$id]['active'])); + if ($in_front) { + array_unshift ($Tags, $tag_data); + } else { + $Tags[] = $tag_data; + } } -// Tag für die vorherige Seite */ -$current=count($Tags); -$Tags[$current][0]='<!-- PREVPAGE //-->'; // In dieses Tag wird der Link für die nächste Seite getauscht -if (isset($prev)) $Tags[$current][1]='nix prev'; -// hier kannst du das Aussehen des Links bestimmen -else $Tags[$current][1]= '<link "'.$prelink.$prev[2].',_self,Zurück"><<</a>'; -?> +/** +* clean the var-scope +**/ +unset ($data, $e, $entries, $id, $index, $in_front, $m, $menues, $page, $recursion, $replace, $search, $tag_id, $tag_data, $tpl); + +/** +* TODO: +* Rekursion in die Verzeichnisebenen möglich (sinnvoll?) +**/ +?> \ No newline at end of file --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>prev-next</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:07:18
|
Update of /cvsroot/phpcms-plugins/user4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26476 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>user4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:06:54
|
Update of /cvsroot/phpcms-plugins/smarty4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26389 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>smarty4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:06:33
|
Update of /cvsroot/phpcms-plugins/searchlog4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26319 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>searchlog4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:06:11
|
Update of /cvsroot/phpcms-plugins/phpcms-installer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26233 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>phpcms-installer</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:05:41
|
Update of /cvsroot/phpcms-plugins/onlineEditor4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26154 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>onlineEditor4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:05:02
|
Update of /cvsroot/phpcms-plugins/lexiword In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26062 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>lexiword</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:04:37
|
Update of /cvsroot/phpcms-plugins/guestbook4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26026 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>guestbook4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:04:09
|
Update of /cvsroot/phpcms-plugins/formular4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25923 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>formular4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:03:34
|
Update of /cvsroot/phpcms-plugins/error4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25889 Added Files: .project Log Message: update for eclipse --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>error4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 09:01:50
|
Update of /cvsroot/phpcms-plugins/dirManager4phpCMS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25610 Added Files: .project Log Message: update --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>dirManager4phpCMS</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> |
From: Martin J. <mj...@us...> - 2004-07-24 08:59:30
|
Update of /cvsroot/phpcms-plugins/autodescgen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25174 Added Files: .cvsignore Log Message: update --- NEW FILE: .cvsignore --- .project |
From: Martin J. <mj...@us...> - 2004-07-24 08:58:36
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/modules/phpcms Added Files: class.module_phpcms.php class.phpcms_menu.php config.tpl.xml Log Message: changed some things --- NEW FILE: config.tpl.xml --- <?xml version="1.0" encoding="iso-8859-1"?> <structure> <tab id="standard" label="Allgemein"> <element id="PAGE_EXTENSION" label="Erweiterung der Seiten" type="input_text" /> <element id="PAGE_DEFAULTNAME" label="Standarderweiterung der Seiten" type="input_text" /> <element id="TEMPEXT" label="Erweiterung der Templatedateien" type="input_text" /> <element id="GLOBAL_PROJECT_FILE" label="Standard Projectdatei" type="input_text" /> <element id="GLOBAL_PROJECT_HOME" label="Standard Homeverzeichnis" type="input_text" /> <element id="PLUGIN_DIR" label="Standard-Pluginverzeichnis" type="input_text" /> <element id="START_FIELD" label="Start-Feld" type="input_text" /> <element id="STOP_FIELD" label="Stop-Feld" type="input_text" /> </tab> <tab id="pax" label="PAX & MAil2Crypt"> <element id="PAX" label="PAX-Erweiterung" type="checkbox" /> <element id="PAXTAGS" label="PAX-Tags" type="checkbox" /> <element id="MAIL2CRYPT" label="Mail2Crypt-Erweiterung" type="checkbox" /> <element id="MAIL2CRYPT_JS" label="Mail2Crypt JS-Pfad" type="input_text" /> <element id="MAIL2CRYPT_IMG" label="Mail2Crypt Img-Pfad" type="input_text" /> </tab> <tab id="cache" label="Cache"> <element id="CACHE_STATE" label="Server-Cache" type="checkbox" /> <element id="CACHE_DIR" label="Cacheverzeichnis" type="input_text" /> <element id="CACHE_CLIENT" label="Client-Cache" type="checkbox" /> <element id="PROXY_CACHE_TIME" label="Proxy-Cache-Zeit" type="input_text" /> </tab> <tab id="server" label="Servereinstellungen"> <element id="GZIP" label="GZIP-Komprimierung" type="checkbox" /> <element id="STEALTH" label="Stealth-Modus" type="checkbox" /> <element id="STEALTH_SECURE" label="Secure-Stealth-Mode" type="checkbox" /> <element id="NOLINKCHANGE" label="Non-Stealt-Mode-Endungen" type="input_text" /> <element id="DEBUG" label="Debug-Modus" type="checkbox" /> <element id="ERROR_PAGE" label="allg. Fehlerseite" type="input_text" /> <element id="ERROR_PAGE_404" label="Fehlerseite für Fehler 404" type="input_text" /> <element id="TAGS_ERROR" label="Fehler bei leerem Tag" type="checkbox" /> <element id="P3P_HEADER" label="P3P-Header" type="checkbox" /> <element id="P3P_POLICY" label="P3P-Policy" type="input_text" /> <element id="P3P_HREF" label="P3P-Link" type="input_text" /> </tab> <tab id="statistik" label="Statistik"> <element id="STATS" label="Statistik" type="checkbox" /> <element id="STATS_DIR" label="Verzeichnis für die Statistik" type="input_text" /> <element id="STATS_CURRENT" label="Verzeichnis für die aktuellen Statistikdaten" type="input_text" /> <element id="STATS_FILE" label="Dateiname für die Statistik" type="input_text" /> <element id="STATS_BACKUP" label="Verzeichnis für Backup der Statistik" type="input_text" /> <element id="STATS_IP_COUNT" label="Anzahl IPs loggen" type="input_text" /> <element id="STATS_IP_IGNORE" label="IPs ausschließen" type="input_text" /> <element id="STATS_URL_COUNT" label="Anzahl URLs zählen" type="input_text" /> <element id="REFERRER" label="Referrer-Logging" type="checkbox" /> <element id="REFERRER_FILE" label="Datei für Referrer-Daten" type="input_text" /> <element id="STATS_REFERER_COUNT" label="Anzahl Referrer" type="input_text" /> <element id="STATS_REFERER_IGNORE" label="IPs ausschließen" type="input_text" /> <element id="REF_RELOAD_LOCK" label="Zeitdauer der Reloadsperre" type="input_text" /> </tab> <tab id="other" label="Sonstiges"> <element id="LANGUAGE" label="Sprache" type="input_text" /> <element id="PASS" label="Passwort" type="input_password" /> <element id="ENABLE_ONLINE_EDITOR" label="Online-Editor" type="checkbox" /> </tab> --> </structure> --- NEW FILE: class.phpcms_menu.php --- <?php /** * Manipulation of the phpcms-menufile * * <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_phpcms **/ /* * $Log$ */ /** * Class for manipulating the phpcms-menufile * * @package admin4phpCMS * @subpackage module_phpcms * @author Martin Jahn <mj...@us...> * @copyright (c) Copyright by Martin Jahn * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ **/ class phpcms_menu { function phpcms_menu () { return $this->__construct (); } function __construct () { $this->docroot = realpath($_SERVER['DOCUMENT_ROOT']); } function insert ($class, $menuEntry, $after = true, $recursive = false) { if (!isset($this->quicklink[$class])) { return false; } $parentclass = substr($class, 0, strrpos ($class, '.')); if ($parentclass == $this->root) { $menu =& $this->menu; } else { $menu =& $this->quicklink[$parentclass]['_sub_']; } for ($i = 0; $i < count ($menu); $i++) { if ($menu[$i]['CLASS'] != $class) { continue; } break; } if (isset($this->quicklink[$menuEntry['CLASS']])) { for ($j = 0; isset($this->quicklink[$menuEntry['CLASS'].$j]); $j++); $menuEntry['CLASS'] = $menuEntry['CLASS'].$j; } if ($after) { $i = ($i == count($menu)) ? count($menu) : $i + 2; array_splice($menu, $i, 0, array($menuEntry)); } else { $i = ($i == 0) ? 0 : $i; array_splice($menu, $i, 0, array($menuEntry)); } $this->quicklink[$menuEntry['CLASS']] = $menu[$i]; } function delete ($class) { if (isset($this->quicklink[$class])) { return false; } $parentclass = substr($class, 0, strrpos ($class, '.')); $menu =& $this->quicklink[$parentclass]; for ($i = 0; $i < count ($menu); $i++) { if ($menu[$i]['CLASS'] != $class) { continue; } break; } $this->quicklink['parentclass'] = array_splice($menu, $i, 1); } function load ($menufile) { if (!file_exists($menufile) || !is_file($menufile)) { return false; } $this->menufile = $menufile; $this->__parse(); } function save ($tofile, $as = 'phpcms') { if (!file_exists(dirname($tofile)) || !is_writeable($tofile)) { return false; } $this->savefile = $tofile; switch ($as) { case 'phpcms': $o = $this->__saveAsPhpCMS(); break; case 'xml': $o = $this->__saveAsXML(); break; default; } $fh = fopen ($tofile, 'wb'); fwrite ($fh, $o); fclose ($fh); } function getEntryByClass ($class) { $parentclass = substr ($class, 0, strrpos ($class, '.')); if (!isset ($this->menuclasses)) { return false; } for ($i = 0; $i < count($this->menuclasses); $i++) { if ($this->menuclasses[$i] == $parentclass) { } } } function __parse () { // check if the menufile exists if (!file_exists($this->menufile) || !is_file($this->menufile)) { return false; } // get content from menufile $data = file ($this->menufile); // initialize some variables $this->menu = array(); $new = false; $menufields = array(); $menucounter = -1; $entrycounter = 0; // walk through the lines of the menufile for ($i = 0; $i < count($data); $i++) { // remove trailing and leading whitespace $line = trim($data[$i]); // check for empty line if (trim($line) == '') { continue; } // check for comment-line if ($line[0] == ';') { countinue; } // check for menu-definition if (substr($line, 0, 5) == 'MENU:') { if (substr($line, -1) == ';') { $line = trim(substr($line, 0, strrpos($line, ';'))); } $menulevel = trim (substr($line, 5)); // increase the counter for the menublocks $menucounter++; // initialize the new element in the menuarray $this->menu[$menucounter] = array(); $entrycounter = 0; // save actual menuposition in pointer $actual =& $this->menu[$menucounter]; continue; } // check for field-definition line if (substr($line, 0, 6) == 'CLASS;') { if (substr($line, -1) == ';') { $line = trim(substr($line, 0, strrpos($line, ';'))); } // get field definitions $menufielddata = explode(';',$line); // initialize some variables $k = 0; $menufields = array(); // walk throught the array of field definitions for ($j = 0; $j < count($menufielddata); $j++) { $l = trim($menufielddata[$j]); // save name of field definition $menufields[$k++] = $l; } continue; } // now we have a menu entry, explode into field elements $entry = explode(';', $line); for ($j = 0; $j < count($menufields); $j++) { // put data of menu-entry into menu-structure $actual[$entrycounter][$menufields[$j]] = trim($entry[$j]); } $actual[$entrycounter]['_level_'] = $menulevel; // increase menucounter $entrycounter++; $this->menuclasses[$menucounter] = substr($actual[0]['CLASS'], 0, strrpos($actual[0]['CLASS'], '.')); } // sort the array with the menu-classes $temp = $this->menuclasses; sort ($temp); $this->root = $temp[0]; echo '<!--'; print_r($this->menu); echo '-->'; // complete building of menu-structure $this->menu = $this->__recurseMenu($this->root); } /** * recursive construction of the menu-tree **/ function __recurseMenu ($menuclass) { if (!in_array ($menuclass, $this->menuclasses)) { return false; } $rootmenu = $this->__getKeyByValue ($this->menuclasses, $menuclass); $menu = array(); $actual = 0; for ($i = 0; $i < count ($this->menu[$rootmenu]); $i++) { $submenuclass = $this->menu[$rootmenu][$i]['CLASS']; $this->quicklink[$submenuclass] =& $menu[$actual]; $menu[$actual] = $this->menu[$rootmenu][$i]; if ($sub = $this->__recurseMenu ($submenuclass)) { $menu[$actual]['_sub_'] = $sub; } $actual++; } return $menu; } function __getKeyByValue($array, $value) { for ($i = 0; $i < count($array); $i++) { if (isset ($array [$i]) && $array[$i] == $value) { return $i; } } } function __saveAsPhpCMS () { $i = 0; $o = ''; $menu = array($this->menu); while (isset($menu[$i])) { $o .= 'MENU:'.$menu[$i][0]['_level_']."\n"; $menuline = $menu[$i][0]; unset ($menuline['_level_']); if (isset($menuline['_sub_'])) { unset ($menuline['_sub_']); } $o .= join(';', array_keys($menuline))."\n"; for ($j = 0; $j < count ($menu[$i]); $j++) { $menuEntry = $menu[$i][$j]; if (isset($menuEntry['_sub_'])) { unset($menuEntry['_sub_']); $menu[] = $menu[$i][$j]['_sub_']; } if (isset($menuEntry['_level_'])) { unset($menuEntry['_level_']); } $o .= join (";\t", $menuEntry)."\n"; } $o .= "\n"; $i++; } return $o; } } ?> --- NEW FILE: class.module_phpcms.php --- <?php /** * Managment of the phpCMS-related administration part * * <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_user.php,v 1.5 2004/06/18 15:17:01 mjahn Exp $ * @package admin4phpCMS * @subpackage module_phpcms **/ /* * $Log$ */ /** * Class for managing the phpCMS-parser and the phpcms-related website-setting * * <p> * This class provides functionality for manipulating menufiles, projectfiles * of a phpCMS-based website and the phpCMS-configurationfile (default.php) * </p> * <p> * This module <b>provides</b> some events for use in the other modules: * </p> * <ul> * <li><b>PHPCMS_GET_MENU</b></li> * <li><b>PHPCMS_SET_MENU</b></li> * </ul> * * @package admin4phpCMS * @subpackage module_phpcms * @todo Get the class work completly **/ class module_phpcms extends module { /** * @var object $DEFAULTS contains the information of the default.php-file * @access private **/ var $_DEFAULTS; /** * Initialization of the module * * The module registers its own events and connects his methods to some actions **/ function init () { // connect to actions $this->_registerAction ('doParseParam', 'parseParam'); $this->_registerAction ('doParseMenuMain', 'getMenuMain'); $this->_registerAction ('doParseMenuSub', 'getMenuSub'); return true; } /** * Parse the URI-params * * @param array $actiondata $actiondata contains the URI-param-arrays **/ function parseParam (&$actiondata) { $this->display = (isset ($actiondata['request']['moduleid']) && $actiondata['request']['moduleid'] == 'phpcms'); $this->action = ''; if (isset ($actiondata['request']['action'])) { $this->action = $actiondata['request']['action']; } $this->configaction = ''; if (isset ($actiondata['request']['configform-submit'])) { $this->configaction = $actiondata['request']['configform-submit']; $this->_formdata =& $actiondata ['request']; } switch ($this->action) { case 'cache': $this->_registerAction ('doProcess', 'processCache'); break; default: $this->_registerAction ('doProcess', 'Process'); } $this->_callEvent ('USER_GET_STATUS', $actiondata); $this->_USER = $actiondata; $actiondata = array ('module'=>'phpcms', 'format'=>'array'); $this->_callEvent ('CONFIG_GET', $actiondata); $this->_CONF = $actiondata ['config']; return true; } // function parseParam () /** * Process-methode of the module * * @param array $actiondata **/ function process (&$actiondata) { switch ($this->action) { case 'config': if ($this->configaction == 'save') { $this->checkConfigForm (); } $this->_registerAction ('doParseContent', 'getConfigContent'); $config = new XML_Tree (dirname (__FILE__).'/config.tpl.xml'); $this->_DATA = & $config->getTreeFromFile (); $_data = @file ($this->docroot.$this->_CONF ['configfile']); foreach ($_data as $line) { if (!stristr ($line, '$this->')) { continue; } if (preg_match ('°\$this->([^=]*)=(.*?)$°im', $line, $erg)) { $id = trim ($erg [1]); $value = trim ($erg [2]); if ($value{0} == '\'') { $value = substr ($value, 1); } if (substr ($value, -1) == ';') { $value = substr ($value, 0, strlen ($value) - 1); } if (substr ($value, -1) == '\'') { $value = substr ($value, 0, strlen ($value) - 1); } $this->_DEFAULTS [$id] = $value; } } break; case 'menu':; $this->_registerAction ('doParseContent', 'getMenuContent'); break; case 'tags':; $this->_registerAction ('doParseContent', 'getTagsContent'); break; case 'cache':; //$this->_registerAction ('doParseContent', 'getCacheContent'); break; default: $this->_registerAction ('doParseContent', 'getContent'); } return true; } // function process () /** * Get content for mainmenu * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getMenuMain (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'phpCMS', 'module'=>'phpcms', '_id'=>'phpcmsmenu', '_root'=>'mainmenu'); if ($this->display) { $actiondata ['extra'] = 'class="active"'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); return true; } // function getMenuMain () /** * Get submenu of module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getMenuSub (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } if (!$this->display) { return true; } $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Cache', 'module'=>'phpcms', '_id'=>'phpcmscache', 'action'=>'cache'); if ($this->action == 'cache') { $actiondata['extra'] = 'id="current"'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Konfiguration', 'module'=>'phpcms', '_id'=>'phpcmsconfig', 'action'=>'config'); if ($this->action == 'config') { $actiondata['extra'] = 'id="current"'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Menüverwaltung', 'module'=>'phpcms', '_id'=>'phpcmsmenu', 'action'=>'menu'); if ($this->action == 'menu') { $actiondata['extra'] = 'id="current"'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Tags editieren', 'module'=>'phpcms', '_id'=>'phpcmstags', 'action'=>'tags'); if ($this->action == 'tags') { $actiondata['extra'] = 'id="current"'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); return true; } // function getMenuSub () /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getContent (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } if (!$this->display) { return true; } ob_start (); print_r($this->_CONF); $content = ob_get_contents (); ob_end_clean (); $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'usercontent', '_type'=>'paragraph', 'content'=>'<pre>'.$content.'</pre>'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); if ($this->action == 'menu' || $this->action == 'template' || $this->action == 'tags') { $content = 'Durch Auswahl eines Templates ist es möglich, die Menüdatei, das Seitentemplate und die Tagdatei zu bearbeiten. '. 'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung für eine Projectdatei vorgibt. '. 'Damit wäre es möglich alle Menüdateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. '; $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'user1content', '_type'=>'paragraph', 'content'=>$content); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } return true; } // function getContent () function processCache (&$actiondata) { $cachedir = $this->docroot.'/cms/phpcms2412/cache/'; if (!file_exists ($cachedir)) { return false; } if (!is_dir ($cachedir)) { return false; } $this->_registerAction ('doParseContent', 'getCacheContent'); $this->_CACHE = array(); $dh = dir ($cachedir); while ($file = $dh->read ()) { if ($file{0} == '.') { continue; } $fh = fopen ($cachedir.$file, 'rb'); $temp = fgets ($fh, 1024); $temp .= fgets ($fh, 1024); fclose ($fh); preg_match('/<!--\sPHPCMS\sFILENAME\s(.*?)\s-->\s*/', $temp, $result); if(isset($result[1])){ $url = $result[1]; } else { $url = basename($file); } $data = explode ('/', $url); $basename = array_pop ($data); $path = $data; $ext = substr ($file, strrpos ($file, '.') + 1); switch ($ext) { case 'gz': $kind = 1; break; case 'dyn': $kind = 2; break; default: $kind = 0; } $data = array ('cachename'=>$file, 'filename'=>$url, 'basename'=>$basename, 'filesize'=>filesize ($cachedir.$file), 'filemtime'=>filemtime ($cachedir.$file), 'type'=>$kind); $root =& $this->_CACHE; $num = count ($path); for ($i = 0; $i < $num; $i++) { if (!isset ($root [$path [$i]])) { $root [urldecode ($path [$i])] = array (); } $root =& $root [urldecode ($path [$i])]; } $root [urldecode ($basename)] = $data; } } /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getCacheContent (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } if (!$this->display) { return true; } ob_start (); print_r($this->_CACHE); $content = ob_get_contents (); ob_end_clean (); $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'cache', '_type'=>'empty', 'content'=>'<pre>'.$content.'</pre>'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'cachedir-', '_type'=>'ulist'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); reset ($this->_CACHE); /* $data = array (); $data ['link'] = $this->_CACHE; $data ['root'] = 'cachedir-'; $_struct[] = $data; while (count ($_struct) > 0) { $root = $_struct[0]['root']; $tree =& $_struct[0]['link']; foreach ($tree as $id=>$entry) { if (!isset ($id) || !isset ($tree [$id])) { continue; } // set list element with empty container $actiondata = array ('_root'=>$root, '_id'=>$root.$id, '_type'=>'list_entry'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // directory entry echo $id.' = '.$tree [$id] ['type']."\n"; if (!isset ($tree [$id] ['type']) || is_array ($tree [$id] ['type'])) { //print_r ($tree [$id]); // set element for the directory name $actiondata = array ('_root'=>$root.$id, '_id'=>$root.$id.'-name', '_type'=>'empty', 'content'=>$id); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); //echo '<p>'.$root.'</p>'; // set sublist for file-list of the directory $actiondata = array ('_root'=>$root.$id, '_id'=>$root.$id.'-', '_type'=>'ulist'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $data = array (); $data['link'] =& $tree [$id]; $data['root'] = $root.$id.'-'; $_struct[] = $data; continue; } // file entry if (isset ($tree [$id] ['type'])) { // set element for the file name //echo $id; $actiondata = array ('_root'=>$root.$id, '_id'=>$root.$id.'-name', '_type'=>'empty', 'content'=>$tree [$id] ['basename']); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); continue; } } array_shift ($_struct); }*/ /* global $xyz; $xyz = 5; $this->walkThroughTree ($this->_CACHE, 'cachedir-'); */ $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'cacheview', '_type'=>'paragraph', 'content'=>'Hallo'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } function walkThroughTree ($tree, $root) { global $xyz; if (!is_array ($tree)) { return true; } if ($xyz <= 0) { return; } foreach ($tree as $id=>$entry) { if (!isset ($id) || !isset ($tree [$id])) { continue; } // set list element with empty container $actiondata = array ('_root'=>$root, '_id'=>$root.$id, '_type'=>'list_entry'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // directory entry echo $id.' = '.$tree [$id] ['type']."\n"; if (!isset ($tree [$id] ['type']) || is_array ($tree [$id] ['type'])) { //print_r ($tree [$id]); // set element for the directory name $actiondata = array ('_root'=>$root.$id, '_id'=>$root.$id.'-name', '_type'=>'empty', 'content'=>$id); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); //echo '<p>'.$root.'</p>'; // set sublist for file-list of the directory $actiondata = array ('_root'=>$root.$id, '_id'=>$root.$id.'-', '_type'=>'ulist'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $xyz--; $this->walkThroughTree ($tree [$id], $root.$id.'-'); continue; } // file entry if (isset ($tree [$id] ['type'])) { // set element for the file name //echo $id; $actiondata = array ('_root'=>$root.$id, '_id'=>$root.$id.'-name', '_type'=>'empty', 'content'=>$tree [$id] ['basename']); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); continue; } } $xyz++; } /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getConfigContent (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } if (!$this->display) { return true; } $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'config_container', '_type'=>'block', 'extra'=>'class="config"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'config_container', '_id'=>'configform', '_type'=>'form'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'configform', '_id'=>'tablist', '_type'=>'ulist', 'extra'=>'class="tabbed"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'tabbox', '_type'=>'block', 'extra'=>'class="tabbox"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $num_tab = count ($this->_DATA->children); for ($i = 0; $i < $num_tab; $i++) { $tab =& $this->_DATA->children[$i]; // set tab-list-entry $actiondata = array ('_root'=>'tablist', '_id'=>'tablistitem-'.$tab->attributes ['id'], '_type'=>'list_entry'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set tab-list-entry $actiondata = array ('_root'=>'tablist', '_id'=>'tablistscript-'.$tab->attributes ['id'], '_type'=>'script', 'content'=>'registerTab (\'tabbox-'.$tab->attributes ['id'].'\');'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set the tab-link $actiondata = array ('_root'=>'tablistitem-'.$tab->attributes ['id'], '_id'=>'tablink-'.$tab->attributes ['id'], '_type'=>'link', 'href'=>'#tabbox-'.$tab->attributes ['id'], 'content'=>$tab->attributes ['label'], 'extra'=>'onclick="displayTab (\'tabbox-'.$tab->attributes ['id'].'\')" onkeypress="displayTab (\'tabbox-'.$tab->attributes ['id'].'\')"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set the tab-box $actiondata = array ('_root'=>'tabbox', '_id'=>'tabbox-'.$tab->attributes ['id'], '_type'=>'block', 'extra'=>'id="tabbox-'.$tab->attributes ['id'].'" class="tabbox"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // walk through the array of config-items $num = count ($tab->children); for ($j = 0; $j < $num; $j++) { if (!isset ($this->_DEFAULTS [$tab->children [$j]->attributes ['id']])) { continue; } // set config-field $actiondata = array ('_root'=>'tabbox-'.$tab->attributes ['id'], '_id'=>'config-'.$tab->children [$j]->attributes ['id'], '_type'=>'form_'.$tab->children [$j]->attributes ['type'], 'label'=>$tab->children [$j]->attributes ['label'], 'value'=>$this->_DEFAULTS [$tab->children [$j]->attributes ['id']], 'name'=>'config-'.$tab->children [$j]->attributes ['id']); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); } } // set the tab-box $actiondata = array ('_root'=>'configform', '_id'=>'configform-submit', '_type'=>'form_button', 'type'=>'submit', 'name'=>'configform-submit', 'value'=>'save', 'text'=>'Speichern'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); return true; } // function getConfigContent () /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getMenuContent (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } if (!$this->display) { return true; } include_once (dirname (__FILE__).'/class.phpcms_menu.php'); $this->_MENU =& new phpcms_menu (); $this->_MENU->load (); print_r($this->_CONF); $projectdir = $content = 'Durch Auswahl einer Projectdatei ist es möglich, die Menüdatei, das Seitentemplate und die Tagdatei zu bearbeiten. '. 'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung für eine Projectdatei vorgibt. '. 'Damit wäre es möglich alle Menüdateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. '; $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'user1content', '_type'=>'paragraph', 'content'=>$content); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); return true; } // function getMenuContent () /** * Get content of the module * * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getTagsContent (&$actiondata) { if (!$this->_USER['isLoggedIn']) { return true; } if (!$this->display) { return true; } ob_start (); print_r($this->_CONF); $content = ob_get_contents (); ob_end_clean (); $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'usercontent', '_type'=>'paragraph', 'content'=>'<pre>'.$content.'</pre>'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $content = 'Durch Auswahl eines Templates ist es möglich, die Menüdatei, das Seitentemplate und die Tagdatei zu bearbeiten. '. 'Eventuell kann die Software auch alle Projectdateien auslesen, obwohl phpCMS ja keine feste Endung für eine Projectdatei vorgibt. '. 'Damit wäre es möglich alle Menüdateien, Seitentemplatedateien und Tagdateien getrennt zur Auswahl anzubieten. '; $actiondata = array ('_root'=>$actiondata ['_root'], '_id'=>'user1content', '_type'=>'paragraph', 'content'=>$content); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); return true; } // function getTagsContent () function checkConfigForm () { foreach ($this->_formdata as $id=>$value) { if (substr ($id, 0, 7) != 'config-') { continue; } //echo '<p>'.$id.' = '.$value.'</p>'; } } // function checkConfigForm () } ?> |
From: Martin J. <mj...@us...> - 2004-07-24 08:58:35
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/modules/user Modified Files: class.module_user.php Log Message: changed some things Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- class.module_user.php 18 Jun 2004 15:17:01 -0000 1.5 +++ class.module_user.php 24 Jul 2004 08:58:25 -0000 1.6 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.6 2004/07/24 08:58:25 mjahn +* changed some things +* * Revision 1.5 2004/06/18 15:17:01 mjahn * module filemanager and editor included * @@ -183,6 +186,9 @@ } $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Benutzerverwaltung', 'module'=>'user', '_id'=>'usermenu', '_root'=>'mainmenu', 'id'=>'', 'class'=>''); + if ($this->display) { + $actiondata ['extra'] = 'class="active"'; + } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); return true; } @@ -204,15 +210,15 @@ $root = $actiondata['_root']; - $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Benutzerübersicht', 'module'=>'user', '_id'=>'useroverview', 'action'=>'', 'id'=>'', 'class'=>'', 'param'=>''); + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Benutzerübersicht', 'module'=>'user', '_id'=>'useroverview'); if ($this->action == '') { - $actiondata['id'] = 'current'; + $actiondata['extra'] = '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'=>''); + $actiondata = array ('_type'=>'menu_sub_entry', '_root'=>$root, 'name'=>'Rechteübersicht', 'module'=>'user', '_id'=>'usermenuchg', 'action'=>'rights'); if ($this->action == 'rights') { - $actiondata['id'] = 'current'; + $actiondata['extra'] = 'id="current"'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); return true; @@ -228,28 +234,79 @@ $root = $actiondata['_root']; - $actiondata = array ('_id'=>'benutzerlogin', '_root'=>$root, '_type'=>'headline', 'content'=>'Benutzerlogin', 'id'=>'', 'class'=>''); + $actiondata = array ('_id'=>'benutzerlogin', '_root'=>$root, '_type'=>'headline', 'content'=>'Benutzerlogin'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'id'=>'', 'class'=>'', 'action'=>'index.php'); + $actiondata = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'action'=>'index.php'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>'method', '_type'=>'form_input_hidden', 'value'=>'post', 'name'=>'method','_root'=>'loginform', 'id'=>'', 'class'=>''); + $actiondata = array ('_id'=>'method', '_type'=>'form_input_hidden', 'value'=>'post', 'name'=>'method','_root'=>'loginform'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>'handle', '_type'=>'form_input_text', 'label'=>'Benutzername', 'value'=>'Benutzername', 'name'=>'handle','_root'=>'loginform', 'id'=>'', 'class'=>''); + $actiondata = array ('_id'=>'handle', '_type'=>'form_input_text', 'label'=>'Benutzername', 'value'=>'Benutzername', 'name'=>'handle','_root'=>'loginform'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>'passwd', '_type'=>'form_input_password', 'value'=>'', 'label'=>'Passwort', 'name'=>'passwd','_root'=>'loginform', 'id'=>'', 'class'=>''); + $actiondata = array ('_id'=>'passwd', '_type'=>'form_input_password', 'value'=>'', 'label'=>'Passwort', 'name'=>'passwd','_root'=>'loginform'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>'submit', '_type'=>'form_button', 'value'=>'Absenden', 'name'=>'submit','text'=>'Absenden', '_root'=>'loginform', 'id'=>'', 'class'=>''); + $actiondata = array ('_id'=>'submit', '_type'=>'form_button', 'value'=>'Absenden', 'name'=>'submit','text'=>'Absenden', '_root'=>'loginform'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); return true; } if (!$this->display) { return true; } + + if ($this->action == '') { + + $actiondata = array ('_type'=>'form', '_id'=>'userform', '_root'=>$actiondata ['_root'], 'action'=>'#'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + $content = ''; + foreach ($this->_USER->_auth->tree->root->children as $i=>$user) { + ob_start (); + print_r($user); + $content = ob_get_contents(); + ob_end_clean (); + + $actiondata = array ('_type'=>'paragraph', '_id'=>'userform-'.$i, '_root'=>'userform'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + foreach ($user->children as $userdata) { + $actiondata = array ('_type'=>'form_input_text', '_id'=>'userform-'.$i.'-'.$userdata->name, '_root'=>'userform-'.$i, 'name'=>'userform-'.$i.'-'.$userdata->name, 'label'=>$userdata->name, 'value'=>$userdata->content); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } + + } + } + if ($this->action == 'rights') { + + ob_start (); + print_r($this->_USER->_perm->tree); + $content = ob_get_contents (); + ob_end_clean (); + + $actiondata = array ('_type'=>'form', '_id'=>'userform', '_root'=>$actiondata ['_root'], 'action'=>'#', 'content'=>'<pre>'.$content.'<pre>'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + + $content = ''; + foreach ($this->_USER->_perm->tree->root->children as $i=>$user) { + ob_start (); + print_r($user); + $content = ob_get_contents(); + ob_end_clean (); + + $actiondata = array ('_type'=>'paragraph', '_id'=>'userform-'.$i, '_root'=>'userform'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + + foreach ($user->children as $userdata) { + $actiondata = array ('_type'=>'form_input_text', '_id'=>'userform-'.$i.'-'.$userdata->name, '_root'=>'userform-'.$i, 'name'=>'userform-'.$i.'-'.$userdata->name, 'label'=>$userdata->name, 'value'=>$userdata->content); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); + } + + } + } return true; } |
From: Martin J. <mj...@us...> - 2004-07-24 08:58:35
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/modules/filemanager Modified Files: class.module_filemanager.php config.filemanager.php class.file_util.php Log Message: changed some things Index: class.module_filemanager.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/class.module_filemanager.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- class.module_filemanager.php 18 Jun 2004 15:17:00 -0000 1.3 +++ class.module_filemanager.php 24 Jul 2004 08:58:25 -0000 1.4 @@ -2,8 +2,6 @@ /** * 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 @@ -30,6 +28,9 @@ /* * $Log$ +* Revision 1.4 2004/07/24 08:58:25 mjahn +* changed some things +* * Revision 1.3 2004/06/18 15:17:00 mjahn * module filemanager and editor included * @@ -146,6 +147,9 @@ function getMenuMain (&$actiondata) { $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Dateimanager', 'module'=>'filemanager', '_id'=>'filemanager', '_root'=>'mainmenu'); + if ($this->display) { + $actiondata ['extra'] = 'class="active"'; + } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } @@ -244,22 +248,19 @@ $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_type'=>'filelist_entry', '_id'=>'list-0', '_root'=>'filelist', - 'extra'=>'class="header"', 'filesize'=>'Größe', 'filemtime'=>'Letzte Änderung', - 'chmod'=>'CHMOD', 'gid'=>'GID', 'uid'=>'UID'); + 'extra'=>'class="header"', 'filesize'=>'Größe', 'filemtime'=>'Letzte Änderung', 'chmod'=>'CHMOD', 'gid'=>'GID', 'uid'=>'UID'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'list-0', '_id'=>'list-img-0', '_type'=>'image', - 'src'=>'modules/layout/img/empty.gif', - 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', - 'extra'=>'class="input""'); + 'src'=>'modules/layout/img/empty.gif', 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="input"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'list-0', '_id'=>'list-img-1', '_type'=>'image', 'src'=>'modules/layout/img/empty.gif', - 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="input""'); + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="icon"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'list-0', '_id'=>'list-img-2', '_type'=>'image', 'src'=>'modules/layout/img/empty.gif', - 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="input"'); + 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="icon"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set filename @@ -408,24 +409,21 @@ } } $actiondata = array ('_type'=>'filelist_entry', '_id'=>'list1', '_root'=>'filelist', - 'extra'=>'class="header"', 'filename'=>$num_dirs.' Verzeichnisse', 'filesize'=>$sum_size, 'filemtime'=>$num_files.' Dateien', + 'extra'=>'class="header"', 'filename'=>$num_dirs.' Verzeichnisse', 'filesize'=>file_util::filesize ($sum_size), 'filemtime'=>$num_files.' Dateien', 'chmod'=>'', 'gid'=>'', ''=>'UID'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'list1', '_id'=>'list-img0', '_type'=>'image', - 'src'=>'modules/layout/img/empty.gif', - 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', - 'extra'=>'class="input"'); + 'src'=>'modules/layout/img/empty.gif', 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="input"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'list1', '_id'=>'list-img1', '_type'=>'image', - 'src'=>'modules/layout/img/empty.gif', - 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>''); + 'src'=>'modules/layout/img/empty.gif', 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="icon"'); $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_root'=>'list1', '_id'=>'list-img2', '_type'=>'image', - 'src'=>'modules/layout/img/empty.gif', - 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>''); + 'src'=>'modules/layout/img/empty.gif', 'width'=>'16', 'height'=>'16', 'title'=>'', 'alt'=>'', 'extra'=>'class="icon""'); + $this->_callEvent ('LAYOUT_ADD_ELEMENT', $actiondata); // set filename Index: class.file_util.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/class.file_util.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- class.file_util.php 18 Jun 2004 15:17:00 -0000 1.1 +++ class.file_util.php 24 Jul 2004 08:58:25 -0000 1.2 @@ -1,5 +1,43 @@ <?php +/** +* Utility-class for filemanager-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_filemanager +**/ +/* +* $Log$ +* Revision 1.2 2004/07/24 08:58:25 mjahn +* changed some things +* +*/ +/** +* Utility-class for administrative work in the filesystem +* +* @package admin4phpCMS +* @subpackage module_filemanager +**/ class file_util { function fileperms($filepath) { @@ -10,10 +48,15 @@ } function filesize($file) { - if (!file_exists($file)) { - return ''; + if (is_int ($file)) { + $size = $file; + } elseif (is_dir ($file) || is_file ($file)) { + if (!file_exists ($file)) { + return ''; + } + $size = filesize ($file); + } else { } - $size = filesize($file); $factor = 0; while ($size > 1024) { $factor++; Index: config.filemanager.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/filemanager/config.filemanager.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- config.filemanager.php 18 Jun 2004 15:17:01 -0000 1.1 +++ config.filemanager.php 24 Jul 2004 08:58:25 -0000 1.2 @@ -1,5 +1,46 @@ <?php -/* $Id$ */ +/** +* Configuration of the filemanager-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_filemanager +**/ + +/* +* $Log$ +* Revision 1.2 2004/07/24 08:58:25 mjahn +* changed some things +* +*/ + +/** +* Configuration of the filemanager-class +* +* @package admin4phpCMS +* @subpackage module_filemanager +**/ + + /* +----------------------------------------------------------------------+ | phpCMS Content Management System - Version 1.2.0 Beta |