/trunk/client/integrateur_wikini/bibliotheque/wikini/COPYING |
---|
New file |
0,0 → 1,340 |
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. |
/trunk/client/integrateur_wikini/bibliotheque/wikini/interwiki.conf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/integrateur_wikini/bibliotheque/wikini/interwiki.conf |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/integrateur_wikini/bibliotheque/wikini/README |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/integrateur_wikini/bibliotheque/wikini/README |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/integrateur_wikini/bibliotheque/wikini/index.php |
---|
New file |
0,0 → 1,30 |
<?php |
/* |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
header("Location: wakka.php"); |
exit; |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/wantedpages.php |
---|
New file |
0,0 → 1,43 |
<?php |
/* |
wantedpages.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002 Charles NEPOTE |
Copyright 2002 Patrick PAUL |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
if ($pages = $this->LoadWantedPages()) |
{ |
foreach ($pages as $page) |
{ |
echo $this->Link($page["tag"])," (<a |
ref=\"",$this->href(),"&linking_to=",$page["tag"],"\">",$page["count"],"</a>)<br />\n"; |
} |
} |
else |
{ |
echo "<i>Aucune page à créer.</i>"; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/pageindex.php |
---|
New file |
0,0 → 1,54 |
<?php |
/* |
pageindex.php |
Copyright (c) 2003, Hendrik Mans <hendrik@mans.de> |
Copyright 2003 David DELON |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
if ($pages = $this->LoadAllPages()) |
{ |
foreach ($pages as $page) |
{ |
if (!preg_match("/^Comment/", $page["tag"])) { |
$firstChar = strtoupper($page["tag"][0]); |
if (!preg_match("/[A-Z,a-z]/", $firstChar)) { |
$firstChar = "#"; |
} |
if ($firstChar != $curChar) { |
if ($curChar) echo "<br />\n" ; |
echo "<b>$firstChar</b><br />\n" ; |
$curChar = $firstChar; |
} |
echo $this->ComposeLinkToPage($page["tag"]),"<br />\n" ; |
} |
} |
} |
else |
{ |
echo "<i>Aucune page trouvée.</i>" ; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/mypages.php |
---|
New file |
0,0 → 1,78 |
<?php |
// actions/mypages.php |
// written by Carlo Zottmann |
// http://wakkawikki.com/CarloZottmann |
/* |
mypages.php |
Copyright (c) 2003, Carlo Zottmann |
Copyright 2003 David DELON |
Copyright 2003 Jean Pascal MILCENT |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
if ($user = $this->GetUser()) |
{ |
echo "<b>Liste des pages dont vous êtes le propriétaire.</b><br /><br />\n" ; |
$my_pages_count = 0; |
if ($pages = $this->LoadAllPages()) |
{ |
foreach ($pages as $page) |
{ |
if ($this->UserName() == $page["owner"] && !preg_match("/^Comment/", $page["tag"])) { |
$firstChar = strtoupper($page["tag"][0]); |
if (!preg_match("/[A-Z,a-z]/", $firstChar)) { |
$firstChar = "#"; |
} |
if ($firstChar != $curChar) { |
if ($curChar) echo "<br />\n" ; |
echo "<b>$firstChar</b><br />\n" ; |
$curChar = $firstChar; |
} |
echo $this->ComposeLinkToPage($page["tag"]),"<br />\n" ; |
$my_pages_count++; |
} |
} |
if ($my_pages_count == 0) |
{ |
echo "<i>Vous n'êtes le propriétaire d'aucune page.</i>"; |
} |
} |
else |
{ |
echo "<i>Aucune page trouvée.</i>" ; |
} |
} |
else |
{ |
echo "<i>Vous n'êtes pas identifié : impossible d'afficher la liste des pages que vous avez modifiées.</i>" ; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/resetpassword.php |
---|
New file |
0,0 → 1,80 |
<?php |
/* |
resetpassword.php |
Copyright 2003 Patrick PAUL |
Copyright 2003 David DELON |
Copyright 2004 David VANTYGHEM |
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 |
*/ |
if (($user = $this->GetUser()) && ($user["name"]==$this->GetConfigValue("admin")) && $this->GetConfigValue("admin")) |
{ |
if (($_REQUEST["action"] == "resetpass")) |
{ |
$this->Query("update ".$this->config["table_prefix"]."users set ". |
"password = md5('".mysql_escape_string($_POST["password"])."') ". |
"where name = '".mysql_escape_string($_POST["name"])."' limit 1"); |
$this->SetMessage("Mot de passe réinitialisé !"); |
$this->Redirect($this->href()); |
} |
else |
{ |
$error=""; |
//$error = "Il est interdit de réinitialiser le mot de passe de cet utilisateur ! Non mais !"; |
} |
echo $this->FormOpen() ; |
$name=$_GET["name"]; |
?> |
<input type="hidden" name="action" value="resetpass"> |
<table> |
<tr> |
<td align="right"></td> |
<td><?php echo $this->Format("Réinitialisation du mot de passe"); ?></td> |
</tr> |
<?php |
if ($error) |
{ |
echo "<tr><td></td><td><div class=\"error\">".$this->Format($error)."</div></td></tr>\n" ; |
} |
?> |
<tr> |
<td align="right">Login:</td> |
<td><input name="name" size="40" value="<?php echo $name ?>"></td> |
</tr> |
<tr> |
<td align="right">Nouveau mot de passe:</td> |
<td><input type="password" name="password" size="40"></td> |
</tr> |
<tr> |
<td></td> |
<td><input type="submit" value="Reset password" size="40"></td> |
</tr> |
</table> |
<?php |
echo $this->FormClose() ; |
} |
else |
{ |
echo "<i>Vous n'avez pas les permissions nécessaires pour exécuter cette action.</i>" ; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/changestyle.php |
---|
New file |
0,0 → 1,67 |
<?php |
// Action changesstyle.php version 0.2 du 16/03/2004 |
// pour WikiNi 0.4.1rc (=> à la version du 200403xx) et supérieurs |
// Par Charles Népote (c) 2004 |
// Licence GPL |
// Fonctionnement |
// |
// Cette action regroupe la fonction de changement de style ainsi que l'interface |
// de modification du style. |
// Une fois le style sélectionné via l'interface, la requête est envoyée sous la forme : |
// http://example.org/PageTest&set="NomDeFeuilleDeStyle" |
// . si ce nom n'est pas constitué uniquement de caractères alphanumériques, |
// une erreur est retournée |
// . si ce nom est valide et que la feuille de style existe : |
// . on change le cookie utilisateur |
// . on redirrige l'utilisateur vers http://example.org/PageTest où |
// l'utilisateur peut alors constater le changement de style |
// Usage : |
// |
// -- {{changestyle link="xxx.css"}} |
// donne le lien suivant : |
// Feuille de style xxx.css |
// |
// -- {{changestyle link="xxx.css" title="Ouragan"}} |
// donne le lien suivant : |
// Ouragan |
// A compléter (peut-être un jour) : |
// |
// -- {{changestyle}} |
// donne un formulaire : |
// Entrer l'adresse de la feuille de style désirée : [ ] |
// |
// -- {{changestyle choice="zzz.css;ttt.css"}} |
// [] Feuille de style zzz |
// [] Feuille de style ttt |
$set = $_GET["set"]; |
if ($this->GetParameter(link)) |
{ |
echo "<a href=\"".$this->href()."&set=".$this->GetParameter(link)."\">"; |
echo (!$this->GetParameter(title))?"Feuille de style ".$this->GetParameter(link):$this->GetParameter(title); |
echo "</a>"; |
} |
// Do it. |
if (preg_match("/^[A-Za-z0-9][A-Za-z0-9]+$/", $set)) |
{ |
$this->SetPersistentCookie('sitestyle',$set,1); |
header("Location: ".$this->href()); |
} |
else if ($set) |
{ |
$this->SetMessage("La feuille de style ".$set." est non valide !"); |
header("Location: ".$this->href()); |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/recentchanges.php |
---|
New file |
0,0 → 1,76 |
<?php |
/* |
recentchanges.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2002 Patrick PAUL |
Copyright 2003 Eric DELORD |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
// Which is the max number of pages to be shown ? |
if ($max = $this->GetParameter("max")) |
{ |
if ($max=="last") $max=50; else $last = (int) $max; |
} |
elseif ($user = $this->GetUser()) |
{ |
$max = $user["changescount"]; |
} |
else |
{ |
$max = 50; |
} |
// Show recently changed pages |
if ($pages = $this->LoadRecentlyChanged($max)) |
{ |
if ($this->GetParameter("max")) |
{ |
foreach ($pages as $i => $page) |
{ |
// echo entry |
echo "(",$page["time"],") (",$this->ComposeLinkToPage($page["tag"], "revisions", "historique", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($page["user"]),"<br />\n" ; |
} |
} |
else |
{ |
$curday=''; |
foreach ($pages as $i => $page) |
{ |
// day header |
list($day, $time) = explode(" ", $page["time"]); |
if ($day != $curday) |
{ |
if ($curday) echo "<br />\n" ; |
echo "<b>$day :</b><br />\n" ; |
$curday = $day; |
} |
// echo entry |
echo " (",$time,") (",$this->ComposeLinkToPage($page["tag"], "revisions", "historique", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($page["user"]),"<br />\n" ; |
} |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/textsearch.php |
---|
New file |
0,0 → 1,106 |
<?php |
/* |
textsearch.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002 Patrick PAUL |
Copyright 2004 Jean Christophe ANDRÉ |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
// label à afficher devant la zone de saisie |
$label = $this->GetParameter('label', 'Ce que vous souhaitez chercher : '); |
// largeur de la zone de saisie |
$size = $this->GetParameter('size', '40'); |
// texte du bouton |
$button = $this->GetParameter('button', 'Chercher'); |
// texte à chercher |
$phrase = $this->GetParameter('phrase', false); |
// séparateur entre les éléments trouvés |
$separator = $this->GetParameter('separator', false); |
// se souvenir si c'était un paramètre de l'action ou du CGI |
$paramPhrase = $phrase; |
// récupérer le paramètre du CGI le cas échéant |
if (!isset($_REQUEST['phrase'])) $_REQUEST['phrase'] = ''; |
if (!$phrase) $phrase = $_REQUEST['phrase']; |
// s'il y a un paramètre d'action "phrase", on affiche uniquement le résultat |
// dans le cas contraire, présenter une zone de saisie |
if (!$paramPhrase) |
{ |
echo $this->FormOpen('', '', 'get'); |
if ($label) |
{ |
echo $this->Format($label), ' '; |
} |
echo '<input name="phrase" size="', htmlspecialchars($size), '" value="', htmlentities($phrase), '" />'; |
if ($button) |
{ |
echo ' <input type="submit" value="', htmlspecialchars($button), '" />'; |
} |
echo "\n", $this->FormClose(); |
} |
if ($phrase) |
{ |
if ($results = $this->FullTextSearch($phrase)) |
{ |
if ($separator) |
{ |
$separator = htmlspecialchars($separator); |
if (!$paramPhrase) |
{ |
echo '<p>Résultat(s) de la recherche de "', htmlspecialchars($phrase), '" : '; |
} |
foreach ($results as $i => $page) |
{ |
if ($i > 0) echo $separator; |
echo $this->ComposeLinkToPage($page['tag']); |
} |
if (!$paramPhrase) |
{ |
echo '</p>', "\n"; |
} |
} |
else |
{ |
echo '<p><strong>Résultat(s) de la recherche de "', htmlspecialchars($phrase), '" :</strong></p>', "\n", |
'<ol>', "\n"; |
foreach ($results as $i => $page) |
{ |
echo "<li>", $this->ComposeLinkToPage($page["tag"]), "</li>\n"; |
} |
echo "</ol>\n"; |
} |
} |
else |
{ |
if (!$paramPhrase) |
{ |
echo "<p>Aucun résultat pour \"", htmlspecialchars($phrase), "\". :-(</p>"; |
} |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/trail.php |
---|
New file |
0,0 → 1,102 |
<?php |
/* |
trail.php : Permet d'afficher des liens "Page Suivante" "Sommaire" "Page Precedente" dans une page |
Copyright 2003 Eric FELDSTEIN |
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 |
*/ |
/* |
* Cette action permet de lier des pages entre elle via une page contenant la liste |
* ordonnées de ces pages. L'action affiche des liens de navigation permettant de |
* passer à la page suivante ou précédente ou de revenir au sommaire. |
* |
* @param toc string nom de la page contenant la liste ordonnée des pages à liées entre elles |
*/ |
/* La page sommaire doit contenir une liste de pages. Le premier mot de chaque élément |
de la liste doit être le nom d'une page du wiki, donc un mot wiki ou un lien force |
exemple de page sommaire: |
===Sommaire=== |
IntroductionAuProjet : présentation du projet. |
[[AnalyseProjet Analyse]] : analyse des besoins |
-BesoinDesUtilisateurs |
-ContraintesTechniques |
OutilsEtNormes |
Texte texte texte texte texte texte texte texte texte texte |
texte texte texte texte texte texte texte texte texte texte texte |
texte texte texte texte texte texte texte texte texte texte texte texte |
*/ |
//echo $this->Format("===Action Trail==="); |
$sommaire = $this->GetParameter("toc"); |
if (!$sommaire) { |
echo $this->Format("//Indiquez le nom de la page sommaire, paramètre 'toc'//."); |
}else{ |
//chargement de la page sommaire |
$tocPage = $this->LoadPage($sommaire); |
//analyse de la page sommaire pour récupérer la liste des pages |
//recuperation de la liste |
if (preg_match_all("/\n[\t ]+(.*)/",$tocPage["body"],$tocListe)){ |
//analyse de chaque ligne de la liste pour recupérer la page cible |
$currentPageIndex = NULL; |
foreach ($tocListe[1] as $line){ |
//suppression d'un signe de liste eventuel |
$line = trim(preg_replace("/^([A-Za-z0-9]+\)|-)/","",$line)); |
//recuperation du 1er mot |
$line = preg_replace("/^(\[\[.*\]\]|[A-Za-z0-9]+)\s*(.*)$/","$1",$line); |
//ajout a la liste des pages si le 1er mot est un lien force ou un mot wiki |
if (preg_match("/\[\[.*\]\]/",$line,$match)|$this->IsWikiName($line)){ |
$pages[] = $line; |
//regarde si la page ajoute a la liste est la page courante |
if (strcasecmp($this->GetPageTag(),$line)==0){ |
$currentPageIndex = count($pages)-1; |
}else { //traite le cas des lien force |
if (preg_match("/\[\[(.*:)?".$this->GetPageTag()."(\s.*)?\]\]$/",$line)) { |
$currentPageIndex = count($pages)-1; |
} |
} |
} |
}//foreach |
} |
//ecriture des liens Page Précedente/sommaire/page suivante |
if ($currentPageIndex>0) { |
$PrevPage = $pages[$currentPageIndex-1]; |
$btnPrev = "<span class=\"trail_button\">".$this->Format("<< $PrevPage")."</span>"; |
}else{ |
$btnPrev = " "; |
} |
$btnTOC = "<span class=\"trail_button\">".$this->Format($sommaire)."</span>"; |
if ($currentPageIndex < (count($pages)-1)){ |
$NextPage = $pages[$currentPageIndex+1]; |
$btnNext = "<span class=\"trail_button\">".$this->Format("$NextPage >>")."</span>"; |
}else{ |
$btnNext = " "; |
} |
echo "<table class=\"trail_table\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n"; |
echo " <tr>\n"; |
echo " <td align=\"left\" width=\"35%\">$btnPrev</td>\n"; |
echo " <td align=\"center\">$btnTOC</td>\n"; |
echo " <td align=\"right\" width=\"35%\">$btnNext</td>\n"; |
echo " </tr>\n"; |
echo "</table>\n"; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/mychanges.php |
---|
New file |
0,0 → 1,118 |
<?php |
/* |
mychanges.php |
Copyright (c) 2003, Carlo Zottmann |
Copyright 2003 David DELON |
Copyright 2003 Charles NEPOTE |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
if ($user = $this->GetUser()) |
{ |
$my_edits_count = 0; |
if (($bydate = $this->GetParameter("bydate"))) |
{ |
echo "<b>Liste des pages que vous avez modifiées, triée par date de modification.</b><br /><br />\n"; |
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user = '".mysql_escape_string($this->UserName())."' AND tag NOT LIKE 'Comment%' ORDER BY time ASC, tag ASC")) |
{ |
foreach ($pages as $page) |
{ |
$edited_pages[$page["tag"]] = $page["time"]; |
} |
arsort($edited_pages); |
foreach ($edited_pages as $page["tag"] => $page["time"]) |
{ |
// day header |
list($day, $time) = explode(" ", $page["time"]); |
if ($day != $curday) |
{ |
if ($curday) echo "<br />\n"; |
echo "<b>$day:</b><br />\n"; |
$curday = $day; |
} |
// echo entry |
echo " ($time) (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n"; |
$my_edits_count++; |
} |
if ($my_edits_count == 0) |
{ |
echo "<i>Vous n'avez pas modifié de page.</i>"; |
} |
} |
else |
{ |
echo "<i>Aucune page trouvée.</i>"; |
} |
} |
else |
{ |
echo "<b>Liste des pages que vous avez modifiées, triée par ordre alphabétique.</b><br /><br />\n"; |
if ($pages = $this->LoadAll("SELECT tag, time FROM ".$this->config["table_prefix"]."pages WHERE user = '".mysql_escape_string($this->UserName())."' AND tag NOT LIKE 'Comment%' ORDER BY tag ASC, time DESC")) |
{ |
foreach ($pages as $page) |
{ |
if ($last_tag != $page["tag"]) { |
$last_tag = $page["tag"]; |
$firstChar = strtoupper($page["tag"][0]); |
if (!preg_match("/[A-Z,a-z]/", $firstChar)) { |
$firstChar = "#"; |
} |
if ($firstChar != $curChar) { |
if ($curChar) echo "<br />\n"; |
echo "<b>$firstChar</b><br />\n"; |
$curChar = $firstChar; |
} |
// echo entry |
echo " (",$page["time"],") (",$this->ComposeLinkToPage($page["tag"], "revisions", "history", 0),") ",$this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n"; |
$my_edits_count++; |
} |
} |
if ($my_edits_count == 0) |
{ |
echo "<i>Vous n'avez pas modifié de page.</i>"; |
} |
} |
else |
{ |
echo "<i>Aucune page trouvée.</i>"; |
} |
} |
} |
else |
{ |
echo "<i>Vous n'êtes pas identifié : impossible d'afficher la liste des pages que vous avez modifiées.</i>"; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/orphanedpages.php |
---|
New file |
0,0 → 1,35 |
<?php |
/* |
orphanedpages.php |
Copyright 2002, 2003 David DELON |
Copyright 2002 Charles NEPOTE |
Copyright 2002 Patrick PAUL |
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 |
*/ |
if ($pages = $this->LoadOrphanedPages()) |
{ |
foreach ($pages as $page) |
{ |
echo $this->ComposeLinkToPage($page["tag"], "", "", 0),"<br />\n" ; |
} |
} |
else |
{ |
echo "<i>Pas de pages orphelines</i>" ; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/recentlycommented.php |
---|
New file |
0,0 → 1,76 |
<?php |
/* |
recentlycommented.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003, 2004 Charles NEPOTE |
Copyright 2002 Patrick PAUL |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
// Which is the max number of pages to be shown ? |
if ($max = $this->GetParameter("max")) |
{ |
if ($max=="last") $max=50; else $last = (int) $max; |
} |
else |
{ |
$max = 50; |
} |
// Show recently commented pages |
if ($pages = $this->LoadRecentlyCommented($max)) |
{ |
if ($this->GetParameter("max")) |
{ |
foreach ($pages as $page) |
{ |
// echo entry |
echo "(",$page["comment_time"],") <a href=\"",$this->href("", $page["tag"], "show_comments=1"),"#",$page["comment_tag"],"\">",$page["tag"],"</a> . . . . dernier commentaire par ",$this->Format($page["comment_user"]),"<br />\n" ; |
} |
} |
else |
{ |
$curday=''; |
foreach ($pages as $page) |
{ |
// day header |
list($day, $time) = explode(" ", $page["comment_time"]); |
if ($day != $curday) |
{ |
if ($curday) echo "<br />\n" ; |
echo "<b>$day :</b><br />\n" ; |
$curday = $day; |
} |
// echo entry |
echo " (",$time,") <a href=\"",$this->href("", $page["tag"], "show_comments=1"),"#",$page["comment_tag"],"\">",$page["tag"],"</a> . . . . dernier commentaire par ",$this->Format($page["comment_user"]),"<br />\n" ; |
} |
} |
} |
else |
{ |
echo "<i>Aucune page n'a été commentée récemment.</i>" ; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/include.php |
---|
New file |
0,0 → 1,55 |
<?php |
/* |
include.php : Permet d'inclure une page Wiki dans un autre page |
Copyright 2003 Eric FELDSTEIN |
Copyright 2003 Charles NEPOTE |
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 |
*/ |
/* Paramètres : |
-- page : nom wiki de la page a inclure (obligatoire) |
-- class : nom de la classe de style à inclure (facultatif) |
*/ |
// récuperation du parametres |
$incPageName = $this->GetParameter("page"); |
// TODO : améliorer le traitement des classes |
if ($this->GetParameter("class")) { |
$classes=''; |
$array_classes = explode(" ", $this->GetParameter("class")); |
foreach ($array_classes as $c) { $classes = $classes . "include_" . $c . " "; } |
} |
// Affichage de la page ou d'un message d'erreur |
if (empty($incPageName)) { |
echo $this->Format("//Le paramètre \"page\" est manquant.//"); |
} else { |
if (eregi("^".$incPageName."$",$this->GetPageTag())) { |
echo $this->Format("//Impossible à une page de s'inclure dans elle même.//"); |
} else { |
if (!$this->HasAccess("read",$incPageName)){ |
echo $this->Format("//Lecture de la page inclue $page non autorisée.//"); |
} else { |
$incPage = $this->LoadPage($incPageName); |
$output = $this->Format($incPage["body"]); |
if ($classes) echo "<div class=\"", $classes,"\">\n", $output, "</div>\n"; |
else echo $output; |
} |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/recentcomments.php |
---|
New file |
0,0 → 1,54 |
<?php |
/* |
recentcomments.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002 Charles NEPOTE |
Copyright 2002 Patrick PAUL |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
if ($comments = $this->LoadRecentComments()) |
{ |
foreach ($comments as $comment) |
{ |
// day header |
list($day, $time) = explode(" ", $comment["time"]); |
if ($day != $curday) |
{ |
if ($curday) echo "<br />\n" ; |
echo "<b>$day:</b><br />\n" ; |
$curday = $day; |
} |
// echo entry |
echo " (",$comment["time"],") <a href=\"",$this->href("", $comment["comment_on"], "show_comments=1"),"#",$comment["tag"],"\">",$comment["comment_on"],"</a> . . . . ",$this->Format($comment["user"]),"<br />\n" ; |
} |
} |
else |
{ |
echo "<i>Pas de commentaires récents.</i>" ; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/header.php |
---|
New file |
0,0 → 1,80 |
<?php |
/* header.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003, 2004 Charles NEPOTE |
Copyright 2002 Patrick PAUL |
Copyright 2003 Eric DELORD |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
$message = $this->GetMessage(); |
$user = $this->GetUser(); |
?> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html> |
<head> |
<title><?php echo $this->GetWakkaName().":".$this->GetPageTag(); ?></title> |
<?php if ($this->GetMethod() != 'show') |
echo "<meta name=\"robots\" content=\"noindex, nofollow\"/>\n";?> |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> |
<meta name="keywords" content="<?php echo $this->GetConfigValue("meta_keywords") ?>" /> |
<meta name="description" content="<?php echo $this->GetConfigValue("meta_description") ?>" /> |
<link rel="stylesheet" type="text/css" media="screen" href="wakka.basic.css" /> |
<style type="text/css" media="all"> @import "<?php echo (!isset($_COOKIE["sitestyle"]))?'wakka':$_COOKIE["sitestyle"] ?>.css";</style> |
<script type="text/javascript"> |
function fKeyDown() { |
if (event.keyCode == 9) { |
event.returnValue= false; |
document.selection.createRange().text = String.fromCharCode(9) } } |
</script> |
</head> |
<body <?php echo (!$user || ($user["doubleclickedit"] == 'Y')) && ($this->GetMethod() == "show") ? "ondblclick=\"document.location='".$this->href("edit")."';\" " : "" ?> |
<?php echo $message ? "onLoad=\"alert('".$message."');\" " : "" ?> > |
<div style="display: none;"><a href="<?php echo $this->href() ?>/resetstyle" accesskey="7"></a></div> |
<h1 class="wiki_name"><?php echo $this->config["wakka_name"] ?></h1> |
<h1 class="page_name"> |
<a href="<?php echo $this->config["base_url"] ?>RechercheTexte&phrase=<?php echo htmlentities($this->GetPageTag()); ?>"> |
<?php echo htmlentities($this->GetPageTag()); ?> |
</a> |
</h1> |
<div class="header"> |
<?php echo $this->ComposeLinkToPage($this->config["root_page"]); ?> :: |
<?php echo $this->config["navigation_links"] ? $this->Format($this->config["navigation_links"])." :: \n" : "" ?> |
Vous êtes <?php echo $this->Format($this->GetUserName()); if ($user = $this->GetUser()) echo " (<a href=\"".$this->config["base_url"] ."ParametresUtilisateur&action=logout\">Déconnexion</a>)\n"; ?> |
</div> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/listpages.php |
---|
New file |
0,0 → 1,85 |
<?php |
/* |
listpages.php |
Copyright 2002 David DELON |
Copyright 2003 Patrick PAUL |
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 |
*/ |
if (!function_exists("TreeView")) |
{ |
function TreeView($node,$level,$indent=0) |
{ |
global $wiki; |
if ($level>0) { |
$head=split(" :: ",$wiki->GetConfigValue("navigation_links")); |
// we don't want page from the header |
if (!in_array($node, $head, TRUE)) |
{ |
if (($indent>0) && (!($wiki->GetConfigValue("root_page")==$node)) || ($indent==0) ) |
{ |
// Ignore users too ... |
if (!$wiki->LoadUser($node)) |
{ |
if ($indent) |
echo (str_repeat(" ",$indent)),$wiki->Link($node),"<br/>\n"; |
$pages = $wiki->LoadAll("select to_tag from ".$wiki->config["table_prefix"]."links where from_tag='".mysql_escape_string($node)."' order by to_tag asc"); |
if (is_array($pages)) { |
foreach ($pages as $page) |
{ |
$wiki->CachePage($page); |
TreeView($page["to_tag"],$level-1,$indent+1); |
} |
} |
} |
} |
} |
} |
} |
} |
if($sortkey = $this->GetParameter("sort")) { |
if (($sortkey != "tag") && ($sortkey != "time") && ($sortkey != "owner") && ($sortkey != "user")) $sortkey = "tag"; |
$pages = $this->LoadAll("select tag, owner, user from ".$this->config["table_prefix"]."pages where latest = 'Y' and comment_on = '' order by $sortkey asc"); |
foreach ($pages as $page) { |
$this->CachePage($page); |
$owner=$page["owner"]?$page["owner"]:"Inconnu"; |
echo " ",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($owner),". . . . dernière modification par " , $this->Format($page["user"]) , "<br/>\n" ; |
} |
} |
// Tree display |
else if ($sortkey = $this->GetParameter("tree")) |
{ |
// No rootpage specified, assume root_page |
if ($sortkey=="tree") $sortkey=$this->GetConfigValue("root_page"); |
echo $this->ComposeLinkToPage($sortkey),"<br /><br/>\n" ; |
// 3 levels displayed, It should be parameter ... |
TreeView($sortkey,3); |
} |
// Default Action : sort by tag |
else |
{ |
$pages = $this->LoadAll("select tag, owner, user from ".$this->config["table_prefix"]."pages where latest = 'Y' and comment_on = '' order by tag asc"); |
foreach ($pages as $page) { |
$this->CachePage($page); |
$owner=$page["owner"]?$page["owner"]:"Inconnu"; |
echo " ",$this->ComposeLinkToPage($page["tag"], "", "", 0)," . . . . ",$this->Format($owner),"<br/>\n" ; |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/listusers.php |
---|
New file |
0,0 → 1,45 |
<?php |
/* |
listusers.php |
Copyright 2002 Patrick PAUL |
Copyright 2003 David DELON |
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 |
*/ |
if ($last = $this->GetParameter("last")) |
{ |
if ($last=="last") $last=150; else $last= (int) $last; |
if ($last) |
{ |
$last_users = $this->LoadAll("select name, signuptime from ".$this->config["table_prefix"]."users order by signuptime desc limit $last"); |
foreach($last_users as $user) { echo $this->Format($user["name"])," . . . ",$user["signuptime"],"<br />\n" ; } |
} |
} |
else |
{ |
if ($last_users = $this->LoadAll("select name, signuptime from ".$this->config["table_prefix"]."users order by name asc") |
) |
{ |
foreach($last_users as $user) |
{ |
echo $this->Format($user["name"])," . . . ",$user["signuptime"],"<br />\n" ; |
} |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/footer.php |
---|
New file |
0,0 → 1,101 |
<div class="footer"> |
<?php |
/* footer.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003, 2004 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2002, 2003 Patrick PAUL |
Copyright 2003 Eric DELORD |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
echo $this->FormOpen("", "RechercheTexte", "get"); |
echo $this->HasAccess("write") ? "<a href=\"".$this->href("edit")."\" title=\"Cliquez pour éditer cette page.\">Éditer cette page</a> ::\n" : ""; |
echo $this->GetPageTime() ? "<a href=\"".$this->href("revisions")."\" title=\"Cliquez pour voir les dernières modifications sur cette page.\">".$this->GetPageTime()."</a> ::\n" : ""; |
// if this page exists |
if ($this->page) |
{ |
// if owner is current user |
if ($this->UserIsOwner()) |
{ |
echo |
"Propriétaire : vous :: \n", |
"<a href=\"",$this->href("acls")."\" title=\"Cliquez pour éditer les permissions de cette page.\">Éditer permissions</a> :: \n", |
"<a href=\"",$this->href("deletepage")."\">Supprimer</a> :: \n"; |
} |
else |
{ |
if ($owner = $this->GetPageOwner()) |
{ |
echo "Propriétaire : ",$this->Format($owner); |
} |
else |
{ |
echo "Pas de propriétaire "; |
echo ($this->GetUser() ? "(<a href=\"".$this->href("claim")."\">Appropriation</a>)" : ""); |
} |
echo " :: \n"; |
} |
} |
?> |
<a href="<?php echo $this->href("referrers") ?>" title="Cliquez pour voir les URLs faisant référence à cette page."> |
Références</a> :: |
Recherche : <input name="phrase" size="15" class="searchbox" /> |
<?php echo $this->FormClose(); ?> |
</div> |
<div class="copyright"> |
<a href="http://validator.w3.org/check/referer">XHTML 1.0 valide ?</a> :: |
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS valide ?</a> :: |
-- Fonctionne avec <?php echo $this->Link("WikiNi:PagePrincipale", "", "WikiNi ".$this->GetWikiNiVersion()) . "\n"; ?> |
</div> |
<?php |
if ($this->GetConfigValue("debug")=="yes") |
{ |
echo "<span class=\"debug\"><b>Query log :</b><br />\n"; |
$t_SQL=0; |
foreach ($this->queryLog as $query) |
{ |
echo $query["query"]." (".round($query["time"],4).")<br />\n"; |
$t_SQL = $t_SQL + $query["time"]; |
} |
echo "</span>\n"; |
echo "<span class=\"debug\">".round($t_SQL, 4)." s (total SQL time)</span><br />\n"; |
list($g2_usec, $g2_sec) = explode(" ",microtime()); |
define ("t_end", (float)$g2_usec + (float)$g2_sec); |
echo "<span class=\"debug\"><b>".round(t_end-t_start, 4)." s (total time)</b></span><br />\n"; |
echo "<span class=\"debug\">SQL time represent : ".round((($t_SQL/(t_end-t_start))*100),2)."% of total time</span>\n"; |
} |
?> |
</body> |
</html> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/usersettings.php |
---|
New file |
0,0 → 1,256 |
<?php |
/* |
usersettings.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2002 Patrick PAUL |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
if (!isset($_REQUEST["action"])) $_REQUEST["action"] = ''; |
if ($_REQUEST["action"] == "logout") |
{ |
$this->LogoutUser(); |
$this->SetMessage("Vous êtes maintenant déconnecté !"); |
$this->Redirect($this->href()); |
} |
else if ($user = $this->GetUser()) |
{ |
// is user trying to update? |
if ($_REQUEST["action"] == "update") |
{ |
$this->Query("update ".$this->config["table_prefix"]."users set ". |
"email = '".mysql_escape_string($_POST["email"])."', ". |
"doubleclickedit = '".mysql_escape_string($_POST["doubleclickedit"])."', ". |
"show_comments = '".mysql_escape_string($_POST["show_comments"])."', ". |
"revisioncount = '".mysql_escape_string($_POST["revisioncount"])."', ". |
"changescount = '".mysql_escape_string($_POST["changescount"])."', ". |
"motto = '".mysql_escape_string($_POST["motto"])."' ". |
"where name = '".$user["name"]."' limit 1"); |
$this->SetUser($this->LoadUser($user["name"])); |
// forward |
$this->SetMessage("Paramètres sauvegardés !"); |
$this->Redirect($this->href()); |
} |
if ($_REQUEST["action"] == "changepass") |
{ |
// check password |
$password = $_POST["password"]; |
if (preg_match("/ /", $password)) $error = "Les espaces ne sont pas permis dans les mots de passe."; |
else if (strlen($password) < 5) $error = "Mot de passe trop court."; |
else if ($user["password"] != md5($_POST["oldpass"])) $error = "Mauvais mot de passe."; |
else |
{ |
$this->Query("update ".$this->config["table_prefix"]."users set "."password = md5('".mysql_escape_string($password)."') "."where name = '".$user["name"]."'"); |
$this->SetMessage("Mot de passe changé !"); |
$user["password"]=md5($password); |
$this->SetUser($user); |
$this->Redirect($this->href()); |
} |
} |
// user is logged in; display config form |
echo $this->FormOpen(); |
?> |
<input type="hidden" name="action" value="update" /> |
<table> |
<tr> |
<td align="right"></td> |
<td>Bonjour, <?php echo $this->Link($user["name"]) ?> !</td> |
</tr> |
<tr> |
<td align="right">Votre adresse de messagerie électronique :</td> |
<td><input name="email" value="<?php echo htmlentities($user["email"]) ?>" size="40" /></td> |
</tr> |
<tr> |
<td align="right">Édition en double-cliquant :</td> |
<td><input type="hidden" name="doubleclickedit" value="N" /><input type="checkbox" name="doubleclickedit" value="Y" <?php echo $user["doubleclickedit"] == "Y" ? "checked=\"checked\"" : "" ?> /></td> |
</tr> |
<tr> |
<td align="right">Par défaut, montrer les commentaires :</td> |
<td><input type="hidden" name="show_comments" value="N" /><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked\"checked\"" : "" ?> /></td> |
</tr> |
<tr> |
<td align="right">Nombre maximum de derniers commentaires :</td> |
<td><input name="changescount" value="<?php echo htmlentities($user["changescount"]) ?>" size="40" /></td> |
</tr> |
<tr> |
<td align="right">Nombre maximum de versions :</td> |
<td><input name="revisioncount" value="<?php echo htmlentities($user["revisioncount"]) ?>" size="40" /></td> |
</tr> |
<tr> |
<td align="right">Votre devise :</td> |
<td><input name="motto" value="<?php echo htmlentities($user["motto"]) ?>" size="40" /></td> |
</tr> |
<tr> |
<td></td> |
<td><input type="submit" value="Mise à jour" /> <input type="button" value="Déconnexion" onclick="document.location='<?php echo $this->href("", "", "action=logout"); ?>'" /></td> |
</tr> |
<?php |
echo $this->FormClose(); |
echo $this->FormOpen(); |
?> |
<input type="hidden" name="action" value="changepass" /> |
<tr> |
<td> </td> |
<td> </td> |
</tr> |
<tr> |
<td align="right"></td> |
<td><?php echo $this->Format("Changement de mot de passe"); ?></td> |
</tr> |
<?php |
if (isset($error)) |
{ |
echo "<tr><td></td><td><div class=\"error\">", $this->Format($error), "</div></td></tr>\n"; |
} |
?> |
<tr> |
<td align="right">Votre ancien mot de passe :</td> |
<td><input type="password" name="oldpass" size="40" /></td> |
</tr> |
<tr> |
<td align="right">Nouveau mot de passe :</td> |
<td><input type="password" name="password" size="40" /></td> |
</tr> |
<tr> |
<td></td> |
<td><input type="submit" value="Changer" size="40" /></td> |
</tr> |
</table> |
<?php |
echo $this->FormClose(); |
} |
else |
{ |
// user is not logged in |
// is user trying to log in or register? |
if ($_REQUEST["action"] == "login") |
{ |
// if user name already exists, check password |
if ($existingUser = $this->LoadUser($_POST["name"])) |
{ |
// check password |
if ($existingUser["password"] == md5($_POST["password"])) |
{ |
$this->SetUser($existingUser, $_POST["remember"]); |
$this->Redirect($this->href()); |
} |
else |
{ |
$error = "Mauvais mot de passe !"; |
} |
} |
// otherwise, create new account |
else |
{ |
$name = trim($_POST["name"]); |
$email = trim($_POST["email"]); |
$password = $_POST["password"]; |
$confpassword = $_POST["confpassword"]; |
// check if name is WikkiName style |
if (!$this->IsWikiName($name)) $error = "Votre nom d'utilisateur doit être formaté en NomWiki."; |
else if (!$email) $error = "Vous devez spécifier une adresse de messagerie électronique."; |
else if (!preg_match("/^.+?\@.+?\..+$/", $email)) $error = "Ceci ne ressemble pas à une adresse de messagerie électronique."; |
else if ($confpassword != $password) $error = "Les mots de passe n'étaient pas identiques"; |
else if (preg_match("/ /", $password)) $error = "Les espaces ne sont pas permis dans un mot de passe."; |
else if (strlen($password) < 5) $error = "Mot de passe trop court. Un mot de passe doit contenir au minimum 5 caractères alphanumériques."; |
else |
{ |
$this->Query("insert into ".$this->config["table_prefix"]."users set ". |
"signuptime = now(), ". |
"name = '".mysql_escape_string($name)."', ". |
"email = '".mysql_escape_string($email)."', ". |
"password = md5('".mysql_escape_string($_POST["password"])."')"); |
// log in |
$this->SetUser($this->LoadUser($name)); |
// forward |
$this->Redirect($this->href()); |
} |
} |
} |
echo $this->FormOpen(); |
?> |
<input type="hidden" name="action" value="login" /> |
<table> |
<tr> |
<td></td> |
<td><?php echo $this->Format("Si vous êtes déjà enregistré, identifiez-vous ici"); ?></td> |
</tr> |
<?php |
if (isset($error)) |
{ |
echo "<tr><td></td><td><div class=\"error\">", $this->Format($error), "</div></td></tr>\n"; |
} |
?> |
<tr> |
<td align="right">Votre NomWiki :</td> |
<td><input name="name" size="40" value="<?php if (isset($name)) echo $name ?>" /></td> |
</tr> |
<tr> |
<td align="right">Mot de passe (5 caractères minimum) :</td> |
<td> |
<input type="password" name="password" size="40" /> |
<input type="hidden" name="remember" value="0" /> |
<input type="checkbox" name="remember" value="1" /> Se souvenir de moi. |
</td> |
</tr> |
<tr> |
<td></td> |
<td><input type="submit" value="Identification" size="40" /></td> |
</tr> |
<tr> |
<td></td> |
<td width="500"><?php echo $this->Format("Les champs suivants sont à remplir si vous vous identifiez pour la première fois (vous créerez ainsi un compte)"); ?></td> |
</tr> |
<tr> |
<td align="right">Confirmation du mot de passe :</td> |
<td><input type="password" name="confpassword" size="40" /></td> |
</tr> |
<tr> |
<td align="right">Adresse de messagerie électronique. :</td> |
<td><input name="email" size="40" value="<?php if (isset($email)) echo $email ?>" /></td> |
</tr> |
<tr> |
<td></td> |
<td><input type="submit" value="Nouveau compte" size="40" /></td> |
</tr> |
</table> |
<?php |
echo $this->FormClose(); |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/redirect.php |
---|
New file |
0,0 → 1,48 |
<?php |
/* |
redirect.php : Permet de faire une redirection vers une autre pages Wiki du site |
Copyright 2003 Eric FELDSTEIN |
Copyright 2003 David DELON |
Copyright 2004 Jean Christophe ANDRE |
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 |
*/ |
/* |
Parametres : page : nom wiki de la page vers laquelle ont doit rediriger (obligatoire) |
exemple : {{redirect page="BacASable"}} |
*/ |
//recuperation du parametres |
$redirPageName = $this->GetParameter("page"); |
if (empty($redirPageName)){ |
echo $this->Format("//Le paramêtre \"page\" est manquant.//"); |
}else{ |
if (eregi("^".$redirPageName."$",$this->GetPageTag())){ |
echo $this->Format("//Impossible à une page de se rediriger vers elle même.//"); |
}else{ |
$fromPages = array(); |
$fromPages = explode(":",$_COOKIE['redirectfrom']); |
if (in_array($this->GetPageTag(),$fromPages)){ |
echo $this->Format("//Redirection circulaire.//"); |
}else{ |
$fromPages[] = $this->GetPageTag(); |
SetCookie('redirectfrom', implode(":",$fromPages), time() + 30, $this->CookiePath); |
$this->Redirect($this->Href('', $redirPageName)); |
} |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/backlinks.php |
---|
New file |
0,0 → 1,62 |
<?php |
/* |
backlinks.php |
Copyright 2002 Patrick PAUL |
Copyright 2003 David DELON |
Copyright 2003 Charles NEPOTE |
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 |
*/ |
if ($this->GetParameter("page")) |
{ |
$page = $this->GetParameter("page"); |
$title = "Pages ayant un lien vers ".$this->ComposeLinkToPage($page)." : <br />\n"; |
} |
else |
{ |
$page = $this->getPageTag(); |
$title = "Pages ayant un lien vers la page courante : <br />\n"; |
} |
$pages = $this->LoadPagesLinkingTo($page); |
if ($pages) |
{ |
echo $title; |
if (!$exclude = $this->GetParameter("exclude")) |
{ |
foreach ($pages as $page) |
{ |
echo $this->ComposeLinkToPage($page["tag"]), "<br />\n"; |
} |
} |
else |
{ |
foreach ($pages as $page) |
{ |
// Show link if it isn't an excluded link |
if (!preg_match("/".$page["tag"]."(;|$)/", $exclude)) echo $this->ComposeLinkToPage($page["tag"]), "<br />\n"; |
} |
} |
} |
else |
{ |
echo "<i>Aucune page n'a de lien vers ", $this->ComposeLinkToPage($page), ".</i>"; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/interwikilist.php |
---|
New file |
0,0 → 1,30 |
<?php |
/*interwikilist.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2003 David DELON |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
$file = implode("", file("interwiki.conf", 1)); |
echo $this->Format("%%".$file."%%") ; |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/actions/recentchangesrss.php |
---|
New file |
0,0 → 1,60 |
<?php |
/* |
recentchangesrss.php |
Copyright 2003 David DELON |
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 |
*/ |
if ($user = $this->GetUser()) |
{ |
$max = $user["changescount"]; |
} |
else |
{ |
$max = 50; |
} |
if ($pages = $this->LoadRecentlyChanged($max)) |
{ |
if (!($link = $this->GetParameter("link"))) $link=$this->config["root_page"]; |
$output = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"; |
$output .= "<!-- RSS v0.91 generated by Wikini -->\n"; |
$output .= "<rdf:RDF\n"; |
$output .= "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n"; |
$output .= "xmlns=\"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n"; |
$output .= "<channel>\n"; |
$output .= "<title> Derniers changements sur ". $this->config["wakka_name"] . "</title>\n"; |
$output .= "<link>" . $this->config["base_url"] . $link . "</link>\n"; |
$output .= "<description> Derniers changements sur " . $this->config["wakka_name"] . " </description>\n"; |
$output .= "<language>fr</language>\n"; |
$output .= "</channel>\n"; |
foreach ($pages as $i => $page) |
{ |
list($day, $time) = explode(" ", $page["time"]); |
$day= preg_replace("/-/", " ", $day); |
list($hh,$mm,$ss) = explode(":", $time); |
$output .= "<item>\n"; |
$output .= "<title>" . $page["tag"] . " --- par " .$page["user"] . " le " . $day ." - ". $hh .":". $mm . "</title>\n"; |
$output .= "<description> Modification de " . $page["tag"] . " --- par " .$page["user"] . " le " . $day ." - ". $hh .":". $mm . "</description>\n"; |
$output .= "<link>" . $this->config["base_url"] . $page["tag"] . "&time=" . rawurlencode($page["time"]) . "</link>\n"; |
$output .= "</item>\n"; |
} |
$output .= "</rdf:RDF>\n"; |
echo $output ; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/addcomment.php |
---|
New file |
0,0 → 1,71 |
<?php |
/* |
addcomment.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
if ($this->HasAccess("comment")) |
{ |
// find number |
if ($latestComment = $this->LoadSingle("select tag, id from ".$this->config["table_prefix"]."pages where comment_on != '' order by id desc limit 1")) |
{ |
preg_match("/^Comment([0-9]+)$/", $latestComment["tag"], $matches); |
$num = $matches[1] + 1; |
} |
else |
{ |
$num = "1"; |
} |
$body = trim($_POST["body"]); |
if (!$body) |
{ |
$this->SetMessage("Commentaire vide -- pas de sauvegarde !"); |
} |
else |
{ |
// store new comment |
$this->SavePage("Comment".$num, $body, $this->tag); |
} |
// redirect to page |
$this->redirect($this->href()); |
} |
else |
{ |
echo"<div class=\"page\"><i>Vous n'êtes pas autorisé à commenter cette page.</i></div>\n"; |
} |
echo $this->Footer(); |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/deletepage.php |
---|
New file |
0,0 → 1,53 |
<?php |
/* |
deletepage.php |
Copyright 2002 David DELON |
Copyright 2003 Eric FELDSTEIN |
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 |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
if ($this->UserIsOwner()) |
{ |
if ($pages = $this->IsOrphanedPage($this->GetPageTag())) |
{ |
foreach ($pages as $page) |
{ |
$this->DeleteOrphanedPage($this->GetPageTag()); |
} |
} |
else |
{ |
echo"<i>Cette page n'est pas orpheline.</i>"; |
} |
} |
else |
{ |
echo"<i>Vous n'êtes pas le propriétaire de cette page.</i>"; |
} |
?> |
</div> |
<?php echo $this->Footer(); ?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/referrers.php |
---|
New file |
0,0 → 1,86 |
<?php |
/* |
referrers.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2003 Eric FELDSTEIN |
Copyright 2003 Jean-Pascal MILCENT |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
if ($global = $_REQUEST["global"]) |
{ |
$title = "Sites faisant référence à ce wiki (<a href=\"".$this->href("referrers_sites", "", "global=1")."\">voir la liste des domaines</a>) :"; |
$referrers = $this->LoadReferrers(); |
} |
else |
{ |
$title = "Pages externes faisant référence à ".$this->ComposeLinkToPage($this->GetPageTag()). |
($this->GetConfigValue("referrers_purge_time") ? " (depuis ".($this->GetConfigValue("referrers_purge_time") == 1 ? "24 heures" : $this->GetConfigValue("referrers_purge_time")." jours").")" : "")." (<a href=\"".$this->href("referrers_sites")."\">voir la liste des domaines</a>) :"; |
$referrers = $this->LoadReferrers($this->GetPageTag()); |
} |
echo "<b>$title</b><br /><br />\n" ; |
if ($referrers) |
{ |
{ |
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" ; |
foreach ($referrers as $referrer) |
{ |
echo "<tr>" ; |
echo "<td width=\"30\" align=\"right\" valign=\"top\" style=\"padding-right: 10px\">",$referrer["num"],"</td>" ; |
echo "<td valign=\"top\"><a href=\"",$referrer["referrer"],"\">",$referrer["referrer"],"</a></td>" ; |
echo "</tr>\n" ; |
} |
echo "</table>\n" ; |
} |
} |
else |
{ |
echo "<i>Aucune <acronym tilte=\"Uniform Resource Locator (adresse web)\">URL</acronym> ne fait référence à cette page.</i><br />\n" ; |
} |
if ($global) |
{ |
echo "<br />[<a href=\"",$this->href("referrers_sites"),"\">Voir les domaines faisant référence à ",$this->GetPageTag()," seulement</a> | <a href=\"",$this->href("referrers"),"\">Voir les références à ",$this->GetPageTag()," seulement</a>]" ; |
} |
else |
{ |
echo "<br />[<a href=\"",$this->href("referrers_sites", "", "global=1"),"\">Voir tous les domaines faisant référence </a> | <a href=\"",$this->href("referrers", "", "global=1"),"\">Voir toutes les références </a>]" ; |
} |
?> |
</div> |
<?php echo $this->Footer(); ?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/show.php |
---|
New file |
0,0 → 1,170 |
<?php |
/* |
show.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2003 Eric DELORD |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
if ($HasAccessRead=$this->HasAccess("read")) |
{ |
if (!$this->page) |
{ |
echo "Cette page n'existe pas encore, voulez vous la <a href=\"".$this->href("edit")."\">créer</a> ?" ; |
} |
else |
{ |
// comment header? |
if ($this->page["comment_on"]) |
{ |
echo "<div class=\"commentinfo\">Ceci est un commentaire sur ",$this->ComposeLinkToPage($this->page["comment_on"], "", "", 0),", posté par ",$this->Format($this->page["user"])," à ",$this->page["time"],"</div>"; |
} |
if ($this->page["latest"] == "N") |
{ |
echo "<div class=\"revisioninfo\">Ceci est une version archivée de <a href=\"",$this->href(),"\">",$this->GetPageTag(),"</a> à ",$this->page["time"],".</div>"; |
} |
// display page |
echo $this->Format($this->page["body"], "wakka"); |
// if this is an old revision, display some buttons |
if (($this->page["latest"] == "N") && $this->HasAccess("write")) |
{ |
$latest = $this->LoadPage($this->tag); |
?> |
<br /> |
<?php echo $this->FormOpen("edit") ?> |
<input type="hidden" name="previous" value="<?php echo $latest["id"] ?>"> |
<input type="hidden" name="body" value="<?php echo htmlentities($this->page["body"]) ?>"> |
<input type="submit" value="Rééditer cette version archivée"> |
<?php echo $this->FormClose(); ?> |
<?php |
} |
} |
} |
else |
{ |
echo "<i>Vous n'êtes pas autorisé à lire cette page</i>" ; |
} |
?> |
<hr class="hr_clear" /> |
</div> |
<?php |
if ($HasAccessRead) |
{ |
// load comments for this page |
$comments = $this->LoadComments($this->tag); |
// store comments display in session |
$tag = $this->GetPageTag(); |
if (!isset($_SESSION["show_comments"][$tag])) |
$_SESSION["show_comments"][$tag] = ($this->UserWantsComments() ? "1" : "0"); |
if (isset($_REQUEST["show_comments"])){ |
switch($_REQUEST["show_comments"]) |
{ |
case "0": |
$_SESSION["show_comments"][$tag] = 0; |
break; |
case "1": |
$_SESSION["show_comments"][$tag] = 1; |
break; |
} |
} |
// display comments! |
if ($this->page && $_SESSION["show_comments"][$tag]) |
{ |
// display comments header |
?> |
<div class="commentsheader"> |
Commentaires [<a href="<?php echo $this->href("", "", "show_comments=0") ?>">Cacher commentaires/formulaire</a>] |
</div> |
<?php |
// display comments themselves |
if ($comments) |
{ |
foreach ($comments as $comment) |
{ |
echo "<a name=\"",$comment["tag"],"\"></a>\n" ; |
echo "<div class=\"comment\">\n" ; |
echo $this->Format($comment["body"]),"\n" ; |
echo "<div class=\"commentinfo\">\n-- ",$this->Format($comment["user"])," (".$comment["time"],")\n</div>\n" ; |
echo "</div>\n" ; |
} |
} |
// display comment form |
echo "<div class=\"commentform\">\n" ; |
if ($this->HasAccess("comment")) |
{ |
?> |
Ajouter un commentaire à cette page:<br /> |
<?php echo $this->FormOpen("addcomment"); ?> |
<textarea name="body" rows="6" style="width: 100%"></textarea><br /> |
<input type="submit" value="Ajouter Commentaire" accesskey="s"> |
<?php echo $this->FormClose(); ?> |
<?php |
} |
echo "</div>\n" ; |
} |
else |
{ |
?> |
<div class="commentsheader"> |
<?php |
switch (count($comments)) |
{ |
case 0: |
echo "Il n'y a pas de commentaire sur cette page." ; |
break; |
case 1: |
echo "Il y a un commentaire sur cette page." ; |
break; |
default: |
echo "Il y a ",count($comments)," commentaires sur cette page." ; |
} |
?> |
[<a href="<?php echo $this->href("", "", "show_comments=1") ?>">Afficher commentaires/formulaire</a>] |
</div> |
<?php |
} |
} |
echo $this->Footer(); |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/slide_show.php |
---|
New file |
0,0 → 1,233 |
<?php |
/* |
Handler "slide_show" pour WikiNi version WikiNi 0.4.1rc et supérieurs. |
Développé par Charles Népote. |
Version 0.08 du 26/04/2004. |
Licence GPL. |
Par défaut il utilise les classes de style suivantes : |
.slide { font-size: 160%; margin: 5%; background-color: #FFFFFF; padding: 30px; border: 1px inset; line-height: 1.5; } |
.slide UL, LI { font-size: 100%; } |
.slide LI LI { font-size: 90% } |
.sl_nav p { text-decoration: none; text-align: right; font-size: 80%; line-height: 0.4; } |
.sl_nav A { text-decoration: none; } |
.sl_nav a:hover { color: #CF8888 } |
.sum { font-size: 8px; } |
Pour modifier ces styles il faut créer un fichier "slideshow.css" contenant les styles modifiés. |
Le fichier "slideshow.css" sera reconnu automatiquement. |
*/ |
// On teste si le script n'est pas appelé en direct |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) |
{ |
die ("accès direct interdit"); |
} |
// On teste si l'utilisateur peut lire la page |
if (!$this->HasAccess("read")) |
{ |
return; |
} |
else |
{ |
// On teste si la page existe |
if (!$this->page) |
{ |
return; |
} |
else |
{ |
/* |
Exemple de page : |
(1) Présentation xxxxxxxxxxxxxx |
===== (2) Titre ===== |
Diapo 2. |
===== (3) Titre ===== |
Diapo 3. |
===== (4) Titre ===== |
Diapo 4. |
===== (5) Titre ===== |
Diapo 5. |
===== (6) Titre ===== |
Diapo 6. |
===== (7) Titre ===== |
Diapo 7. |
Autre exemple : |
===== (1) Titre ===== |
Diapo 1. |
===== (2) Titre ===== |
Diapo 2. |
===== (3) Titre ===== |
Diapo 3. |
===== (4) Titre ===== |
Diapo 4. |
===== (5) Titre ===== |
Diapo 5. |
===== (6) Titre ===== |
Diapo 6. |
===== (7) Titre ===== |
Diapo 7. |
*/ |
// |
// découpe la page |
$body_f = $this->format($this->page["body"]); |
$body = preg_split('/(.*<h2>.*<\/h2>)/',$body_f,-1,PREG_SPLIT_DELIM_CAPTURE); |
if ($_REQUEST["debug"] == "1") print_r("<div style=\"display: none\">".$body."</div>"); |
// Si la première diapositive commence par un titre de niveau 1 |
if (preg_match('/^<h2>.*<\/h2>/', $body_f)) $major = "0"; |
else $major = "1"; |
$user = $this->GetUser(); // echo $this->GetUser(); |
// On teste toutes les paramètres du handler "slide_show" ; s'il n'y en a pas, c'est le paramètre "slide=1" qui est invoqué par défaut |
/* |
switch ($_REQUEST["method"]) |
{ |
case "export": |
export(); |
break; |
case "show": |
showSlide(); |
break; |
default: |
showSlide(); |
break; |
} |
*/ |
//if ($_REQUEST["export"]) { return; } |
if (!$body) |
{ |
return; |
} |
else |
{ |
// Si on ne précise pas de paramètre, on affiche par défaut la première diapo |
if (!$_REQUEST["slide"] or $_REQUEST["slide"] == "1") $slide = "1"; |
else $slide = $_REQUEST["slide"]; |
// Affiche l'en-tête |
echo |
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; |
echo |
"<html>\n\n\n", |
"<head>\n", |
"<title>", $this->GetWakkaName(), ":", $this->GetPageTag(), "</title>\n", |
"<meta name=\"robots\" content=\"noindex, nofollow\" />\n", |
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n"; |
echo |
"<style type=\"text/css\" media=\"all\"> @import \"wakka.css\";</style>\n"; |
// Teste s'il existe une feuille de style externe, sinon utilise des styles par défaut |
if (!file_exists("slideshow.css")) |
{ |
echo "<style type=\"text/css\">\n", |
".slide { font-size: 160%; margin: 5%; background-color: #FFFFFF; padding: 30px; border: 1px inset; line-height: 1.5; }\n", |
".slide UL, LI { font-size: 100%; }\n", |
".slide LI LI { font-size: 90% }\n", |
".sl_nav p { text-decoration: none; text-align: right; font-size: 80%; line-height: 0.4; }\n", |
".sl_nav A { text-decoration: none; }\n", |
".sl_nav a:hover { color: #CF8888 }\n", |
".sum { font-size: 8px; }\n", |
"</style>\n"; |
} |
else |
{ |
echo "<style type=\"text/css\" media=\"all\"> @import \"slideshow.css\";</style>\n"; |
} |
echo |
"</head>\n\n\n"; |
// Affiche le corps de la page |
echo |
"<body "; |
echo (!$user || ($user["doubleclickedit"] == 'Y')) ? "ondblclick=\"document.location='".$this->href("edit")."';\" " : "", ">\n"; |
// Affichage du sommaire [à compléter] |
/* |
if ($_REQUEST["sum"] == "on") |
{ |
echo "<ul class=\"sum\">\n"; |
if ($major = "1") echo "<li>", $this->format($body[0]), "</li>\n"; |
foreach ($body as $title_sum) |
{ |
$i = $i + 1; |
$type = gettype($i/2); |
// Ne retourne que les 50 premiers caractères du titre |
$title_sum = substr($title_sum, 0, 50); |
if ($type == "integer") |
{ |
echo "<li>",$this->format($title_sum),"</li>\n"; |
} |
} |
echo "</ul>\n\n"; |
} |
*/ |
// Affichage du menu de navigation |
echo |
"<div class=\"sl_nav\">\n", |
"<p>"; |
if ($slide !== "1") |
echo |
"<a href=\"",$this->href(),"/slide_show&slide=",$_REQUEST['slide']-1,"\"><< précédent</a>", |
" :: <a href=\"",$this->href(),"/slide_show&slide=1\">[début]</a>\n"; |
echo " :: "; |
if ($body[($slide)*2-($nb*2)+2] or $slide == "1") |
echo "<a href=\"",$this->href(),"/slide_show&slide=",$slide+1,"\">suivant >></a>\n"; |
echo |
"</p>\n"; |
echo "<p><a href=\"",$this->href(),"/edit\">Éditer </a> :: <a href=\"",$this->href(),"\">[]-></a></p>\n"; |
echo |
"</div>\n\n"; |
echo |
"<div class=\"slide\">\n"; |
// Si c'est la première diapositive |
if ($slide == "1" and $major == "1") |
{ |
echo $body[0], "<br /><br />"; |
} |
// A partir de la deuxième diapositive |
else |
{ |
echo |
$body[($slide*2)-($major*2)-1].$body[($slide*2)-($major*2)],"\n"; |
echo "\n"; |
} |
echo |
"</div>\n\n"; |
echo |
"</body>\n", |
"</html>"; |
} |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/xml.php |
---|
New file |
0,0 → 1,39 |
<?php |
/* |
xml.php |
Copyright 2003 David DELON |
Copyright 2003 Eric FELDSTEIN |
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 |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
header("Content-type: text/xml"); |
if ($HasAccessRead=$this->HasAccess("read")) |
{ |
// TODO : Return an empty xml ? |
// TODO : Return an error read (noaccess) xml ? |
if ($this->page) |
{ |
// display page |
echo $this->Format($this->page["body"], "action") ; |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/revisions.php |
---|
New file |
0,0 → 1,86 |
<?php |
/* |
revisions.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
// load revisions for this pageif |
if ($this->HasAccess("read")) { |
$output=''; |
if ($pages = $this->LoadRevisions($this->tag)) |
{ |
$output .= $this->FormOpen("diff", "", "get"); |
$output .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"; |
$output .= "<tr>\n"; |
$output .= "<td><input type=\"submit\" value=\"Voir Différences\" /></td>"; |
$output .= "<td><input type=\"checkbox\" name=\"fastdiff\"/>\n".$this->Format("Affichage simplifié")."</td>"; |
$output .= "</tr>\n"; |
$output .= "</table>\n"; |
$output .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"; |
if ($user = $this->GetUser()) |
{ |
$max = $user["revisioncount"]; |
} |
else |
{ |
$max = 20; |
} |
$c = 0; |
foreach ($pages as $page) |
{ |
$c++; |
if (($c <= $max) || !$max) |
{ |
$output .= "<tr>"; |
$output .= "<td><input type=\"radio\" name=\"a\" value=\"".$page["id"]."\" ".($c == 1 ? "checked=\"checked\"" : "")." /></td>"; |
$output .= "<td><input type=\"radio\" name=\"b\" value=\"".$page["id"]."\" ".($c == 2 ? "checked=\"checked\"" : "")." /></td>"; |
$output .= "<td> <a href=\"".$this->href("show")."&time=".urlencode($page["time"])."\">".$page["time"]."</a></td>"; |
$output .= "<td> by ".$this->Format($page["user"])."</td>"; |
$output .= "</tr>\n"; |
} |
} |
$output .= "</table>\n".$this->FormClose()."\n"; |
} |
echo $output ; |
} |
else |
{ |
echo "<i>Vous n'avez pas accès à cette page.</i>" ; |
} |
?> |
</div> |
<?php echo $this->Footer(); ?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/acls.php |
---|
New file |
0,0 → 1,128 |
<?php |
/* |
acls.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2003 Eric FELDSTEIN |
Copyright 2003 Jean-Pascal MILCENT |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
if ($this->UserIsOwner()) |
{ |
if ($_POST) |
{ |
// store lists |
$this->SaveAcl($this->GetPageTag(), "read", $_POST["read_acl"]); |
$this->SaveAcl($this->GetPageTag(), "write", $_POST["write_acl"]); |
$this->SaveAcl($this->GetPageTag(), "comment", $_POST["comment_acl"]); |
$message = "Droits d\'accès mis à jour ";//$message = "Access control lists updated"; |
// change owner? |
if ($newowner = $_POST["newowner"]) |
{ |
$this->SetPageOwner($this->GetPageTag(), $newowner); |
$message .= " et changement du propriétaire. Nouveau propriétaire : ".$newowner;//$message .= " and gave ownership to ".$newowner; |
} |
// redirect back to page |
$this->SetMessage($message."!"); |
$this->Redirect($this->Href()); |
} |
else |
{ |
// load acls |
$readACL = $this->LoadAcl($this->GetPageTag(), "read"); |
$writeACL = $this->LoadAcl($this->GetPageTag(), "write"); |
$commentACL = $this->LoadAcl($this->GetPageTag(), "comment"); |
// show form |
?> |
<h3>Liste des droits d'accès de la page <?php echo $this->ComposeLinkToPage($this->GetPageTag()) ?></h3><!-- Access Control Lists for--> |
<br /> |
<?php echo $this->FormOpen("acls") ?> |
<table border="0" cellspacing="0" cellpadding="0"> |
<tr> |
<td valign="top" style="padding-right: 20px"> |
<b>Droits de lecture :</b><br /><!-- Read ACL:--> |
<textarea name="read_acl" rows="4" cols="20"><?php echo $readACL["list"] ?></textarea> |
</td> |
<td valign="top" style="padding-right: 20px"> |
<b>Droits d'écriture :</b><br /><!-- Write ACL:--> |
<textarea name="write_acl" rows="4" cols="20"><?php echo $writeACL["list"] ?></textarea> |
</td> |
<td valign="top" style="padding-right: 20px"> |
<b>Droits des commentaires :</b><br /><!-- Comments ACL:--> |
<textarea name="comment_acl" rows="4" cols="20"><?php echo $commentACL["list"] ?></textarea> |
</td> |
</tr> |
<tr> |
<td colspan="3"> |
<b>Changer le propriétaire :</b><br /><!-- Set Owner:--> |
<select name="newowner"> |
<option value="">Ne rien modifier</option><!-- Don't change--> |
<option value=""></option> |
<?php |
if ($users = $this->LoadUsers()) |
{ |
foreach($users as $user) |
{ |
echo "<option value=\"",htmlentities($user["name"]),"\">",$user["name"],"</option>\n"; |
} |
} |
?> |
</select> |
</td> |
</tr> |
<tr> |
<td colspan="3"> |
<br /> |
<input type="submit" value="Enregistrer" style="width: 120px" accesskey="s" /><!-- Store ACLs--> |
<input type="button" value="Annuler" onclick="history.back();" style="width: 120px" /><!-- Cancel --> |
</td> |
</tr> |
</table> |
<?php |
echo$this->FormClose(); |
} |
} |
else |
{ |
echo"<i>Vous n'êtes pas le propriétaire de cette page.</i>"; |
//echo"<i>You're not the owner of this page.</i>"; |
} |
?> |
</div> |
<?php echo $this->Footer(); ?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/resetstyle.php |
---|
New file |
0,0 → 1,27 |
<?php |
// Handler resetstyle.php version 0.2 du 16/03/2004 |
// pour WikiNi 0.4.1rc (=> à la version du 200403xx) et supérieurs |
// Par Charles Népote (c) 2004 |
// Licence GPL |
// Fonctionnement |
// |
// Cet handler permet à l'utilisateur de revenir à la feuille de style par défaut du site. |
// Techniquement : |
// Usage : |
// http://example.org/PageTest/resetstyle |
// A compléter (peut-être un jour) : |
// |
// -- détecter le fichier par défaut via une variable de configuration |
// |
$this->SetPersistentCookie('sitestyle','wakka',1); |
header("Location: ".$this->href()); |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/claim.php |
---|
New file |
0,0 → 1,46 |
<?php |
/* |
claim.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
// only claim ownership if this page has no owner, and if user is logged in. |
if ($this->page && !$this->GetPageOwner() && $this->GetUser()) |
{ |
$this->SetPageOwner($this->GetPageTag(), $this->GetUserName()); |
$this->SetMessage("Vous êtes maintenant le propriétaire de cette page"); |
} |
$this->Redirect($this->href()); |
echo $this->Footer(); |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/edit.php |
---|
New file |
0,0 → 1,150 |
<?php |
/* |
edit.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2002, 2003 Patrick PAUL |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
if ($this->HasAccess("write") && $this->HasAccess("read")) |
{ |
$output=''; |
if ($_POST) |
{ |
// only if saving: |
if ($_POST["submit"] == "Sauver") |
{ |
// check for overwriting |
if ($this->page) |
{ |
if ($this->page["id"] != $_POST["previous"]) |
{ |
$error = "ALERTE : ". |
"Cette page a été modifiée par quelqu'un d'autre pendant que vous l'éditiez.<br />\n". |
"Veuillez copier vos changements et rééditer cette page.\n"; |
} |
} |
// store |
if (!$error) |
{ |
$body = str_replace("\r", "", $_POST["body"]); |
// test si la nouvelle page est differente de la précédente |
if(rtrim($body)==rtrim($this->page["body"])) { |
$this->SetMessage("Cette page n\'a pas été enregistrée car elle n\'a subi aucune modification."); |
$this->Redirect($this->href()); |
} |
// add page (revisions) |
$this->SavePage($this->tag, $body); |
// now we render it internally so we can write the updated link table. |
$this->ClearLinkTable(); |
$this->StartLinkTracking(); |
$dummy = $this->Header(); |
$dummy .= $this->Format($body); |
$dummy .= $this->Footer(); |
$this->StopLinkTracking(); |
$this->WriteLinkTable(); |
$this->ClearLinkTable(); |
// forward |
$this->Redirect($this->href()); |
} |
} |
} |
// fetch fields |
if (!isset($_POST["previous"])) $previous = $this->page["id"]; |
else $previous = $_POST["previous"]; |
if (!isset($_POST["body"])) $body = $this->page["body"]; |
else $body = $_POST["body"]; |
// preview? |
if (!isset($_POST["submit"])) $_POST["submit"] = ""; |
if ($_POST["submit"] == "Aperçu") |
{ |
$output .= |
"<div class=\"prev_alert\"><strong>Aperçu</strong></div>\n". |
$this->Format($body)."\n\n". |
$this->FormOpen("edit"). |
"<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n". |
"<input type=\"hidden\" name=\"body\" value=\"".htmlentities($body)."\" />\n". |
"<br />\n". |
"<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n". |
"<input name=\"submit\" type=\"submit\" value=\"Rééditer \" accesskey=\"p\" />\n". |
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" />\n". |
$this->FormClose()."\n"; |
} |
else |
{ |
// display form |
if (isset($error)) |
{ |
if (!isset($output)) $output = ''; |
$output .= "<div class=\"error\">$error</div>\n"; |
} |
// append a comment? |
if (isset($_REQUEST["appendcomment"])) |
{ |
$body = trim($body)."\n\n----\n\n--".$this->UserName()." (".strftime("%c").")"; |
} |
if (!isset($output)) $output = ''; |
$output .= |
$this->FormOpen("edit"). |
"<input type=\"hidden\" name=\"previous\" value=\"".$previous."\" />\n". |
"<textarea onkeydown=\"fKeyDown()\" name=\"body\" cols=\"60\" rows=\"40\" wrap=\"soft\" class=\"edit\">\n". |
htmlspecialchars($body). |
"\n</textarea><br />\n". |
($this->config["preview_before_save"] ? "" : "<input name=\"submit\" type=\"submit\" value=\"Sauver\" accesskey=\"s\" />\n"). |
"<input name=\"submit\" type=\"submit\" value=\"Aperçu\" accesskey=\"p\" />\n". |
"<input type=\"button\" value=\"Annulation\" onclick=\"document.location='".$this->href("")."';\" />\n". |
$this->FormClose(); |
} |
echo $output; |
} |
else |
{ |
echo "<i>Vous n'avez pas accès en écriture à cette page !</i>\n"; |
} |
?> |
<hr class="hr_clear" /> |
</div> |
<?php echo $this->Footer(); ?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/referrers_sites.php |
---|
New file |
0,0 → 1,98 |
<?php |
/* |
wakka.php |
Copyright (c) 2003, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
if ($global = $_REQUEST["global"]) |
{ |
$title = "Domaines faisant référence à ce wiki (<a href=\"".$this->href("referrers", "", "global=1")."\">voir la liste des pages externes</a>):"; |
$referrers = $this->LoadReferrers(); |
} |
else |
{ |
$title = "Domaines faisant référence à ".$this->Link($this->GetPageTag()). |
($this->GetConfigValue("referrers_purge_time") ? " (depuis ".($this->GetConfigValue("referrers_purge_time") == 1 ? "24 heures" : $this->GetConfigValue("referrers_purge_time")." jours").")" : "")." (<a href=\"".$this->href("referrers")."\">voir la liste des pages externes</a>):"; |
$referrers = $this->LoadReferrers($this->GetPageTag()); |
} |
echo "<b>$title</b><br /><br />\n" ; |
if ($referrers) |
{ |
for ($a = 0; $a < count($referrers); $a++) |
{ |
$temp_parse_url = parse_url($referrers[$a]["referrer"]); |
$temp_parse_url = ($temp_parse_url["host"] != "") ? strtolower(preg_replace("/^www\./Ui", "", $temp_parse_url["host"])) : "inconnu"; |
if (isset($referrer_sites["$temp_parse_url"])) |
{ |
$referrer_sites["$temp_parse_url"] += $referrers[$a]["num"]; |
} |
else |
{ |
$referrer_sites["$temp_parse_url"] = $referrers[$a]["num"]; |
} |
} |
array_multisort($referrer_sites, SORT_DESC, SORT_NUMERIC); |
reset($referrer_sites); |
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n" ; |
foreach ($referrer_sites as $site => $site_count) |
{ |
echo "<tr>" ; |
echo "<td width=\"30\" align=\"right\" valign=\"top\" style=\"padding-right: 10px\">" , $site_count, "</td>" ; |
echo "<td valign=\"top\">" , (($site != "unknown") ? "<a href=\"http://$site\">$site</a>" : $site) , "</td>" ; |
echo "</tr>\n" ; |
} |
echo "</table>\n" ; |
} |
else |
{ |
echo "<i>None</i><br />\n" ; |
} |
if ($global) |
{ |
echo "<br />[<a href=\"",$this->href("referrers_sites"),"\">Voir les domaines faisant référence à ",$this->GetPageTag()," seulement</a> | <a href=\"",$this->href("referrers"),"\">Voir les références ",$this->GetPageTag()," seulement</a>]"; |
} |
else |
{ |
echo "<br />[<a href=\"",$this->href("referrers_sites", "", "global=1"),"\">Voir tous les domaines faisant référence </a> | <a href=\"",$this->href("referrers", "", "global=1"),"\">Voir toutes les références </a>]" ; |
} |
?> |
</div> |
<?php echo $this->Footer(); ?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/diff.php |
---|
New file |
0,0 → 1,1003 |
<?php |
/* |
diff.php |
Copyright (C) 1992 Free Software Foundation, Inc. Francois Pinard <pinard@iro.umontreal.ca>. |
Copyright (C) 2000, 2001 Geoffrey T. Dairiki <dairiki@dairiki.org> |
Copyright 2002,2003,2004 David DELON |
Copyright 2002 Patrick PAUL |
Copyright 2003 Eric FELDSTEIN |
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 |
original diff.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
echo $this->Header(); |
?> |
<div class="page"> |
<?php |
if ($this->HasAccess("read")) |
{ |
// If asked, call original diff |
if ($_REQUEST["fastdiff"]) { |
/* NOTE: This is a really cheap way to do it. I think it may be more intelligent to write the two pages to temporary files and run /usr/bin/diff over them. Then again, maybe not. */ |
// load pages |
$pageA = $this->LoadPageById($_REQUEST["a"]); |
$pageB = $this->LoadPageById($_REQUEST["b"]); |
// prepare bodies |
$bodyA = explode("\n", $pageA["body"]); |
$bodyB = explode("\n", $pageB["body"]); |
$added = array_diff($bodyA, $bodyB); |
$deleted = array_diff($bodyB, $bodyA); |
$output .= "<b>Comparaison de <a href=\"".$this->href("", "", "time=".urlencode($pageA["time"]))."\">".$pageA["time"]."</a> à <a href=\"".$this->href("", "", "time=".urlencode($pageB["time"]))."\">".$pageB["time"]."</a></b><br />\n"; |
if ($added) |
{ |
// remove blank lines |
$output .= "<br />\n<b>Ajouts:</b><br />\n"; |
$output .= "<div class=\"additions\">".$this->Format(implode("\n", $added))."</div>"; |
} |
if ($deleted) |
{ |
$output .= "<br />\n<b>Suppressions:</b><br />\n"; |
$output .= "<div class=\"deletions\">".$this->Format(implode("\n", $deleted))."</div>"; |
} |
if (!$added && !$deleted) |
{ |
$output .= "<br />\nPas de différences."; |
} |
echo $output; |
} |
else { |
// load pages |
$pageA = $this->LoadPageById($_REQUEST["b"]); |
$pageB = $this->LoadPageById($_REQUEST["a"]); |
// extract text from bodies |
$textA = $pageA["body"]; |
$textB = $pageB["body"]; |
$sideA = new Side($textA); |
$sideB = new Side($textB); |
$bodyA=''; |
$sideA->split_file_into_words($bodyA); |
$bodyB=''; |
$sideB->split_file_into_words($bodyB); |
// diff on these two file |
$diff = new Diff(split("\n",$bodyA),split("\n",$bodyB)); |
// format output |
$fmt = new DiffFormatter(); |
$sideO = new Side($fmt->format($diff)); |
$resync_left=0; |
$resync_right=0; |
$count_total_right=$sideB->getposition() ; |
$sideA->init(); |
$sideB->init(); |
$output=''; |
while (1) { |
$sideO->skip_line(); |
if ($sideO->isend()) { |
break; |
} |
if ($sideO->decode_directive_line()) { |
$argument=$sideO->getargument(); |
$letter=$sideO->getdirective(); |
switch ($letter) { |
case 'a': |
$resync_left = $argument[0]; |
$resync_right = $argument[2] - 1; |
break; |
case 'd': |
$resync_left = $argument[0] - 1; |
$resync_right = $argument[2]; |
break; |
case 'c': |
$resync_left = $argument[0] - 1; |
$resync_right = $argument[2] - 1; |
break; |
} |
$sideA->skip_until_ordinal($resync_left); |
$sideB->copy_until_ordinal($resync_right,$output); |
// deleted word |
if (($letter=='d') || ($letter=='c')) { |
$sideA->copy_whitespace($output); |
$output .="@@"; |
$sideA->copy_word($output); |
$sideA->copy_until_ordinal($argument[1],$output); |
$output .="@@"; |
} |
// inserted word |
if ($letter == 'a' || $letter == 'c') { |
$sideB->copy_whitespace($output); |
$output .="££"; |
$sideB->copy_word($output); |
$sideB->copy_until_ordinal($argument[3],$output); |
$output .="££"; |
} |
} |
} |
$sideB->copy_until_ordinal($count_total_right,$output); |
$sideB->copy_whitespace($output); |
$out=$this->Format($output); |
echo $out; |
} |
} |
else{ |
echo "<i>Vous n'êtes pas autorisé à lire cette page.</i>" ; |
} |
// Side : a string for wdiff |
class Side { |
var $position; |
var $cursor; |
var $content; |
var $character; |
var $directive; |
var $argument; |
var $length; |
function Side($content) { |
$this->content=$content; |
$this->position=0; |
$this->cursor=0; |
$this->directive=''; |
$this->argument=array(); |
$this->length=strlen($this->content); |
$this->character=substr($this->content,0,1); |
} |
function getposition() { |
return $this->position; |
} |
function getcharacter() { |
return $this->character; |
} |
function getdirective() { |
return $this->directive; |
} |
function getargument() { |
return $this->argument; |
} |
function nextchar() { |
$this->cursor++; |
$this->character=substr($this->content,$this->cursor,1); |
} |
function copy_until_ordinal($ordinal,&$out) { |
while ($this->position < $ordinal) { |
$this->copy_whitespace($out); |
$this->copy_word($out); |
} |
} |
function skip_until_ordinal($ordinal) { |
while ($this->position < $ordinal) { |
$this->skip_whitespace(); |
$this->skip_word(); |
} |
} |
function split_file_into_words (&$out) { |
while (!$this->isend()) { |
$this->skip_whitespace(); |
if ($this->isend()) { |
break; |
} |
$this->copy_word($out); |
$out .="\n"; |
} |
} |
function init() { |
$this->position=0; |
$this->cursor=0; |
$this->directive=''; |
$this->argument=array(); |
$this->character=substr($this->content,0,1); |
} |
function isspace($char) { |
if (ereg('[[:space:]]',$char)) { |
return true; |
} |
else { |
return false; |
} |
} |
function isdigit($char) { |
if (ereg('[[:digit:]]',$char)) { |
return true; |
} |
else { |
return false; |
} |
} |
function isend() { |
if (($this->cursor)>=($this->length)) { |
return true; |
} |
else { |
return false; |
} |
} |
function copy_whitespace(&$out) { |
while (!$this->isend() && $this->isspace($this->character)) { |
$out .=$this->character; |
$this->nextchar(); |
} |
} |
function skip_whitespace() { |
while (!$this->isend() && $this->isspace($this->character)) { |
$this->nextchar(); |
} |
} |
function skip_line() { |
while (!$this->isend() && !$this->isdigit($this->character)) { |
while (!$this->isend() && $this->character!="\n") |
$this->nextchar(); |
if($this->character=="\n") |
$this->nextchar(); |
} |
} |
function copy_word(&$out) { |
while (!$this->isend() && !($this->isspace($this->character))) { |
$out.=$this->character; |
$this->nextchar(); |
} |
$this->position++; |
} |
function skip_word() { |
while (!$this->isend() && !($this->isspace($this->character))) { |
$this->nextchar(); |
} |
$this->position++; |
} |
function decode_directive_line() { |
$value=0; |
$state=0; |
$error=0; |
while (!$error && $state < 4) { |
if ($this->isdigit($this->character)) { |
$value = 0; |
while($this->isdigit($this->character)) { |
$value = 10 * $value + $this->character - '0'; |
$this->nextchar(); |
} |
} |
else if ($state != 1 && $state != 3) |
$error = 1; |
/* Assign the proper value. */ |
$this->argument[$state] = $value; |
/* Skip the following character. */ |
switch ($state) { |
case 0: |
case 2: |
if ($this->character == ',') |
$this->nextchar(); |
break; |
case 1: |
if ($this->character == 'a' || $this->character == 'd' || $this->character == 'c') { |
$this->directive = $this->character; |
$this->nextchar(); |
} |
else |
$error = 1; |
break; |
case 3: |
if ($this->character != "\n") |
$error = 1; |
break; |
} |
$state++; |
} |
/* Complete reading of the line and return success value. */ |
while ((!$this->isend()) && ($this->character != "\n")) { |
$this->nextchar(); |
} |
if ($this->character == "\n") |
$this->nextchar(); |
return !$error; |
} |
} |
// difflib |
// |
// A PHP diff engine for phpwiki. |
// |
// Copyright (C) 2000, 2001 Geoffrey T. Dairiki <dairiki@dairiki.org> |
// You may copy this code freely under the conditions of the GPL. |
// |
// PHP3 does not have assert() |
define('USE_ASSERTS', function_exists('assert')); |
class _DiffOp { |
var $type; |
var $orig; |
var $final; |
function norig() { |
return $this->orig ? sizeof($this->orig) : 0; |
} |
function nfinal() { |
return $this->final ? sizeof($this->final) : 0; |
} |
} |
class _DiffOp_Copy extends _DiffOp { |
var $type = 'copy'; |
function _DiffOp_Copy ($orig, $final = false) { |
if (!is_array($final)) |
$final = $orig; |
$this->orig = $orig; |
$this->final = $final; |
} |
} |
class _DiffOp_Delete extends _DiffOp { |
var $type = 'delete'; |
function _DiffOp_Delete ($lines) { |
$this->orig = $lines; |
$this->final = false; |
} |
} |
class _DiffOp_Add extends _DiffOp { |
var $type = 'add'; |
function _DiffOp_Add ($lines) { |
$this->final = $lines; |
$this->orig = false; |
} |
} |
class _DiffOp_Change extends _DiffOp { |
var $type = 'change'; |
function _DiffOp_Change ($orig, $final) { |
$this->orig = $orig; |
$this->final = $final; |
} |
} |
/** |
* Class used internally by Diff to actually compute the diffs. |
* |
* The algorithm used here is mostly lifted from the perl module |
* Algorithm::Diff (version 1.06) by Ned Konz, which is available at: |
* http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip |
* |
* More ideas are taken from: |
* http://www.ics.uci.edu/~eppstein/161/960229.html |
* |
* Some ideas are (and a bit of code) are from from analyze.c, from GNU |
* diffutils-2.7, which can be found at: |
* ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz |
* |
* Finally, some ideas (subdivision by NCHUNKS > 2, and some optimizations) |
* are my own. |
* |
* @author Geoffrey T. Dairiki |
* @access private |
*/ |
class _DiffEngine |
{ |
function diff ($from_lines, $to_lines) { |
$n_from = sizeof($from_lines); |
$n_to = sizeof($to_lines); |
$this->xchanged = $this->ychanged = array(); |
$this->xv = $this->yv = array(); |
$this->xind = $this->yind = array(); |
unset($this->seq); |
unset($this->in_seq); |
unset($this->lcs); |
// Skip leading common lines. |
for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) { |
if ($from_lines[$skip] != $to_lines[$skip]) |
break; |
$this->xchanged[$skip] = $this->ychanged[$skip] = false; |
} |
// Skip trailing common lines. |
$xi = $n_from; $yi = $n_to; |
for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) { |
if ($from_lines[$xi] != $to_lines[$yi]) |
break; |
$this->xchanged[$xi] = $this->ychanged[$yi] = false; |
} |
// Ignore lines which do not exist in both files. |
for ($xi = $skip; $xi < $n_from - $endskip; $xi++) |
$xhash[$from_lines[$xi]] = 1; |
for ($yi = $skip; $yi < $n_to - $endskip; $yi++) { |
$line = $to_lines[$yi]; |
if ( ($this->ychanged[$yi] = empty($xhash[$line])) ) |
continue; |
$yhash[$line] = 1; |
$this->yv[] = $line; |
$this->yind[] = $yi; |
} |
for ($xi = $skip; $xi < $n_from - $endskip; $xi++) { |
$line = $from_lines[$xi]; |
if ( ($this->xchanged[$xi] = empty($yhash[$line])) ) |
continue; |
$this->xv[] = $line; |
$this->xind[] = $xi; |
} |
// Find the LCS. |
$this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); |
// Merge edits when possible |
$this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged); |
$this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged); |
// Compute the edit operations. |
$edits = array(); |
$xi = $yi = 0; |
while ($xi < $n_from || $yi < $n_to) { |
USE_ASSERTS && assert($yi < $n_to || $this->xchanged[$xi]); |
USE_ASSERTS && assert($xi < $n_from || $this->ychanged[$yi]); |
// Skip matching "snake". |
$copy = array(); |
while ( $xi < $n_from && $yi < $n_to |
&& !$this->xchanged[$xi] && !$this->ychanged[$yi]) { |
$copy[] = $from_lines[$xi++]; |
++$yi; |
} |
if ($copy) |
$edits[] = new _DiffOp_Copy($copy); |
// Find deletes & adds. |
$delete = array(); |
while ($xi < $n_from && $this->xchanged[$xi]) |
$delete[] = $from_lines[$xi++]; |
$add = array(); |
while ($yi < $n_to && $this->ychanged[$yi]) |
$add[] = $to_lines[$yi++]; |
if ($delete && $add) |
$edits[] = new _DiffOp_Change($delete, $add); |
elseif ($delete) |
$edits[] = new _DiffOp_Delete($delete); |
elseif ($add) |
$edits[] = new _DiffOp_Add($add); |
} |
return $edits; |
} |
/* Divide the Largest Common Subsequence (LCS) of the sequences |
* [XOFF, XLIM) and [YOFF, YLIM) into NCHUNKS approximately equally |
* sized segments. |
* |
* Returns (LCS, PTS). LCS is the length of the LCS. PTS is an |
* array of NCHUNKS+1 (X, Y) indexes giving the diving points between |
* sub sequences. The first sub-sequence is contained in [X0, X1), |
* [Y0, Y1), the second in [X1, X2), [Y1, Y2) and so on. Note |
* that (X0, Y0) == (XOFF, YOFF) and |
* (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM). |
* |
* This function assumes that the first lines of the specified portions |
* of the two files do not match, and likewise that the last lines do not |
* match. The caller must trim matching lines from the beginning and end |
* of the portions it is going to specify. |
*/ |
function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks) { |
$flip = false; |
if ($xlim - $xoff > $ylim - $yoff) { |
// Things seems faster (I'm not sure I understand why) |
// when the shortest sequence in X. |
$flip = true; |
list ($xoff, $xlim, $yoff, $ylim) |
= array( $yoff, $ylim, $xoff, $xlim); |
} |
if ($flip) |
for ($i = $ylim - 1; $i >= $yoff; $i--) |
$ymatches[$this->xv[$i]][] = $i; |
else |
for ($i = $ylim - 1; $i >= $yoff; $i--) |
$ymatches[$this->yv[$i]][] = $i; |
$this->lcs = 0; |
$this->seq[0]= $yoff - 1; |
$this->in_seq = array(); |
$ymids[0] = array(); |
$numer = $xlim - $xoff + $nchunks - 1; |
$x = $xoff; |
for ($chunk = 0; $chunk < $nchunks; $chunk++) { |
if ($chunk > 0) |
for ($i = 0; $i <= $this->lcs; $i++) |
$ymids[$i][$chunk-1] = $this->seq[$i]; |
$x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks); |
for ( ; $x < $x1; $x++) { |
$line = $flip ? $this->yv[$x] : $this->xv[$x]; |
if (empty($ymatches[$line])) |
continue; |
$matches = $ymatches[$line]; |
reset($matches); |
while (list ($junk, $y) = each($matches)) |
if (empty($this->in_seq[$y])) { |
$k = $this->_lcs_pos($y); |
USE_ASSERTS && assert($k > 0); |
$ymids[$k] = $ymids[$k-1]; |
break; |
} |
while (list ($junk, $y) = each($matches)) { |
if ($y > $this->seq[$k-1]) { |
USE_ASSERTS && assert($y < $this->seq[$k]); |
// Optimization: this is a common case: |
// next match is just replacing previous match. |
$this->in_seq[$this->seq[$k]] = false; |
$this->seq[$k] = $y; |
$this->in_seq[$y] = 1; |
} |
else if (empty($this->in_seq[$y])) { |
$k = $this->_lcs_pos($y); |
USE_ASSERTS && assert($k > 0); |
$ymids[$k] = $ymids[$k-1]; |
} |
} |
} |
} |
$seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff); |
$ymid = $ymids[$this->lcs]; |
for ($n = 0; $n < $nchunks - 1; $n++) { |
$x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks); |
$y1 = $ymid[$n] + 1; |
$seps[] = $flip ? array($y1, $x1) : array($x1, $y1); |
} |
$seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim); |
return array($this->lcs, $seps); |
} |
function _lcs_pos ($ypos) { |
$end = $this->lcs; |
if ($end == 0 || $ypos > $this->seq[$end]) { |
$this->seq[++$this->lcs] = $ypos; |
$this->in_seq[$ypos] = 1; |
return $this->lcs; |
} |
$beg = 1; |
while ($beg < $end) { |
$mid = (int)(($beg + $end) / 2); |
if ( $ypos > $this->seq[$mid] ) |
$beg = $mid + 1; |
else |
$end = $mid; |
} |
USE_ASSERTS && assert($ypos != $this->seq[$end]); |
$this->in_seq[$this->seq[$end]] = false; |
$this->seq[$end] = $ypos; |
$this->in_seq[$ypos] = 1; |
return $end; |
} |
/* Find LCS of two sequences. |
* |
* The results are recorded in the vectors $this->{x,y}changed[], by |
* storing a 1 in the element for each line that is an insertion |
* or deletion (ie. is not in the LCS). |
* |
* The subsequence of file 0 is [XOFF, XLIM) and likewise for file 1. |
* |
* Note that XLIM, YLIM are exclusive bounds. |
* All line numbers are origin-0 and discarded lines are not counted. |
*/ |
function _compareseq ($xoff, $xlim, $yoff, $ylim) { |
// Slide down the bottom initial diagonal. |
while ($xoff < $xlim && $yoff < $ylim |
&& $this->xv[$xoff] == $this->yv[$yoff]) { |
++$xoff; |
++$yoff; |
} |
// Slide up the top initial diagonal. |
while ($xlim > $xoff && $ylim > $yoff |
&& $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) { |
--$xlim; |
--$ylim; |
} |
if ($xoff == $xlim || $yoff == $ylim) |
$lcs = 0; |
else { |
// This is ad hoc but seems to work well. |
//$nchunks = sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); |
//$nchunks = max(2,min(8,(int)$nchunks)); |
$nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1; |
list ($lcs, $seps) |
= $this->_diag($xoff,$xlim,$yoff, $ylim,$nchunks); |
} |
if ($lcs == 0) { |
// X and Y sequences have no common subsequence: |
// mark all changed. |
while ($yoff < $ylim) |
$this->ychanged[$this->yind[$yoff++]] = 1; |
while ($xoff < $xlim) |
$this->xchanged[$this->xind[$xoff++]] = 1; |
} |
else { |
// Use the partitions to split this problem into subproblems. |
reset($seps); |
$pt1 = $seps[0]; |
while ($pt2 = next($seps)) { |
$this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]); |
$pt1 = $pt2; |
} |
} |
} |
/* Adjust inserts/deletes of identical lines to join changes |
* as much as possible. |
* |
* We do something when a run of changed lines include a |
* line at one end and has an excluded, identical line at the other. |
* We are free to choose which identical line is included. |
* `compareseq' usually chooses the one at the beginning, |
* but usually it is cleaner to consider the following identical line |
* to be the "change". |
* |
* This is extracted verbatim from analyze.c (GNU diffutils-2.7). |
*/ |
function _shift_boundaries ($lines, &$changed, $other_changed) { |
$i = 0; |
$j = 0; |
USE_ASSERTS && assert('sizeof($lines) == sizeof($changed)'); |
$len = sizeof($lines); |
$other_len = sizeof($other_changed); |
while (1) { |
/* |
* Scan forwards to find beginning of another run of changes. |
* Also keep track of the corresponding point in the other file. |
* |
* Throughout this code, $i and $j are adjusted together so that |
* the first $i elements of $changed and the first $j elements |
* of $other_changed both contain the same number of zeros |
* (unchanged lines). |
* Furthermore, $j is always kept so that $j == $other_len or |
* $other_changed[$j] == false. |
*/ |
while ($j < $other_len && $other_changed[$j]) |
$j++; |
while ($i < $len && ! $changed[$i]) { |
USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]'); |
$i++; $j++; |
while ($j < $other_len && $other_changed[$j]) |
$j++; |
} |
if ($i == $len) |
break; |
$start = $i; |
// Find the end of this run of changes. |
while (++$i < $len && $changed[$i]) |
continue; |
do { |
/* |
* Record the length of this run of changes, so that |
* we can later determine whether the run has grown. |
*/ |
$runlength = $i - $start; |
/* |
* Move the changed region back, so long as the |
* previous unchanged line matches the last changed one. |
* This merges with previous changed regions. |
*/ |
while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) { |
$changed[--$start] = 1; |
$changed[--$i] = false; |
while ($start > 0 && $changed[$start - 1]) |
$start--; |
USE_ASSERTS && assert('$j > 0'); |
while ($other_changed[--$j]) |
continue; |
USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]'); |
} |
/* |
* Set CORRESPONDING to the end of the changed run, at the last |
* point where it corresponds to a changed run in the other file. |
* CORRESPONDING == LEN means no such point has been found. |
*/ |
$corresponding = $j < $other_len ? $i : $len; |
/* |
* Move the changed region forward, so long as the |
* first changed line matches the following unchanged one. |
* This merges with following changed regions. |
* Do this second, so that if there are no merges, |
* the changed region is moved forward as far as possible. |
*/ |
while ($i < $len && $lines[$start] == $lines[$i]) { |
$changed[$start++] = false; |
$changed[$i++] = 1; |
while ($i < $len && $changed[$i]) |
$i++; |
USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]'); |
$j++; |
if ($j < $other_len && $other_changed[$j]) { |
$corresponding = $i; |
while ($j < $other_len && $other_changed[$j]) |
$j++; |
} |
} |
} while ($runlength != $i - $start); |
/* |
* If possible, move the fully-merged run of changes |
* back to a corresponding run in the other file. |
*/ |
while ($corresponding < $i) { |
$changed[--$start] = 1; |
$changed[--$i] = 0; |
USE_ASSERTS && assert('$j > 0'); |
while ($other_changed[--$j]) |
continue; |
USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]'); |
} |
} |
} |
} |
/** |
* Class representing a 'diff' between two sequences of strings. |
*/ |
class Diff |
{ |
var $edits; |
/** |
* Constructor. |
* Computes diff between sequences of strings. |
* |
* @param $from_lines array An array of strings. |
* (Typically these are lines from a file.) |
* @param $to_lines array An array of strings. |
*/ |
function Diff($from_lines, $to_lines) { |
$eng = new _DiffEngine; |
$this->edits = $eng->diff($from_lines, $to_lines); |
} |
} |
/** |
* A class to format Diffs |
* |
* This class formats the diff in classic diff format. |
* It is intended that this class be customized via inheritance, |
* to obtain fancier outputs. |
*/ |
class DiffFormatter |
{ |
/** |
* Format a diff. |
* |
* @param $diff object A Diff object. |
* @return string The formatted output. |
*/ |
function format($diff) { |
$xi = $yi = 1; |
$block = false; |
$context = array(); |
$this->_start_diff(); |
foreach ($diff->edits as $edit) { |
if ($edit->type == 'copy') { |
if (is_array($block)) { |
if (sizeof($edit->orig) <= 0) { |
$block[] = $edit; |
} |
else{ |
$this->_block($x0, + $xi - $x0, |
$y0, + $yi - $y0, |
$block); |
$block = false; |
} |
} |
} |
else { |
if (! is_array($block)) { |
$x0 = $xi; |
$y0 = $yi; |
$block = array(); |
} |
$block[] = $edit; |
} |
if ($edit->orig) |
$xi += sizeof($edit->orig); |
if ($edit->final) |
$yi += sizeof($edit->final); |
} |
if (is_array($block)) |
$this->_block($x0, $xi - $x0, |
$y0, $yi - $y0, |
$block); |
return $this->_end_diff(); |
} |
function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) { |
$this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen)); |
} |
function _start_diff() { |
ob_start(); |
} |
function _end_diff() { |
$val = ob_get_contents(); |
ob_end_clean(); |
return $val; |
} |
function _block_header($xbeg, $xlen, $ybeg, $ylen) { |
if ($xlen > 1) |
$xbeg .= "," . ($xbeg + $xlen - 1); |
if ($ylen > 1) |
$ybeg .= "," . ($ybeg + $ylen - 1); |
return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; |
} |
function _start_block($header) { |
echo $header."\n"; |
} |
} |
?> |
</div> |
<?php echo $this->Footer(); ?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/handlers/page/raw.php |
---|
New file |
0,0 → 1,45 |
<?php |
/* |
raw.php |
Copyright 2002 David DELON |
Copyright 2003 Eric FELDSTEIN |
Copyright 2003 Charles NEPOTE |
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 |
*/ |
//vérification de sécurité |
if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) { |
die ("accès direct interdit"); |
} |
if ($this->HasAccess("read")) |
{ |
if (!$this->page) |
{ |
return; |
} |
else |
{ |
header("Content-type: text/plain"); |
// display raw page |
echo $this->page["body"]; |
} |
} |
else |
{ |
return; |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/LICENSE |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/client/integrateur_wikini/bibliotheque/wikini/LICENSE |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/client/integrateur_wikini/bibliotheque/wikini/wakka.php |
---|
New file |
0,0 → 1,829 |
<?php |
/* encoding: iso-8859-1 |
wakka.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2003 Carlo Zottmann |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003, 2004 Charles NÉPOTE |
Copyright 2002, 2003 Patrick PAUL |
Copyright 2003 Éric DELORD |
Copyright 2003 Éric FELDSTEIN |
Copyright 2004 Jean-Christophe ANDRÉ |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* |
Yes, most of the formatting used in this file is HORRIBLY BAD STYLE. However, |
most of the action happens outside of this file, and I really wanted the code |
to look as small as what it does. Basically. Oh, I just suck. :) |
*/ |
// do not change this line, you fool. In fact, don't change anything! Ever! |
define("WAKKA_VERSION", "0.1.1"); |
define("WIKINI_VERSION", "0.4.3"); |
// start the compute time |
list($g_usec, $g_sec) = explode(" ",microtime()); |
define ("t_start", (float)$g_usec + (float)$g_sec); |
$t_SQL=0; |
class Wiki |
{ |
var $dblink; |
var $page; |
var $tag; |
var $parameter = array(); |
var $queryLog = array(); |
var $interWiki = array(); |
var $VERSION; |
var $CookiePath = '/'; |
// constructor |
function Wiki($config) |
{ |
$this->config = $config; |
// some host do not allow mysql_pconnect |
$this->dblink = @mysql_connect ( |
$this->config["mysql_host"], |
$this->config["mysql_user"], |
$this->config["mysql_password"]); |
if ($this->dblink) |
{ |
if (!@mysql_select_db($this->config["mysql_database"], $this->dblink)) |
{ |
@mysql_close($this->dblink); |
$this->dblink = false; |
} |
} |
$this->VERSION = WAKKA_VERSION; |
//determine le chemin pour le cookie |
$a = parse_url($this->GetConfigValue('base_url')); |
$this->CookiePath = dirname($a['path']); |
if ($this->CookiePath != '/') $this->CookiePath .= '/'; |
} |
// DATABASE |
function Query($query) |
{ |
if($this->GetConfigValue("debug")) $start = $this->GetMicroTime(); |
if (!$result = mysql_query($query, $this->dblink)) |
{ |
ob_end_clean(); |
die("Query failed: ".$query." (".mysql_error().")"); |
} |
if($this->GetConfigValue("debug")) |
{ |
$time = $this->GetMicroTime() - $start; |
$this->queryLog[] = array( |
"query" => $query, |
"time" => $time); |
} |
return $result; |
} |
function LoadSingle($query) { if ($data = $this->LoadAll($query)) return $data[0]; } |
function LoadAll($query) |
{ |
$data=array(); |
if ($r = $this->Query($query)) |
{ |
while ($row = mysql_fetch_assoc($r)) $data[] = $row; |
mysql_free_result($r); |
} |
return $data; |
} |
// MISC |
function GetMicroTime() { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } |
function IncludeBuffered($filename, $notfoundText = "", $vars = "", $path = "") |
{ |
if ($path) $dirs = explode(":", $path); |
else $dirs = array(""); |
foreach($dirs as $dir) |
{ |
if ($dir) $dir .= "/"; |
$fullfilename = $dir.$filename; |
if (file_exists($fullfilename)) |
{ |
if (is_array($vars)) extract($vars); |
ob_start(); |
include($fullfilename); |
$output = ob_get_contents(); |
ob_end_clean(); |
return $output; |
} |
} |
if ($notfoundText) return $notfoundText; |
else return false; |
} |
// VARIABLES |
function GetPageTag() { return $this->tag; } |
function GetPageTime() { return $this->page["time"]; } |
function GetMethod() { return $this->method; } |
function GetConfigValue($name) { return $this->config[$name]; } |
function GetWakkaName() { return $this->GetConfigValue("wakka_name"); } |
function GetWakkaVersion() { return $this->VERSION; } |
function GetWikiNiVersion() { return WIKINI_VERSION; } |
// PAGES |
function LoadPage($tag, $time = "", $cache = 1) { |
// retrieve from cache |
if (!$time && $cache && ($cachedPage = $this->GetCachedPage($tag))) { $page = $cachedPage;} |
// load page |
if (!isset($page)) $page = $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where tag = '".mysql_escape_string($tag)."' ".($time ? "and time = '".mysql_escape_string($time)."'" : "and latest = 'Y'")." limit 1"); |
// cache result |
if (!$time) $this->CachePage($page); |
return $page; |
} |
function GetCachedPage($tag) {return (isset($this->pageCache[$tag]) ? $this->pageCache[$tag] : ''); } |
function CachePage($page) { $this->pageCache[$page["tag"]] = $page; } |
function SetPage($page) { $this->page = $page; if ($this->page["tag"]) $this->tag = $this->page["tag"]; } |
function LoadPageById($id) { return $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where id = '".mysql_escape_string($id)."' limit 1"); } |
function LoadRevisions($page) { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where tag = '".mysql_escape_string($page)."' order by time desc"); } |
function LoadPagesLinkingTo($tag) { return $this->LoadAll("select from_tag as tag from ".$this->config["table_prefix"]."links where to_tag = '".mysql_escape_string($tag)."' order by tag"); } |
function LoadRecentlyChanged($limit=50) { |
$limit= (int) $limit; |
if ($pages = $this->LoadAll("select tag, time, user, owner from ".$this->config["table_prefix"]."pages where latest = 'Y' and comment_on = '' order by time desc limit $limit")) |
{ |
foreach ($pages as $page) |
{ |
$this->CachePage($page); |
} |
return $pages; |
} |
} |
function LoadAllPages() { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where latest = 'Y' order by tag"); } |
function FullTextSearch($phrase) { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where latest = 'Y' and match(tag, body) against('".mysql_escape_string($phrase)."')"); } |
function LoadWantedPages() { return $this->LoadAll("select distinct ".$this->config["table_prefix"]."links.to_tag as tag,count(".$this->config["table_prefix"]."links.from_tag) as count from ".$this->config["table_prefix"]."links left join ".$this->config["table_prefix"]."pages on ".$this->config["table_prefix"]."links.to_tag = ".$this->config["table_prefix"]."pages.tag where ".$this->config["table_prefix"]."pages.tag is NULL group by tag order by count desc"); } |
function LoadOrphanedPages() { return $this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages left join ".$this->config["table_prefix"]."links on ".$this->config["table_prefix"]."pages.tag = ".$this->config["table_prefix"]."links.to_tag where ".$this->config["table_prefix"]."links.to_tag is NULL and ".$this->config["table_prefix"]."pages.comment_on = '' order by tag"); } |
function IsOrphanedPage($tag) { return $this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages left join ".$this->config["table_prefix"]."links on ".$this->config["table_prefix"]."pages.tag = ".$this->config["table_prefix"]."links.to_tag where ".$this->config["table_prefix"]."links.to_tag is NULL and ".$this->config["table_prefix"]."pages.comment_on ='' and tag='".mysql_escape_string($tag)."'"); } |
function DeleteOrphanedPage($tag) { |
$this->Query("delete from ".$this->config["table_prefix"]."pages where tag='".mysql_escape_string($tag)."' "); |
$this->Query("delete from ".$this->config["table_prefix"]."links where from_tag='".mysql_escape_string($tag)."' "); |
$this->Query("delete from ".$this->config["table_prefix"]."acls where page_tag='".mysql_escape_string($tag)."' "); |
$this->Query("delete from ".$this->config["table_prefix"]."referrers where page_tag='".mysql_escape_string($tag)."' "); |
} |
function SavePage($tag, $body, $comment_on = "") { |
// get current user |
$user = $this->GetUserName(); |
//die($tag); |
// TODO: check write privilege |
if ($this->HasAccess("write", $tag)) |
{ |
// is page new? |
if (!$oldPage = $this->LoadPage($tag)) |
{ |
// create default write acl. store empty write ACL for comments. |
$this->SaveAcl($tag, "write", ($comment_on ? "" : $this->GetConfigValue("default_write_acl"))); |
// create default read acl |
$this->SaveAcl($tag, "read", $this->GetConfigValue("default_read_acl")); |
// create default comment acl. |
$this->SaveAcl($tag, "comment", $this->GetConfigValue("default_comment_acl")); |
// current user is owner; if user is logged in! otherwise, no owner. |
if ($this->GetUser()) $owner = $user; |
} |
else |
{ |
// aha! page isn't new. keep owner! |
$owner = $oldPage["owner"]; |
} |
// set all other revisions to old |
$this->Query("update ".$this->config["table_prefix"]."pages set latest = 'N' where tag = '".mysql_Escape_string($tag)."'"); |
// add new revision |
$this->Query("insert into ".$this->config["table_prefix"]."pages set ". |
"tag = '".mysql_escape_string($tag)."', ". |
($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : ""). |
"time = now(), ". |
"owner = '".mysql_escape_string($owner)."', ". |
"user = '".mysql_escape_string($user)."', ". |
"latest = 'Y', ". |
"body = '".mysql_escape_string(chop($body))."'"); |
} |
} |
function PurgePages() { |
if ($days = $this->GetConfigValue("pages_purge_time")) { |
// Selection of pages which can be deleted |
$pages = $this->LoadAll("select distinct tag, time from ".$this->config["table_prefix"]."pages where time < date_sub(now(), interval '".mysql_escape_string($days)."' day) and latest = 'N' order by time asc"); |
foreach ($pages as $page) { |
// Deletion if there are more than 2 versions avalaible (TODO : parameter ?) |
$tags=$this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages where tag = '".mysql_escape_string($page[tag])."' group by tag having count(*) > 2 order by tag"); |
foreach ($tags as $tag) { |
$this->Query("delete from ".$this->config["table_prefix"]."pages where time = '".mysql_escape_string($page[time])."' and tag = '".mysql_escape_string($tag[tag])."'"); |
} |
} |
} |
} |
// COOKIES |
function SetSessionCookie($name, $value) { SetCookie($name, $value, 0, $this->CookiePath); $_COOKIE[$name] = $value; } |
function SetPersistentCookie($name, $value, $remember = 0) { SetCookie($name, $value, time() + ($remember ? 90*24*60*60 : 60 * 60), $this->CookiePath); $_COOKIE[$name] = $value; } |
function DeleteCookie($name) { SetCookie($name, "", 1, $this->CookiePath); $_COOKIE[$name] = ""; } |
function GetCookie($name) { return $_COOKIE[$name]; } |
// HTTP/REQUEST/LINK RELATED |
function SetMessage($message) { $_SESSION["message"] = $message; } |
function GetMessage() |
{ |
if (isset($_SESSION["message"])) $message = $_SESSION["message"]; |
else $message = ""; |
$_SESSION["message"] = ""; |
return $message; |
} |
function Redirect($url) |
{ |
header("Location: $url"); |
exit; |
} |
// returns just PageName[/method]. |
function MiniHref($method = "", $tag = "") |
{ |
if (!$tag = trim($tag)) $tag = $this->tag; |
return $tag.($method ? "/".$method : ""); |
} |
// returns the full url to a page/method. |
function Href($method = "", $tag = "", $params = "") |
{ |
$href = $this->config["base_url"].$this->MiniHref($method, $tag); |
if ($params) |
{ |
$href .= ($this->config["rewrite_mode"] ? "?" : "&").$params; |
} |
return $href; |
} |
function Link($tag, $method = "", $text = "", $track = 1) { |
$tag=htmlspecialchars($tag); //avoid xss |
$text=htmlspecialchars($text); //paranoiac again |
if (!$text) $text = $tag; |
// is this an interwiki link? |
if (preg_match("/^([A-Z][A-Z,a-z]+)[:]([A-Z,a-z,0-9]*)$/s", $tag, $matches)) |
{ |
$tag = $this->GetInterWikiUrl($matches[1], $matches[2]); |
return "<a href=\"$tag\">$text (interwiki)</a>"; |
} |
// is this a full link? ie, does it contain non alpha-numeric characters? |
// Note : [:alnum:] is equivalent [0-9A-Za-z] |
// [^[:alnum:]] means : some caracters other than [0-9A-Za-z] |
// For example : "www.adress.com", "mailto:adress@domain.com", "http://www.adress.com" |
else if (preg_match("/[^[:alnum:]]/", $tag)) |
{ |
// check for email addresses |
if (preg_match("/^.+\@.+$/", $tag)) |
{ |
$tag = "mailto:".$tag; |
} |
// check for protocol-less URLs |
else if (!preg_match("/:\/\//", $tag)) |
{ |
$tag = "http://".$tag; //Very important for xss (avoid javascript:() hacking) |
} |
// is this an inline image (text!=tag and url ends png,gif,jpeg) |
if ($text!=$tag and preg_match("/.(gif|jpeg|png|jpg)$/i",$tag)) |
{ |
return "<img src=\"$tag\" alt=\"$text\" />"; |
} |
else |
{ |
return "<a href=\"$tag\">$text</a>"; |
} |
} |
else |
{ |
// it's a Wiki link! |
if (isset($_SESSION["linktracking"]) && $track) $this->TrackLinkTo($tag); |
return ($this->LoadPage($tag) ? "<a href=\"".$this->href($method, $tag)."\">".$text."</a>" : "<span class=\"missingpage\">".$text."</span><a href=\"".$this->href("edit", $tag)."\">?</a>"); |
} |
} |
function ComposeLinkToPage($tag, $method = "", $text = "", $track = 1) { |
if (!$text) $text = $tag; |
$text = htmlentities($text); |
if (isset($_SESSION["linktracking"]) && $track) |
$this->TrackLinkTo($tag); |
return '<a href="'.$this->href($method, $tag).'">'.$text.'</a>'; |
} |
// function PregPageLink($matches) { return $this->Link($matches[1]); } |
function IsWikiName($text) { return preg_match("/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/", $text); } |
function TrackLinkTo($tag) { $_SESSION["linktable"][] = $tag; } |
function GetLinkTable() { return $_SESSION["linktable"]; } |
function ClearLinkTable() { $_SESSION["linktable"] = array(); } |
function StartLinkTracking() { $_SESSION["linktracking"] = 1; } |
function StopLinkTracking() { $_SESSION["linktracking"] = 0; } |
function WriteLinkTable() { |
// delete old link table |
$this->Query("delete from ".$this->config["table_prefix"]."links where from_tag = '".mysql_escape_string($this->GetPageTag())."'"); |
if ($linktable = $this->GetLinkTable()) |
{ |
$from_tag = mysql_escape_string($this->GetPageTag()); |
foreach ($linktable as $to_tag) |
{ |
$lower_to_tag = strtolower($to_tag); |
if (!$written[$lower_to_tag]) |
{ |
$this->Query("insert into ".$this->config["table_prefix"]."links set from_tag = '".$from_tag."', to_tag = '".mysql_escape_string($to_tag)."'"); |
$written[$lower_to_tag] = 1; |
} |
} |
} |
} |
function Header() { return $this->Action($this->GetConfigValue("header_action"), 1); } |
function Footer() { return $this->Action($this->GetConfigValue("footer_action"), 1); } |
// FORMS |
function FormOpen($method = "", $tag = "", $formMethod = "post") { |
$result = "<form action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n"; |
if (!$this->config["rewrite_mode"]) $result .= "<input type=\"hidden\" name=\"wiki\" value=\"".$this->MiniHref($method, $tag)."\" />\n"; |
return $result; |
} |
function FormClose() { |
return "</form>\n"; |
} |
// INTERWIKI STUFF |
function ReadInterWikiConfig() { |
if ($lines = file("interwiki.conf")) |
{ |
foreach ($lines as $line) |
{ |
if ($line = trim($line)) |
{ |
list($wikiName, $wikiUrl) = explode(" ", trim($line)); |
$this->AddInterWiki($wikiName, $wikiUrl); |
} |
} |
} |
} |
function AddInterWiki($name, $url) { |
$this->interWiki[$name] = $url; |
} |
function GetInterWikiUrl($name, $tag) { |
if (isset($this->interWiki[$name])) |
{ |
return $this->interWiki[$name].$tag; |
} else { |
return 'http://'.$tag; //avoid xss by putting http:// in front of JavaScript:() |
} |
} |
// REFERRERS |
function LogReferrer($tag = "", $referrer = "") { |
// fill values |
if (!$tag = trim($tag)) $tag = $this->GetPageTag(); |
if (!$referrer = trim($referrer) AND isset($_SERVER["HTTP_REFERER"])) $referrer = $_SERVER["HTTP_REFERER"]; |
// check if it's coming from another site |
if ($referrer && !preg_match("/^".preg_quote($this->GetConfigValue("base_url"), "/")."/", $referrer)) |
{ |
$this->Query("insert into ".$this->config["table_prefix"]."referrers set ". |
"page_tag = '".mysql_escape_string($tag)."', ". |
"referrer = '".mysql_escape_string($referrer)."', ". |
"time = now()"); |
} |
} |
function LoadReferrers($tag = "") { |
return $this->LoadAll("select referrer, count(referrer) as num from ".$this->config["table_prefix"]."referrers ".($tag = trim($tag) ? "where page_tag = '".mysql_escape_string($tag)."'" : "")." group by referrer order by num desc"); |
} |
function PurgeReferrers() { |
if ($days = $this->GetConfigValue("referrers_purge_time")) { |
$this->Query("delete from ".$this->config["table_prefix"]."referrers where time < date_sub(now(), interval '".mysql_escape_string($days)."' day)"); |
} |
} |
// PLUGINS |
function Action($action, $forceLinkTracking = 0) |
{ |
$action = trim($action); $vars=array(); |
// stupid attributes check |
if ((stristr($action, "=\"")) || (stristr($action, "/"))) |
{ |
// extract $action and $vars_temp ("raw" attributes) |
preg_match("/^([A-Za-z0-9]*)\/?(.*)$/", $action, $matches); |
list(, $action, $vars_temp) = $matches; |
// match all attributes (key and value) |
$this->parameter[$vars_temp]=$vars_temp; |
preg_match_all("/([A-Za-z0-9]*)=\"(.*)\"/U", $vars_temp, $matches); |
// prepare an array for extract() to work with (in $this->IncludeBuffered()) |
if (is_array($matches)) |
{ |
for ($a = 0; $a < count($matches[1]); $a++) |
{ |
$vars[$matches[1][$a]] = $matches[2][$a]; |
$this->parameter[$matches[1][$a]]=$matches[2][$a]; |
} |
} |
} |
if (!$forceLinkTracking) $this->StopLinkTracking(); |
$result = $this->IncludeBuffered(strtolower($action).".php", "<i>Action inconnue \"$action\"</i>", $vars, $this->config["action_path"]); |
$this->StartLinkTracking(); |
if (isset($parameter)) unset($this->parameter[$parameter]); |
unset($this->parameter); |
return $result; |
} |
function Method($method) { |
if (!$handler = $this->page["handler"]) $handler = "page"; |
$methodLocation = $handler."/".$method.".php"; |
return $this->IncludeBuffered($methodLocation, "<i>Méthode inconnue \"$methodLocation\"</i>", "", $this->config["handler_path"]); |
} |
function Format($text, $formatter = "wakka") { |
return $this->IncludeBuffered("formatters/".$formatter.".php", "<i>Impossible de trouver le formateur \"$formatter\"</i>", compact("text")); |
} |
// USERS |
function LoadUser($name, $password = 0) { return $this->LoadSingle("select * from ".$this->config["table_prefix"]."users where name = '".mysql_escape_string($name)."' ".($password === 0 ? "" : "and password = '".mysql_escape_string($password)."'")." limit 1"); } |
function LoadUsers() { return $this->LoadAll("select * from ".$this->config["table_prefix"]."users order by name"); } |
function GetUserName() { if ($user = $this->GetUser()) $name = $user["name"]; else if (!$name = gethostbyaddr($_SERVER["REMOTE_ADDR"])) $name = $_SERVER["REMOTE_ADDR"]; return $name; } |
function UserName() { /* deprecated! */ return $this->GetUserName(); } |
function GetUser() { return (isset($_SESSION["user"]) ? $_SESSION["user"] : '');} |
function SetUser($user, $remember=0) { $_SESSION["user"] = $user; $this->SetPersistentCookie("name", $user["name"], $remember); $this->SetPersistentCookie("password", $user["password"], $remember); $this->SetPersistentCookie("remember", $remember, $remember); } |
function LogoutUser() { $_SESSION["user"] = ""; $this->DeleteCookie("name"); $this->DeleteCookie("password"); } |
function UserWantsComments() { if (!$user = $this->GetUser()) return false; return ($user["show_comments"] == "Y"); } |
function GetParameter($parameter, $default = '') { return (isset($this->parameter[$parameter]) ? $this->parameter[$parameter] : $default); } |
// COMMENTS |
function LoadComments($tag) { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where comment_on = '".mysql_escape_string($tag)."' and latest = 'Y' order by time"); } |
function LoadRecentComments() { return $this->LoadAll("select * from ".$this->config["table_prefix"]."pages where comment_on != '' and latest = 'Y' order by time desc"); } |
function LoadRecentlyCommented($limit = 50) { |
// NOTE: this is really stupid. Maybe my SQL-Fu is too weak, but apparently there is no easier way to simply select |
// all comment pages sorted by their first revision's (!) time. ugh! |
// load ids of the first revisions of latest comments. err, huh? |
$pages=array(); |
$comments=array(); |
if ($ids = $this->LoadAll("select min(id) as id from ".$this->config["table_prefix"]."pages where comment_on != '' group by tag order by id desc")) |
{ |
// load complete comments |
$num=0; |
foreach ($ids as $id) |
{ |
$comment = $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where id = '".$id["id"]."' limit 1"); |
if (!isset($comments[$comment["comment_on"]]) && $num < $limit) |
{ |
$comments[$comment["comment_on"]] = $comment; |
$num++; |
} |
} |
// now load pages |
if ($comments) |
{ |
// now using these ids, load the actual pages |
foreach ($comments as $comment) |
{ |
$page = $this->LoadPage($comment["comment_on"]); |
$page["comment_user"] = $comment["user"]; |
$page["comment_time"] = $comment["time"]; |
$page["comment_tag"] = $comment["tag"]; |
$pages[] = $page; |
} |
} |
} |
// load tags of pages |
//return $this->LoadAll("select comment_on as tag, max(time) as time, tag as comment_tag, user from ".$this->config["table_prefix"]."pages where comment_on != '' group by comment_on order by time desc"); |
return $pages; |
} |
// ACCESS CONTROL |
// returns true if logged in user is owner of current page, or page specified in $tag |
function UserIsOwner($tag = "") { |
// check if user is logged in |
if (!$this->GetUser()) return false; |
// set default tag |
if (!$tag = trim($tag)) $tag = $this->GetPageTag(); |
// check if user is owner |
if ($this->GetPageOwner($tag) == $this->GetUserName()) return true; |
} |
function GetPageOwner($tag = "", $time = "") { if (!$tag = trim($tag)) $tag = $this->GetPageTag(); if ($page = $this->LoadPage($tag, $time)) return $page["owner"]; } |
function SetPageOwner($tag, $user) { |
// check if user exists |
if (!$this->LoadUser($user)) return; |
// updated latest revision with new owner |
$this->Query("update ".$this->config["table_prefix"]."pages set owner = '".mysql_escape_string($user)."' where tag = '".mysql_escape_string($tag)."' and latest = 'Y' limit 1"); |
} |
function LoadAcl($tag, $privilege, $useDefaults = 1) { |
if ((!$acl = $this->LoadSingle("select * from ".$this->config["table_prefix"]."acls where page_tag = '".mysql_escape_string($tag)."' and privilege = '".mysql_escape_string($privilege)."' limit 1")) && $useDefaults) |
{ |
$acl = array("page_tag" => $tag, "privilege" => $privilege, "list" => $this->GetConfigValue("default_".$privilege."_acl")); |
} |
return $acl; |
} |
function SaveAcl($tag, $privilege, $list) { |
if ($this->LoadAcl($tag, $privilege, 0)) $this->Query("update ".$this->config["table_prefix"]."acls set list = '".mysql_escape_string(trim(str_replace("\r", "", $list)))."' where page_tag = '".mysql_escape_string($tag)."' and privilege = '".mysql_escape_string($privilege)."' limit 1"); |
else $this->Query("insert into ".$this->config["table_prefix"]."acls set list = '".mysql_escape_string(trim(str_replace("\r", "", $list)))."', page_tag = '".mysql_escape_string($tag)."', privilege = '".mysql_escape_string($privilege)."'"); |
} |
// returns true if $user (defaults to current user) has access to $privilege on $page_tag (defaults to current page) |
function HasAccess($privilege, $tag = "", $user = "") { |
// set defaults |
if (!$tag = trim($tag)) $tag = $this->GetPageTag(); |
if (!$user = $this->GetUserName()); |
// load acl |
$acl = $this->LoadAcl($tag, $privilege); |
// if current user is owner, return true. owner can do anything! |
if ($this->UserIsOwner($tag)) return true; |
// fine fine... now go through acl |
foreach (explode("\n", $acl["list"]) as $line) |
{ |
$line = trim($line); |
// check for inversion character "!" |
if (preg_match("/^[!](.*)$/", $line, $matches)) |
{ |
$negate = 1; |
$line = $matches[1]; |
} |
else |
{ |
$negate = 0; |
} |
// if there's still anything left... lines with just a "!" don't count! |
if ($line) |
{ |
switch ($line[0]) |
{ |
// comments |
case "#": |
break; |
// everyone |
case "*": |
return !$negate; |
// aha! a user entry. |
case "+": |
if (!$this->LoadUser($user)) |
{ |
return $negate; |
} |
else |
{ |
return !$negate; |
} |
default: |
if ($line == $user) |
{ |
return !$negate; |
} |
} |
} |
} |
// tough luck. |
return false; |
} |
// MAINTENANCE |
function Maintenance() { |
// purge referrers |
$this->PurgeReferrers(); |
// purge old page revisions |
$this->PurgePages(); |
} |
// THE BIG EVIL NASTY ONE! |
function Run($tag, $method = "") { |
if(!($this->GetMicroTime()%3)) $this->Maintenance(); |
$this->ReadInterWikiConfig(); |
// do our stuff! |
if (!$this->method = trim($method)) $this->method = "show"; |
if (!$this->tag = trim($tag)) $this->Redirect($this->href("", $this->config["root_page"])); |
if ((!$this->GetUser() && isset($_COOKIE["name"])) && ($user = $this->LoadUser($_COOKIE["name"], $_COOKIE["password"]))) $this->SetUser($user, $_COOKIE["remember"]); |
$this->SetPage($this->LoadPage($tag, (isset($_REQUEST["time"]) ? $_REQUEST["time"] :''))); |
$this->LogReferrer(); |
//correction pour un support plus facile de nouveaux handlers |
print($this->Method($this->method)); |
} |
} |
// stupid version check |
if (!isset($_REQUEST)) die('$_REQUEST[] not found. Wakka requires PHP 4.1.0 or higher!'); |
// workaround for the amazingly annoying magic quotes. |
function magicQuotesSuck(&$a) |
{ |
if (is_array($a)) |
{ |
foreach ($a as $k => $v) |
{ |
if (is_array($v)) |
magicQuotesSuck($a[$k]); |
else |
$a[$k] = stripslashes($v); |
} |
} |
} |
set_magic_quotes_runtime(0); |
if (get_magic_quotes_gpc()) |
{ |
magicQuotesSuck($_POST); |
magicQuotesSuck($_GET); |
magicQuotesSuck($_COOKIE); |
} |
// default configuration values |
$wakkaConfig= array(); |
$wakkaDefaultConfig = array( |
'wakka_version' => '', |
'wikini_version' => '', |
'debug' => 'no', |
"mysql_host" => "localhost", |
"mysql_database" => "wikini", |
"mysql_user" => "wikini", |
"mysql_password" => '', |
"table_prefix" => "wikini_", |
"root_page" => "PagePrincipale", |
"wakka_name" => "MonSiteWikiNi", |
"base_url" => "http://".$_SERVER["SERVER_NAME"].($_SERVER["SERVER_PORT"] != 80 ? ":".$_SERVER["SERVER_PORT"] : "").$_SERVER["REQUEST_URI"].(preg_match("/".preg_quote("wakka.php")."$/", $_SERVER["REQUEST_URI"]) ? "?wiki=" : ""), |
"rewrite_mode" => (preg_match("/".preg_quote("wakka.php")."$/", $_SERVER["REQUEST_URI"]) ? "0" : "1"), |
'meta_keywords' => '', |
'meta_description' => '', |
"action_path" => "actions", |
"handler_path" => "handlers", |
"header_action" => "header", |
"footer_action" => "footer", |
"navigation_links" => "DerniersChangements :: DerniersCommentaires :: ParametresUtilisateur", |
"referrers_purge_time" => 24, |
"pages_purge_time" => 90, |
"default_write_acl" => "*", |
"default_read_acl" => "*", |
"default_comment_acl" => "*", |
"preview_before_save" => "0"); |
// load config |
if (!$configfile = GetEnv("WAKKA_CONFIG")) $configfile = "wakka.config.php"; |
if (file_exists($configfile)) include($configfile); |
$wakkaConfigLocation = $configfile; |
$wakkaConfig = array_merge($wakkaDefaultConfig, $wakkaConfig); |
// check for locking |
if (file_exists("locked")) { |
// read password from lockfile |
$lines = file("locked"); |
$lockpw = trim($lines[0]); |
// is authentification given? |
if (isset($_SERVER["PHP_AUTH_USER"])) { |
if (!(($_SERVER["PHP_AUTH_USER"] == "admin") && ($_SERVER["PHP_AUTH_PW"] == $lockpw))) { |
$ask = 1; |
} |
} else { |
$ask = 1; |
} |
if ($ask) { |
header("WWW-Authenticate: Basic realm=\"".$wakkaConfig["wakka_name"]." Install/Upgrade Interface\""); |
header("HTTP/1.0 401 Unauthorized"); |
echo "Ce site est en cours de mise à jour. Veuillez essayer plus tard." ; |
exit; |
} |
} |
// compare versions, start installer if necessary |
if ($wakkaConfig["wakka_version"] && (!$wakkaConfig["wikini_version"])) { $wakkaConfig["wikini_version"]=$wakkaConfig["wakka_version"]; } |
if (($wakkaConfig["wakka_version"] != WAKKA_VERSION) || ($wakkaConfig["wikini_version"] != WIKINI_VERSION)) { |
// start installer |
if (!isset($_REQUEST["installAction"]) OR !$installAction = trim($_REQUEST["installAction"])) $installAction = "default"; |
include("setup/header.php"); |
if (file_exists("setup/".$installAction.".php")) include("setup/".$installAction.".php"); else echo "<i>Invalid action</i>" ; |
include("setup/footer.php"); |
exit; |
} |
// configuration du cookie de session |
//determine le chemin pour le cookie |
$a = parse_url($wakkaConfig['base_url']); |
$CookiePath = dirname($a['path']); |
if ($CookiePath != '/') $CookiePath .= '/'; |
$a = session_get_cookie_params(); |
session_set_cookie_params($a['lifetime'],$CookiePath); |
unset($a); |
unset($CookiePath); |
// start session |
session_start(); |
// fetch wakka location |
if (!isset($_REQUEST["wiki"])) $_REQUEST["wiki"] = ''; |
$wiki = $_REQUEST["wiki"]; |
// remove leading slash |
$wiki = preg_replace("/^\//", "", $wiki); |
// split into page/method |
if (preg_match("#^(.+?)/([A-Za-z0-9_]*)$#", $wiki, $matches)) list(, $page, $method) = $matches; |
else if (preg_match("#^(.*)$#", $wiki, $matches)) list(, $page) = $matches; |
// create wiki object |
$wiki = new Wiki($wakkaConfig); |
// check for database access |
if (!$wiki->dblink) |
{ |
echo "<p>Pour des raisons indépendantes de notre volonté, le contenu de ce Wiki est temporairement inaccessible. Veuillez réessayer ultérieurement, merci de votre compréhension.</p>"; |
exit; |
} |
function compress_output($output) |
{ |
return gzencode($output); |
} |
// Check if the browser supports gzip encoding, HTTP_ACCEPT_ENCODING |
if (strstr ($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) |
{ |
// Start output buffering, and register compress_output() (see |
// below) |
ob_start ("compress_output"); |
// Tell the browser the content is compressed with gzip |
header ("Content-Encoding: gzip"); |
} |
// go! |
if (!isset($method)) $method=''; |
// Security (quick hack) : Check method syntax |
if (!(preg_match('#^[A-Za-z0-9_]*$#',$method))) { |
$method=''; |
} |
$wiki->Run($page, $method); |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/wakka.basic.css |
---|
New file |
0,0 → 1,35 |
body { background-color: #F5F5F5; color: black; font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; } |
a { color: #993333; } |
body, p, td, li, input, select, textarea { font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 13px; } |
h1, h2, h3, h4, h5 { margin: 0px; padding: 0px; } |
ul { margin-top: 0px; padding-top: 0px; padding-bottom: 0px; } |
ol { margin-top: 0px; padding-top: 0px; padding-bottom: 0px; } |
form { margin: 0px; padding: 0px; } |
tt { color: Navy; } |
.error { color: #CC3333; font-weight: bold; } |
.indent { margin-left: 40px; } |
.additions { color: #008800; } |
.deletions { color: #880000; } |
.add { font-weight: bold; color:#c00; text-decoration: underline; } |
.del { font-style: italic; color:#c00; text-decoration: line-through; } |
.header { padding: 10px; padding-top: 0px; } |
.page { background-color: #FFFFFF; padding: 10px; border: 1px inset; } |
.prev_alert { background-color: red; color: white; font-size: 1.7em; font-weight: bold; margin-bottom: 5px; } |
.edit { width: 100%; height: 400px; } |
.footer { background-color: #DDDDDD;padding: 5px; border: 1px inset } |
.code { background: #FFFFFF; border: solid #888888 2px; font-family: 'Courier New', Courier; color: black; font-size: 10pt; width: 100%; overflow: scroll; padding: 3px; } |
.revisioninfo { color: #AAAAAA; padding-bottom: 20px; } |
.commentsheader { background-color: #DDDDDD; padding: 2px 10px; } |
.comment { background-color: #EEEEEE; padding: 10px; } |
.commentinfo { color: #AAAAAA; } |
.commentform { background-color: #EEEEEE; padding: 10px; } |
.copyright { font-size: 11px; color: #AAAAAA; text-align: right; } |
.copyright A { color: #AAAAAA; } |
.searchbox { background: #FFFFF8; border: 0px; padding: 0px; margin: 0px; } |
.debug { font-size: 11px; color: #888888; } |
/trunk/client/integrateur_wikini/bibliotheque/wikini/wakka.css |
---|
New file |
0,0 → 1,54 |
body { background-color: #F5F5F5; color: black; } |
body, p, td, li, input, select, textarea { font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.3; } |
h1, h2, h3, h4, h5 { margin: 0px; padding: 0px; } |
a { color: #993333; } |
ul { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } |
ol { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; } |
form { margin: 0px; padding: 0px; } |
tt { color: Navy; } |
hr { border: 0px; color: Black; /* Internet Explorer */ background-color: Black; height: 1px; } |
.wiki_name { float: left; margin: 0px 15px 0px 10px; font-size: 150%; } |
.page_name { font-size: 150%; } |
.error { color: #CC3333; font-weight: bold; } |
.indent { margin-left: 40px; } |
.additions { color: #008800; } |
.deletions { color: #880000; } |
.add { font-weight: bold; color: #c00; text-decoration: underline; } |
.del { font-style: italic; color: #c00; text-decoration: line-through; } |
.header { padding: 10px; padding-top: 0px } |
.page { background-color: #FFFFFF; padding: 10px; border: 1px inset; border-bottom: none; } |
.prev_alert { background-color: red; color: white; font-size: 1.7em; font-weight: bold; margin-bottom: 5px; } |
.edit { width: 100%; height: 400px; } |
.footer { background-color: #DDDDDD; padding: 5px 10px; border: 1px inset; border-top: none; border-top: 1px solid #CCCCCC } |
.code { background: #FFFFFF; border: solid #888888 2px; font-family: 'Courier New', Courier; color: black; font-size: 10pt; width: 100%; height: 400px; overflow: scroll; padding: 3px; } |
.revisioninfo { color: #AAAAAA; padding-bottom: 20px; } |
.commentsheader { background-color: #DDDDDD; padding: 2px 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC } |
.comment { background-color: #EEEEEE; padding: 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #EEEEEE; } |
.commentinfo { color: #AAAAAA; } |
.commentform { background-color: #EEEEEE; padding: 10px; border-left: 1px inset; border-right: 1px inset; border-top: 1px solid #CCCCCC } |
.copyright { font-size: 11px; color: #AAAAAA; text-align: right; } |
.copyright A { color: #AAAAAA; } |
.searchbox { background: #FFFFF8; border: 0px; border-bottom: 1px solid #CCCCAA; padding: 0px; margin: 0px; } |
.debug { font-size: 11px; color: #888888; } |
.hr_clear { clear: both; visibility: hidden; } |
.include_right { float: right; width: 17%; } /* bloc flotant à droite */ |
.include_left { float: left; width: 17%; } /* bloc flotant à gauche */ |
.include_solid_border { border: solid; padding: 2px; } /* encadré noir */ |
.include_gray_background { background-color: #DDDDDD; } /* fond gris */ |
.include_small_fonts { font-size: 0.8em; } /* petites polices */ |
.include_big_fonts { font-size: 1.2em; } /* grandes polces */ |
.include_height10em { height: 10em; overflow: scroll; } /* boite de 10em de hauteur, avec ascenseur */ |
.include_height15em { height: 15em; overflow: scroll; } |
.include_height30em { height: 30em; overflow: scroll; } |
.include_height60em { height: 60em; overflow: scroll; } |
.trail_table { line-height: 30px;} |
.trail_button { color: #993333; } |
/trunk/client/integrateur_wikini/bibliotheque/wikini/INSTALL |
---|
New file |
0,0 → 1,25 |
Wakka / Wikini Installation |
Not much to it (as long as it works, ahem). Unpack/upload the distribution files |
into a directory that can be accessed via the web. Then go to the corresponding URL. |
A web-based installer will walk you through the rest. |
Example: |
If your website, say, http://www.mysite.com, is mapped to the directory /home/jdoe/www/, |
and you place the Wakka distribution files into /home/jdoe/www/wakka/, you should go to |
http://www.mysite.com/wakka/. |
Note that Wakka distributions normally unpack into directories that include the version |
in their name; you'll probably want to rename those to just "wakka" -- or, if you're |
on a unixoid system, set up a symbolic link. |
IMPORTANT: for installing or upgrading Wakka, do NOT access any of the files contained |
in the setup/ subdirectory. They're used by the web-based installer/updater, but you |
should really just access the Wakka directory itself, and it will (or at least should) |
work perfectly. |
Detailed instructions are available at <http://www.wakkawiki.com/WakkaInstallation>. |
- Hendrik Mans <hendrik@mans.de> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/formatters/coloration_php.php |
---|
New file |
0,0 → 1,30 |
<?php |
/* |
coloration_php.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
highlight_string($text) |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/formatters/hightlighter.class.inc |
---|
New file |
0,0 → 1,250 |
<?php |
/* |
* $Id: hightlighter.class.inc,v 1.1 2005-09-09 09:37:17 ddelon Exp $ |
* |
* Souligneur générique pour colorier la syntaxe de langage de programmation |
* |
* copyrigth Eric Feldstein 2004 mailto:garfield_fr@tiscali.fr |
* |
* Licence : la meme que wikini(voir le fichier LICENCE). |
* Vous êtes libre d'utiliser et de modifier ce code à condition de laisser le copyright |
* d'origine. Vous pouvez bien sur vous ajouter à la liste des auteurs. |
* |
* INSTALLATION : copier le fichier dans le repertoire "formatters" de WikiNi |
* UTILISATION : importer la classe dans le script de coloration |
* ATTRIBUTS DE LA CLASSE : |
* - isCaseSensitiv : booleen - indique si la syntaxe est sensible a la casse |
* - comment : array - tableau d'expressions regulieres definissant les commentaires multiligne |
* ex : array('({[^$][^}]*})', //commentaires: { ... } |
* '(\(\*[^$](.*)\*\))' //commentaires: (* ... *) |
* ); |
* - commentLine : array tableau d'expressions regulieres definissant les commentaires monoligne |
* ex : array('(//.*\n)'); //commentaire // |
* - commentStyle : string - style CSS inline a utiliser pour la coloration(utilisé dans une |
* balise <SPAN style="..."></SPAN>) |
* - directive : array - tableau d'expression reguliere pour definir les directive de |
* compilation |
* - directiveStyle : string - style CSS inline a utiliser pour la coloration |
* - string : array - tableau d'expression reguliere pour definir les chaine de caracteres |
* - stringStyle : string - style CSS inline a utiliser pour la coloration |
* - number : array - tableau d'expression reguliere pour definir les nombres |
* - numberStyle : string - style CSS inline a utiliser pour la coloration |
* - keywords : array - tableau asociatif contenant des tableaux de liste de mots avec leur style. Ex : |
* $oHightlighter->keywords['Liste1']['words'] = array('liste1mot1','liste1mot2','liste1mot3'); |
* $oHightlighter->keywords['Liste1']['style'] = 'color: red'; |
* $oHightlighter->keywords['Liste2']['words'] = array('liste2mot1','liste2mot2'); |
* $oHightlighter->keywords['Liste2']['style'] = 'color: yellow'; |
* chaque tableau keywords['...'] DOIT posseder les 2 clé 'words' et 'style'. |
* - symboles : array - tableau conteant la liste des symboles |
* - symbolesStyle : string - style CSS inline a utiliser pour la coloration |
* - identifier : array - tableau d'expression reguliere pour definir les identifiants |
* - identStyle : string - style CSS inline a utiliser pour la coloration |
* METHODE PUBLIQUE DE LA CLASSE : |
* - Analyse($text) : $text string Chaine a analyser |
* renvoie le texte colorié. |
* |
* NOTES IMPORTANTES |
* - Les expressions reguliere doivent être entre parenthèse capturante pour etre utilisé |
* dans une fonction de remplacement. Voir le fichier coloration_delphi.php pour un exemple |
* - Lorsque un style est defini à vide, l'expression reguliere n'est pas prise en compte dans |
* l'analyse. |
* - L'option de recherche est msU : multiligne, le . peut être un \n et la recherche |
* est 'not greedy' qui inverse la tendance à la gourmandise des expressions régulières. |
*/ |
class Hightlighter{ |
//sensibilite majuscule/minuscule |
var $isCaseSensitiv = false; |
//commentaires |
var $comment = array(); //commentaire multiligne |
var $commentLine = array(); //commentaire monoligne |
var $commentStyle = '';//'color: red'; |
//directives de compilation |
var $directive = array(); |
var $directiveStyle = '';//'color: green'; |
//chaine de caracteres |
var $string = array(); |
var $stringStyle = ''; |
//nombre |
var $number = array(); |
var $numberStyle = ''; |
//mots clé |
var $keywords = array(); |
//séparateurs |
var $symboles = array(); |
var $symbolesStyle = ''; |
//identifiant |
var $identifier = array(); |
var $identStyle = ''; |
//******************************************************* |
// Variable privées |
//******************************************************* |
var $_patOpt = 'msU'; //option de recherche |
var $_pattern = ''; //modele complet |
var $_commentPattern = ''; //modele des commentaires |
var $_directivePattern = '';//modele des directives |
var $_numberPattern = ''; //modele des nombres |
var $_stringPattern = ''; //modele des chaine de caracteres |
var $_keywordPattern = ''; //modele pour le mots cle |
var $_symbolesPattern = ''; //modele pour les symbole |
var $_separatorPattern = '';//modele pour les sparateurs |
var $_identPattern = ''; //modele pour les identifiants |
/******************************************************** |
Methodes de la classe |
*********************************************************/ |
/** |
* Renvoie le pattern pour les commentaires |
*/ |
function _getCommentPattern(){ |
$a = array_merge($this->commentLine,$this->comment); |
return implode('|',$a); |
} |
/** |
* Renvoie le pattern pour les directives de compilation |
*/ |
function _getDirectivePattern(){ |
return implode('|',$this->directive); |
} |
/** |
* Renvoie le pattern pour les chaine de caracteres |
*/ |
function _getStringPattern(){ |
return implode('|',$this->string); |
} |
/** |
* Renvoie le pattern pour les nombre |
*/ |
function _getNumberPattern(){ |
return implode('|',$this->number); |
} |
/** |
* Renvoie le pattern pour les mots clé |
*/ |
function _getKeywordPattern(){ |
$aResult = array(); |
foreach($this->keywords as $key=>$keyword){ |
$aResult = array_merge($aResult, $keyword['words']); |
$this->keywords[$key]['pattern'] = '\b'.implode('\b|\b',$keyword['words']).'\b'; |
} |
return '\b'.implode('\b|\b',$aResult).'\b'; |
} |
/** |
* Renvoie le pattern pour les symboles |
*/ |
function _getSymbolesPattern(){ |
$a = array(); |
foreach($this->symboles as $s){ |
$a[] = preg_quote($s,'`'); |
} |
return implode('|',$a); |
} |
/** |
* Renvoie le pattern pour les identifiants |
*/ |
function _getIdentifierPattern(){ |
return implode('|',$this->identifier); |
} |
/** |
* Liste des separateur d'apres la liste des symboles |
*/ |
function _getSeparatorPattern(){ |
$a = array_unique(preg_split('//', implode('',$this->symboles), -1, PREG_SPLIT_NO_EMPTY)); |
$pattern = '['.preg_quote(implode('',$a),'`').'\s]+'; |
return $pattern; |
} |
/** |
* Renvoie le modele a utiliser dans l'expression regulière |
* |
* @return string Modele de l'expression régulière |
*/ |
function _getPattern(){ |
$this->_separatorPattern = $this->_getSeparatorPattern(); |
$this->_symbolesPattern = $this->_getSymbolesPattern(); |
$this->_commentPattern = $this->_getCommentPattern(); |
$this->_directivePattern = $this->_getDirectivePattern(); |
$this->_stringPattern = $this->_getStringPattern(); |
$this->_numberPattern = $this->_getNumberPattern(); |
$this->_keywordPattern = $this->_getKeywordPattern(); |
$this->_identPattern = $this->_getIdentifierPattern(); |
//construction du modele globale en fonction de l'existance d'un style(optimisation) |
if($this->commentStyle){ $a[] = $this->_commentPattern; } |
if($this->directiveStyle){ $a[] = $this->_directivePattern; } |
if($this->stringStyle){ $a[] = $this->_stringPattern; } |
if($this->numberStyle){ $a[] = $this->_numberPattern; } |
if(count($this->keywords)>0){ $a[] = $this->_keywordPattern; } |
if($this->symbolesStyle){ $a[] = $this->_symbolesPattern; } |
if($this->identStyle){ $a[] = $this->_identPattern; } |
$this->_pattern = implode('|',$a); |
return $this->_pattern; |
} |
/** |
* Fonction de remplacement de chaque élement avec leur style. |
*/ |
function replacecallback($match){ |
$text = $match[0]; |
$pcreOpt = $this->_patOpt; |
$pcreOpt .= ($this->isCaseSensitiv)?'':'i'; |
//commentaires |
if($this->commentStyle){ |
if (preg_match('`'.$this->_commentPattern."`$pcreOpt",$text,$m)){ |
return "<span style=\"$this->commentStyle\">".$match[0].'</span>'; |
} |
} |
//directive de compilation |
if ($this->directiveStyle){ |
if (preg_match('`'.$this->_directivePattern."`$pcreOpt",$text,$m)){ |
return "<span style=\"$this->directiveStyle\">".$match[0].'</span>'; |
} |
} |
//chaine de caracteres |
if ($this->stringStyle){ |
if (preg_match('`'.$this->_stringPattern."`$pcreOpt",$text,$m)){ |
return "<span style=\"$this->stringStyle\">".$match[0].'</span>'; |
} |
} |
//nombres |
if ($this->numberStyle){ |
if (preg_match('`'.$this->_numberPattern."`$pcreOpt",$text,$m)){ |
return "<span style=\"$this->numberStyle\">".$match[0].'</span>'; |
} |
} |
//mot clé |
if (count($this->keywords)>0){ |
foreach($this->keywords as $key=>$keywords){ |
if ($keywords['style']){ |
if(preg_match('`'.$keywords['pattern']."`$pcreOpt",$text,$m)){ |
return "<span style=\"".$keywords['style']."\">".$match[0].'</span>'; |
} |
} |
} |
} |
//symboles |
if ($this->symbolesStyle){ |
if (preg_match('`'.$this->_symbolesPattern."`$pcreOpt",$text,$m)){ |
return "<span style=\"$this->symbolesStyle\">".$match[0].'</span>'; |
} |
} |
//identifiants |
if ($this->identStyle){ |
if (preg_match('`'.$this->_identPattern."`$pcreOpt",$text,$m)){ |
return "<span style=\"$this->identStyle\">".$match[0].'</span>'; |
} |
} |
return $match[0]; |
} |
/** |
* renvois le code colorié |
* |
* @param $text string Texte a analyser |
* @return string texte colorié |
*/ |
function Analyse($text){ |
$pattern = '`'.$this->_getPattern()."`$this->_patOpt"; |
if (!$this->isCaseSensitiv){ |
$pattern .= 'i'; |
} |
$text = preg_replace_callback($pattern,array($this,'replacecallback'),$text); |
return $text; |
} |
} //class Hightlighter |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/formatters/raw.php |
---|
New file |
0,0 → 1,31 |
<?php |
/* |
raw.php |
Copyright 2002, 2003 David DELON |
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 |
*/ |
if ($test=$_REQUEST["text"]) { |
echo ""; |
} |
else if ($lines = file($text)) { |
foreach ($lines as $line) { |
// To avoid loop:ignore inclusion of other raw link |
if (!(preg_match("/^\[\[\|(\S*)(\s+(.+))?\]\]$/", $line, $matches))) |
echo $line; |
} |
} |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/formatters/code.php |
---|
New file |
0,0 → 1,33 |
<pre> |
<?php |
/* |
code.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002 Charles NEPOTE |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
echo htmlentities($text)."\n"; |
?> |
</pre> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/formatters/action.php |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
action.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2003 David DELON |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
// This may look a bit strange, but all possible formatting tags have to be in a single regular expression for this to work correctly. Yup! |
if (!function_exists("wakka2callback")) |
{ |
function wakka2callback($things) |
{ |
$thing = $things[1]; |
global $wiki; |
// events |
if (preg_match("/^\{\{(.*?)\}\}$/s", $thing, $matches)) |
{ |
if ($matches[1]) |
return $wiki->Action($matches[1]); |
else |
return "{{}}"; |
} |
else if (preg_match("/^.*$/s", $thing, $matches)) |
{ |
return ""; |
} |
// if we reach this point, it must have been an accident. |
return $thing; |
} |
} |
$text = str_replace("\r", "", $text); |
$text = trim($text)."\n"; |
$text = preg_replace_callback( |
"/(\{\{.*?\}\}|.*)/msU", "wakka2callback", $text); |
echo $text ; |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/formatters/coloration_delphi.php |
---|
New file |
0,0 → 1,77 |
<?php |
/* |
* $Id: coloration_delphi.php,v 1.1 2005-09-09 09:37:17 ddelon Exp $ |
* |
* Souligneur syntaxique Delphi |
* |
* copyrigth Eric Feldstein 2003 2004 mailto:garfield_fr@tiscali.fr |
* |
* Licence : la meme que wikini (voir le fichier LICENCE). |
* Vous êtes libre d'utiliser et de modifier ce code à condition de laisser le copyright |
* d'origine. Vous pouvez bien sur vous ajouter à la liste des auteurs. |
* |
* Installation : copier le fichier dans le repertoire "formatters" de WikiNi |
*/ |
include_once('formatters/hightlighter.class.inc'); |
$DH = new Hightlighter(); |
$DH->isCaseSensitiv = false; |
//************* commentaires ************* |
$DH->comment = array('({[^$][^}]*})', //commentaires: { ... } |
'(\(\*[^$](.*)\*\))' //commentaires: (* ... *) |
); |
$DH->commentLine = array('(//.*\n)'); //commentaire // |
$DH->commentStyle = "color: red; font-style: italic"; //style CSS pour balise SPAN |
//************* directives de compilation ************* |
$DH->directive = array('({\\$[^{}]*})', //directive {$....} |
'(\(\*\\$(.*)\*\))' //directive (*$....*) |
); |
$DH->directiveStyle = "color: green"; //style CSS pour balise SPAN |
//************* chaines de caracteres ************* |
$DH->string = array("('[^']*')",'(#\d+)'); //chaine = 'xxxxxxxx' ou #23 |
$DH->stringStyle = "background: yellow"; |
//************* nombres ************* |
$DH->number[] = '(\b\d+(\.\d*)?([eE][+-]?\d+)?)'; //123 ou 123. ou 123.456 ou 123.E-34 ou 123.e-34 123.45E+34 ou 4e54 |
$DH->number[] = '(\$[0-9A-Fa-f]+\b)'; //ajout des nombres hexadecimaux : $AF |
$DH->numberStyle = 'color: blue'; |
//************* mots clé ************* |
$DH->keywords['MotCle']['words'] = array('absolute','abstract','and','array','as','asm', |
'begin', |
'case','class','const','constructor', |
'default','destructor','dispinterface','div','do','downto', |
'else','end','except','exports','external', |
'file','finalization','finally','for','function', |
'goto', |
'if','implementation','inherited','initialization','inline','interface','is', |
'label','library','loop','message', |
'mod', |
'nil','not', |
'object','of','or','out','overload','override', |
'packed','private','procedure','program','property','protected','public','published', |
'raise','read','record','repeat','resourcestring', |
'set','shl','shr','stdcall','string', |
'then','threadvar','to','try','type','unit','until', |
'use','uses', |
'var','virtual','while', |
'with','write', |
'xor' |
); |
$DH->keywords['MotCle']['style'] = 'font-weight: bold'; //style CSS pour balise SPAN |
//************* liste des symboles ************* |
$DH->symboles = array('#','$','&','(','(.',')','*','+',',','-','.','.)','..', |
'/',':',':=',';','<','<=','<>','=','>','>=','@','[',']','^'); |
$DH->symbolesStyle = ''; |
//************* identifiants ************* |
$DH->identifier = array('[_A-Za-z]?[_A-Za-z0-9]+'); |
$DH->identStyle = ''; |
echo "<pre>".$DH->Analyse($text)."</pre>"; |
unset($DH); |
?> |
/trunk/client/integrateur_wikini/bibliotheque/wikini/formatters/wakka.php |
---|
New file |
0,0 → 1,333 |
<?php |
/* |
wakka.php |
Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> |
Copyright 2002, 2003 David DELON |
Copyright 2002, 2003 Charles NEPOTE |
Copyright 2002, 2003 Patrick PAUL |
Copyright 2003 Eric DELORD |
Copyright 2003 Eric FELDSTEIN |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
1. Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
2. Redistributions in binary form must reproduce the above copyright |
notice, this list of conditions and the following disclaimer in the |
documentation and/or other materials provided with the distribution. |
3. The name of the author may not be used to endorse or promote products |
derived from this software without specific prior written permission. |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
// This may look a bit strange, but all possible formatting tags have to be in a single regular expression for this to work correctly. Yup! |
if (!function_exists("wakka2callback")) |
{ |
function wakka2callback($things) |
{ |
$thing = $things[1]; |
$result=''; |
static $oldIndentLevel = 0; |
static $oldIndentLength= 0; |
static $indentClosers = array(); |
static $newIndentSpace= array(); |
static $br = 1; |
$brf=0; |
global $wiki; |
// convert HTML thingies |
if ($thing == "<") |
return "<"; |
else if ($thing == ">") |
return ">"; |
// bold |
else if ($thing == "**") |
{ |
static $bold = 0; |
return (++$bold % 2 ? "<b>" : "</b>"); |
} |
// italic |
else if ($thing == "//") |
{ |
static $italic = 0; |
return (++$italic % 2 ? "<i>" : "</i>"); |
} |
// underlinue |
else if ($thing == "__") |
{ |
static $underline = 0; |
return (++$underline % 2 ? "<u>" : "</u>"); |
} |
// monospace |
else if ($thing == "##") |
{ |
static $monospace = 0; |
return (++$monospace % 2 ? "<tt>" : "</tt>"); |
} |
// Deleted |
else if ($thing == "@@") |
{ |
static $deleted = 0; |
return (++$deleted % 2 ? "<span class=\"del\">" : "</span>"); |
} |
// Inserted |
else if ($thing == "££") |
{ |
static $inserted = 0; |
return (++$inserted % 2 ? "<span class=\"add\">" : "</span>"); |
} |
// urls |
else if (preg_match("/^([a-z]+:\/\/\S+?)([^[:alnum:]^\/])?$/", $thing, $matches)) { |
$url = $matches[1]; |
if (!isset($matches[2])) $matches[2] = ''; |
return "<a href=\"$url\">$url</a>".$matches[2]; |
} |
// header level 5 |
else if ($thing == "==") |
{ |
static $l5 = 0; |
$br = 0; |
return (++$l5 % 2 ? "<h5>" : "</h5>"); |
} |
// header level 4 |
else if ($thing == "===") |
{ |
static $l4 = 0; |
$br = 0; |
return (++$l4 % 2 ? "<h4>" : "</h4>"); |
} |
// header level 3 |
else if ($thing == "====") |
{ |
static $l3 = 0; |
$br = 0; |
return (++$l3 % 2 ? "<h3>" : "</h3>"); |
} |
// header level 2 |
else if ($thing == "=====") |
{ |
static $l2 = 0; |
$br = 0; |
return (++$l2 % 2 ? "<h2>" : "</h2>"); |
} |
// header level 1 |
else if ($thing == "======") |
{ |
static $l1 = 0; |
$br = 0; |
return (++$l1 % 2 ? "<h1>" : "</h1>"); |
} |
// forced line breaks |
else if ($thing == "---") |
{ |
return "<br />"; |
} |
// escaped text |
else if (preg_match("/^\"\"(.*)\"\"$/s", $thing, $matches)) |
{ |
return $matches[1]; |
} |
// code text |
else if (preg_match("/^\%\%(.*)\%\%$/s", $thing, $matches)) |
{ |
// check if a language has been specified |
$code = $matches[1]; |
$language=''; |
if (preg_match("/^\((.+?)\)(.*)$/s", $code, $matches)) |
{ |
list(, $language, $code) = $matches; |
} |
//Select formatter for syntaxe hightlighting |
if (file_exists("formatters/coloration_".$language.".php")){ |
$formatter = "coloration_".$language; |
}else{ |
$formatter = "code"; |
} |
$output = "<div class=\"code\">"; |
$output .= $wiki->Format(trim($code), $formatter); |
$output .= "</div>"; |
return $output; |
} |
// raw inclusion from another wiki |
// (regexp documentation : see "forced link" below) |
else if (preg_match("/^\[\[\|(\S*)(\s+(.+))?\]\]$/", $thing, $matches)) |
{ |
list (,$url,,$text) = $matches; |
if (!$text) $text = "404"; |
if ($url) |
{ |
$url.="/wakka.php?wiki=".$text."/raw"; |
return $wiki->Format($wiki->Format($url, "raw"),"wakka"); |
} |
else |
{ |
return ""; |
} |
} |
// forced links |
// \S : any character that is not a whitespace character |
// \s : any whitespace character |
else if (preg_match("/^\[\[(\S*)(\s+(.+))?\]\]$/", $thing, $matches)) |
{ |
list (, $url, $text) = $matches; |
if ($url) |
{ |
if ($url!=($url=(preg_replace("/@@|££|\[\[/","",$url))))$result="</span>"; |
if (!$text) $text = $url; |
$text=preg_replace("/@@|££|\[\[/","",$text); |
return $result.$wiki->Link($url, "", $text); |
} |
else |
{ |
return ""; |
} |
} |
// indented text |
else if ((preg_match("/\n(\t+|([ ]{1})+)(-|([0-9,a-z,A-Z]+)\))?/s", $thing, $matches)) |
|| (preg_match("/^(\t+|([ ]{1})+)(-|([0-9,a-z,A-Z]+)\))?/s", $thing, $matches) && $brf=1)) |
{ |
// new line |
if ($brf) $br=0; |
$result .= ($br ? "<br />\n" : ""); |
// we definitely want no line break in this one. |
$br = 0; |
// find out which indent type we want |
if (!isset($matches[3])) $matches[3] = ''; |
$newIndentType = $matches[3]; |
if (!$newIndentType) { $opener = "<div class=\"indent\">"; $closer = "</div>"; $br = 1; } |
else if ($newIndentType == "-") { $opener = "<ul>\n"; $closer = "</li>\n</ul>"; $li = 1; } |
else { $opener = "<ol type=\"".$matches[4]."\">\n"; $closer = "</li>\n</ol>"; $li = 1; } |
// get new indent level |
if (strpos($matches[1],"\t")) $newIndentLevel = strlen($matches[1]); |
else |
{ |
$newIndentLevel=$oldIndentLevel; |
$newIndentLength = strlen($matches[1]); |
if ($newIndentLength>$oldIndentLength) |
{ |
$newIndentLevel++; |
$newIndentSpace[$newIndentLength]=$newIndentLevel; |
} |
else if ($newIndentLength<$oldIndentLength) |
$newIndentLevel=$newIndentSpace[$newIndentLength]; |
} |
$op=0; |
if ($newIndentLevel > $oldIndentLevel) |
{ |
for ($i = 0; $i < $newIndentLevel - $oldIndentLevel; $i++) |
{ |
$result .= $opener; |
$op=1; |
array_push($indentClosers, $closer); |
} |
} |
else if ($newIndentLevel < $oldIndentLevel) |
{ |
for ($i = 0; $i < $oldIndentLevel - $newIndentLevel; $i++) |
{ |
$op=1; |
$result .= array_pop($indentClosers); |
if ($oldIndentLevel && $li) $result .= "</li>"; |
} |
} |
if (isset($li) && $op) $result .= "<li>"; |
else if (isset($li)) |
$result .= "</li>\n<li>"; |
$oldIndentLevel = $newIndentLevel; |
$oldIndentLength= $newIndentLength; |
return $result; |
} |
// new lines |
else if ($thing == "\n") |
{ |
// if we got here, there was no tab in the next line; this means that we can close all open indents. |
$c = count($indentClosers); |
for ($i = 0; $i < $c; $i++) |
{ |
$result .= array_pop($indentClosers); |
$br = 0; |
} |
$oldIndentLevel = 0; |
$oldIndentLength= 0; |
$newIndentSpace=array(); |
$result .= ($br ? "<br />\n" : "\n"); |
$br = 1; |
return $result; |
} |
// events |
else if (preg_match("/^\{\{(.*?)\}\}$/s", $thing, $matches)) |
{ |
if ($matches[1]) |
return $wiki->Action($matches[1]); |
else |
return "{{}}"; |
} |
// interwiki links! |
else if (preg_match("/^[A-Z][A-Z,a-z]+[:]([A-Z,a-z,0-9]*)$/s", $thing)) |
{ |
return $wiki->Link($thing); |
} |
// wiki links! |
else if (preg_match("/^[A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*$/s", $thing)) |
{ |
return $wiki->Link($thing); |
} |
// separators |
else if (preg_match("/-{4,}/", $thing, $matches)) |
{ |
// TODO: This could probably be improved for situations where someone puts text on the same line as a separator. |
// Which is a stupid thing to do anyway! HAW HAW! Ahem. |
$br = 0; |
return "<hr />"; |
} |
// if we reach this point, it must have been an accident. |
return $thing; |
} |
} |
$text = str_replace("\r", "", $text); |
$text = chop($text)."\n"; |
$text = preg_replace_callback( |
"/(\%\%.*?\%\%|". |
"\"\".*?\"\"|". |
"\[\[.*?\]\]|". |
"\b[a-z]+:\/\/\S+|". |
"\*\*|\#\#|@@|££|__|<|>|\/\/|". |
"======|=====|====|===|==|". |
"-{4,}|---|". |
"\n(\t+|([ ]{1})+)(-|[0-9,a-z,A-Z]+\))?|". |
"^(\t+|([ ]{1})+)(-|[0-9,a-z,A-Z]+\))?|". |
"\{\{.*?\}\}|". |
"\b[A-Z][A-Z,a-z]+[:]([A-Z,a-z,0-9]*)\b|". |
"\b([A-Z][a-z]+[A-Z,0-9][A-Z,a-z,0-9]*)\b|". |
"\n)/ms", "wakka2callback", $text); |
// we're cutting the last <br /> |
$text = preg_replace("/<br \/>$/","", trim($text)); |
echo $text ; |
?> |
/trunk/client/integrateur_wikini/bibliotheque/adwi_wikini.fonct.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: adwi_wikini.fonct.php,v 1.3 2005-09-02 11:29:25 ddelon Exp $ |
// CVS : $Id: adwi_wikini.fonct.php,v 1.4 2005-09-09 09:37:17 ddelon Exp $ |
/** |
* Contient les fonctions de l'application gestion des Wikini |
* |
35,7 → 35,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
52,9 → 52,71 |
*/ |
function adwi_supprimer_wikini($id_wikini, &$db) { |
// Suppression enregistrement |
$valeur = adwi_valeurs_par_defaut($id_wikini,$db ); |
$requete = "delete from gen_wikini where gewi_id_wikini =$id_wikini" ; |
$resultat = $db->query ($requete) ; |
// Suppression tables Wikini ... |
include_once ADWI_CHEMIN_BIBLIOTHEQUE.'gestion_wikini.class.php' ; |
$g_wikini = new gestion_wikini($db); |
if ((!isset($valeur['table_prefix'])) || (empty($config_wikini['$valeur']))) { |
$valeur['table_prefix'] = $valeur['code_alpha_wikini']; |
} |
$g_wikini->suppression_tables ($valeur['table_prefix']); |
if (GEN_FTP_UTILISE) { |
/** Inclusion bibliothèque de PEAR gérant le FTP.*/ |
require_once ADWI_CHEMIN_BIBLIOTHEQUE_PEAR.'Net/FTP.php'; |
// création de l'objet pear ftp |
$objet_pear_ftp = new Net_FTP(PAP_FTP_SERVEUR, PAP_FTP_PORT); |
// création de la connexion |
$ftp_conn = $objet_pear_ftp->connect(PAP_FTP_SERVEUR, PAP_FTP_PORT); |
// identification |
$ftp_login_result = $objet_pear_ftp->login(PAP_FTP_UTILISATEUR, PAP_FTP_MOT_DE_PASSE); |
// Gestion des erreurs ftp |
if ((PEAR::isError($ftp_conn) || PEAR::isError($ftp_login_result))) { |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de se connecter par ftp.<br />'. |
'Serveur : '. PAP_FTP_SERVEUR .'<br />'. |
'Utilisateur : '. PAP_FTP_UTILISATEUR .'<br />'. |
'Erreur connexion : '.$ftp_conn->getMessage().'<br />'. |
'Erreur login : '.$ftp_login_result->getMessage().'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier n° : '. __FILE__ .'<br /><p>'; |
print $message; |
} |
$chemin_wikini = PAP_FTP_RACINE.ADWI_CHEMIN_WIKINI.$valeur['code_alpha_wikini'].GEN_SEP; |
$resultat = $objet_pear_ftp->rm($chemin_wikini, $chemin_wikini, true); |
if (PEAR::isError($resultat)) { |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de copier le wikini de reference par ftp.<br />'. |
'Wikini : '. $chemin_wikini .'<br />'. |
'Erreur origine : '. $resultat->getMessage() .'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier n° : '. __FILE__ .'<br /></p>'; |
print $message; |
} |
} |
// else { |
// Gestion sans FTP à faire |
//} |
} |
/** |
78,10 → 140,12 |
$resultat->free(); |
unset ($requete, $resultat); |
return adwi_valeurs_par_defaut($ligne->gewi_id_wikini,$db); |
} |
function adwi_valeurs_par_defaut($id_wikini, &$db) { |
// requete sur gen_wikin |
126,6 → 190,141 |
if (DB::isError ($resultat)) { |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ; |
} |
if (GEN_FTP_UTILISE) { |
/** Inclusion bibliothèque de PEAR gérant le FTP.*/ |
require_once ADWI_CHEMIN_BIBLIOTHEQUE_PEAR.'Net/FTP.php'; |
// création de l'objet pear ftp |
$objet_pear_ftp = new Net_FTP(PAP_FTP_SERVEUR, PAP_FTP_PORT); |
// création de la connexion |
$ftp_conn = $objet_pear_ftp->connect(PAP_FTP_SERVEUR, PAP_FTP_PORT); |
// identification |
$ftp_login_result = $objet_pear_ftp->login(PAP_FTP_UTILISATEUR, PAP_FTP_MOT_DE_PASSE); |
// Gestion des erreurs ftp |
if ((PEAR::isError($ftp_conn) || PEAR::isError($ftp_login_result))) { |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de se connecter par ftp.<br />'. |
'Serveur : '. PAP_FTP_SERVEUR .'<br />'. |
'Utilisateur : '. PAP_FTP_UTILISATEUR .'<br />'. |
'Erreur connexion : '.$ftp_conn->getMessage().'<br />'. |
'Erreur login : '.$ftp_login_result->getMessage().'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier n° : '. __FILE__ .'<br /><p>'; |
print $message; |
} |
$objet_pear_ftp->mkdir(PAP_FTP_RACINE.ADWI_CHEMIN_WIKINI.$valeur['code_alpha_wikini']) ; |
$chemin_wikini_bibliotheque = ADWI_CHEMIN_BIBLIOTHEQUE_WIKINI; |
$chemin_wikini = PAP_FTP_RACINE.ADWI_CHEMIN_WIKINI.$valeur['code_alpha_wikini'].GEN_SEP; |
$resultat = $objet_pear_ftp->putRecursive($chemin_wikini_bibliotheque, $chemin_wikini, false, FTP_BINARY); |
if (PEAR::isError($resultat)) { |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de copier le wikini de reference par ftp.<br />'. |
'Fichier origine : '. $chemin_wikini_bibliotheque .'<br />'. |
'Fichier copié : '. $chemin_wikini .'<br />'. |
'Erreur origine : '. $resultat->getMessage() .'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier n° : '. __FILE__ .'<br /></p>'; |
print $message; |
} |
} |
// else { |
// Gestion sans FTP à faire |
//} |
// Creation tables wikini |
include_once ADWI_CHEMIN_BIBLIOTHEQUE.'gestion_wikini.class.php' ; |
$g_wikini = new gestion_wikini($db); |
if ((!isset($valeur['table_prefix'])) || (empty($config_wikini['$valeur']))) { |
$valeur['table_prefix'] = $valeur['code_alpha_wikini']; |
} |
$g_wikini->creation_tables ($valeur['table_prefix']); |
// Creation Wakka.config.php |
$config_wikini = adwi_config_wikini($valeur['code_alpha_wikini'] ,$db ); |
$base_url=parse_url(PAP_URL); |
$dirname_base_url=dirname($base_url['path']); |
$config_base_url=$dirname_base_url.GEN_SEP.ADWI_CHEMIN_WIKINI.GEN_SEP.$config_wikini['code_alpha_wikini'].GEN_SEP."wakka.php?wiki="; |
$config_base_url = str_replace("//", "/", $config_base_url); |
$config = array( |
"wakka_version" => "0.1.1", |
"wikini_version" => "0.4.3", |
'mysql_host' => $config_wikini['bdd_hote'], |
'mysql_database' => $config_wikini['bdd_nom'], |
'mysql_user' => $config_wikini['bdd_utilisateur'], |
'mysql_password' => $config_wikini['bdd_mdp'], |
'table_prefix' => $config_wikini['table_prefix'], |
'root_page' => $config_wikini['page'], |
'wakka_name' => $config_wikini['code_alpha_wikini'], |
'base_url' => $config_base_url, |
'rewrite_mode' => '0', |
'meta_keywords' => '', |
'meta_description' => '', |
'action_path' => 'actions', |
'handler_path' => 'handlers', |
'header_action' => 'header', |
'footer_action' => 'footer', |
'navigation_links' => 'DerniersChangements :: DerniersCommentaires :: ParametresUtilisateur', |
'referrers_purge_time' => 24, |
'pages_purge_time' => 90, |
'default_write_acl' => '*', |
'default_read_acl' => '*', |
'default_comment_acl' => '*', |
'preview_before_save' => '0'); |
// convert config array into PHP code |
$configCode = "<?php\n// wakka.config.php créée ".strftime("%c")."\n// ne changez pas la wikini_version manuellement!\n\n\$wakkaConfig = array(\n"; |
foreach ($config as $k => $v) |
{ |
$entries[] = "\t\"".$k."\" => \"".$v."\""; |
} |
$configCode .= implode(",\n", $entries).");\n?>"; |
$tempfn = tempnam("",""); |
$temp = fopen($tempfn, "w"); |
fwrite($temp, $configCode); |
fclose($temp); |
$fichier_config_source = $tempfn; |
$fichier_config_cible = PAP_FTP_RACINE.ADWI_CHEMIN_WIKINI.$valeur['code_alpha_wikini'].GEN_SEP."wakka.config.php"; |
$resultat = $objet_pear_ftp->put($fichier_config_source, $fichier_config_cible, false, FTP_BINARY); |
if (PEAR::isError($resultat)) { |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de copier le wikini de reference par ftp.<br />'. |
'Fichier origine : '. $chemin_wikini_config .'<br />'. |
'Fichier copié : '. $chemin_wikini .'<br />'. |
'Erreur origine : '. $resultat->getMessage() .'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier n° : '. __FILE__ .'<br /></p>'; |
print $message; |
} |
$objet_pear_ftp->disconnect(); |
unlink($tempfn); |
} |
/** |
163,6 → 362,53 |
} |
function adwi_config_wikini($code_alpha_wikini,&$db) { |
$config_wikini = adwi_valeurs_par_code_alpha($code_alpha_wikini,$db ); |
// Parametres de base de donnée de Papyrus par défaut |
if ((!isset($config_wikini['bdd_hote'])) || (empty($config_wikini['bdd_hote']))) { |
$config_wikini['bdd_hote'] = PAP_BDD_SERVEUR; |
} |
if ((!isset($config_wikini['bdd_nom'])) || (empty($config_wikini['bdd_nom']))) { |
$config_wikini['bdd_nom'] = PAP_BDD_NOM; |
} |
if ((!isset($config_wikini['bdd_utilisateur'])) || (empty($config_wikini['bdd_utilisateur']))) { |
$config_wikini['bdd_utilisateur'] = PAP_BDD_UTILISATEUR; |
} |
if ((!isset($config_wikini['bdd_mdp'])) || (empty($config_wikini['bdd_mdp']))) { |
$config_wikini['bdd_mdp'] = PAP_BDD_MOT_DE_PASSE; |
} |
if ((!isset($config_wikini['table_prefix'])) || (empty($config_wikini['table_prefix']))) { |
$config_wikini['table_prefix'] = $code_alpha_wikini.'_'; |
} |
// Ordre de selection de la page de demarrage : |
// Page par defaut du Wiki enregistré |
// PagePrincipale |
if ((!isset($config_wikini['page'])) || (empty($config_wikini['page']))) { |
$config_wikini['page'] = 'PagePrincipale'; |
} |
/** Constante stockant le chemin du dossier contenant le site Wikini en cours */ |
if ((!isset($config_wikini['chemin'])) || (empty($config_wikini['chemin']))) { |
$config_wikini['chemin'] = GEN_CHEMIN_WIKINI.$config_wikini['code_alpha_wikini'].GEN_SEP; |
} |
return $config_wikini; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
171,6 → 417,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2005/09/02 11:29:25 ddelon |
* Integrateur Wikini et administration des Wikini |
* |
* Revision 1.2 2005/08/31 17:34:52 ddelon |
* Integrateur Wikini et administration des Wikini |
* |
/trunk/client/integrateur_wikini/bibliotheque/gestion_wikini.class.php |
---|
New file |
0,0 → 1,182 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library 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.1 of the License, or (at your option) any later version. | |
// | | |
// | This library 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 library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: gestion_wikini.class.php,v 1.1 2005-09-09 09:37:17 ddelon Exp $ |
/** |
* Application projet |
* |
* La classe gestion_wikini |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* class gestion_wikini |
* |
*/ |
class gestion_wikini |
{ |
/*** Attributes: ***/ |
/** |
* Un objet PEAR::DB |
* @access private |
*/ |
var $_db; |
/** |
* Constructeur |
* |
* @param DB objetDB Une référence vers un objet PEAR:DB |
* @return void |
* @access public |
*/ |
function gestion_wikini( &$objetDB ) |
{ |
$this->_db = $objetDB ; |
} // end of member function gestion_wikini |
/** |
* |
* |
* @param string prefixe Le préfixe des tables. |
* @return void |
* @access public |
*/ |
function creation_tables( $prefixe ) |
{ |
// Connection à la base de donnée de wikini |
$prefixe .= '_' ; |
$this->_db->query( |
"CREATE TABLE ".$prefixe."pages (". |
"id int(10) unsigned NOT NULL auto_increment,". |
"tag varchar(50) NOT NULL default '',". |
"time datetime NOT NULL default '0000-00-00 00:00:00',". |
"body text NOT NULL,". |
"body_r text NOT NULL,". |
"owner varchar(50) NOT NULL default '',". |
"user varchar(50) NOT NULL default '',". |
"latest enum('Y','N') NOT NULL default 'N',". |
"handler varchar(30) NOT NULL default 'page',". |
"comment_on varchar(50) NOT NULL default '',". |
"PRIMARY KEY (id),". |
"FULLTEXT KEY tag (tag,body),". |
"KEY idx_tag (tag),". |
"KEY idx_time (time),". |
"KEY idx_latest (latest),". |
"KEY idx_comment_on (comment_on)". |
") TYPE=MyISAM;"); |
$this->_db->query( |
"CREATE TABLE ".$prefixe."acls (". |
"page_tag varchar(50) NOT NULL default '',". |
"privilege varchar(20) NOT NULL default '',". |
"list text NOT NULL,". |
"PRIMARY KEY (page_tag,privilege)". |
") TYPE=MyISAM"); |
$this->_db->query( |
"CREATE TABLE ".$prefixe."links (". |
"from_tag char(50) NOT NULL default '',". |
"to_tag char(50) NOT NULL default '',". |
"UNIQUE KEY from_tag (from_tag,to_tag),". |
"KEY idx_from (from_tag),". |
"KEY idx_to (to_tag)". |
") TYPE=MyISAM"); |
$this->_db->query( |
"CREATE TABLE ".$prefixe."referrers (". |
"page_tag char(50) NOT NULL default '',". |
"referrer char(150) NOT NULL default '',". |
"time datetime NOT NULL default '0000-00-00 00:00:00',". |
"KEY idx_page_tag (page_tag),". |
"KEY idx_time (time)". |
") TYPE=MyISAM"); |
$this->_db->query( |
"CREATE TABLE ".$prefixe."users (". |
"name varchar(80) NOT NULL default '',". |
"password varchar(32) NOT NULL default '',". |
"email varchar(50) NOT NULL default '',". |
"motto text NOT NULL,". |
"revisioncount int(10) unsigned NOT NULL default '20',". |
"changescount int(10) unsigned NOT NULL default '50',". |
"doubleclickedit enum('Y','N') NOT NULL default 'Y',". |
"signuptime datetime NOT NULL default '0000-00-00 00:00:00',". |
"show_comments enum('Y','N') NOT NULL default 'N',". |
"PRIMARY KEY (name),". |
"KEY idx_name (name),". |
"KEY idx_signuptime (signuptime)". |
") TYPE=MyISAM"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'PagePrincipale', body = '".mysql_escape_string("====== Bienvenue ! sur le Wikini de ce groupe de travail ======\nEnfin, vous pourrez cliquer sur le lien \"Editer cette page\" au bas de la page pour rédiger.\n\n----\n\n\n\n\n\n\n----\n===== Pages utiles =====\n -[[TableauDeBord Tableau de bord de ce Wikini]]\n -[[ReglesDeFormatage Règles de formatage]]\n -[[BacASable Bac à sable]]")."', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'DerniersChangements', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n{{RecentChanges}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'DerniersCommentaires', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n{{RecentlyCommented}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'ParametresUtilisateur', body = '** Retour : ** [[PagePrincipale page principale]]\n----\n** Note : ** L\'idéal pour la création d\'un nom Wiki est d\'accoler son prénom et son nom de cette façon : \"PrenomNom\". \n----\n==== Mes paramètres ====\n\n{{UserSettings}}\n\n----\n', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'PagesACreer', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des pages à créer : ===\n\n{{WantedPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'PagesOrphelines', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des pages orphelines ===\n\n{{OrphanedPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'RechercheTexte', body = '** Retour : ** [[PagePrincipale Page principale]] > [[TableauDeBord Tableau de bord]]\n----\n{{TextSearch}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'ReglesDeFormatage', body = '** Retour : ** [[PagePrincipale Page principale]]\n----\n====== Guide des règles de formatage ======\n\nLes règles de formatage avec Wakka diffèrent légèrement des autres Wikis. (Voir par exemple [[http://c2.com/cgi/wiki?TextFormattingRules les règles de formatage de WikiWikiWeb]], le premier Wiki connu.)\nTout texte placé entre deux guillemets doubles - \" - est présenté tel que.\n\nVous pouvez effectuer vos propres tests dans le BacASable : c\'est un endroit fait pour ça.\n\n=== Règles de base : ===\n \"\"**Texte en gras !** -----\"\"> **Texte en gras !**\n \"\"//Texte en italique.// -----\"\"> //Texte en italique.//\n \"\"Texte __souligné__ ! -----\"\"> Texte __souligné__ !\n \"\"##texte à espacement fixe## -----\"\"> ##texte à espacement fixe##\n \"\"%%code%%\"\"\n \"\"%%(php) PHP code%%\"\"\n\n=== Liens forcés : ===\n \"\"[[http://www.mon-site.org]]\"\"\n \"\"[[http://www.mon-site.org Mon-site]]\"\"\n \"\"[[P2P]]\"\"\n \"\"[[P2P Page sur le P2P]]\"\"\n\n=== Liens dans Wikini ===\n Pour réaliser un lien dans wikini qui apparaisse avec un style normal utilisez cette écriture :\n \"\"[[ReglesDeFormatage Règles de Formatage]]\"\"\n Le lien apparaîtra de cette manière [[ReglesDeFormatage Règles de Formatage]].\n\n=== En-têtes : ===\n \"\"====== En-tête énorme ======\"\" ====== En-tête énorme ======\n \"\"===== En-tête très gros =====\"\" ===== En-tête très gros =====\n \"\"==== En-tête gros ====\"\" ==== En-tête gros ====\n \"\"=== En-tête normal ===\"\" === En-tête normal ===\n \"\"== Petit en-tête ==\"\" == Petit en-tête ==\n\n=== Séparateur horizontal : ===\n \"\"----\"\"\n\n=== Retour de ligne forcé : ===\n \"\"---\"\"\n=== Indentation : ===\nL\'indentation de textes se fait avec la touche \"TAB\". Vous pouvez aussi créer des listes à puces ou numérotées :\n \"\"- liste à puce\"\"\n \"\"1) liste numérotée (chiffres arabes)\"\"\n \"\"A) liste numérotée (capitales alphabétiques)\"\"\n \"\"a) liste numérotée (minuscules alphabétiques)\"\"\n \"\"i) liste numérotée (chiffres romains)\"\"\n\n=== Inclure une image ===\n\n - Pour inclure un lien sur une image (sans l\'inclure à la page):\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\"\"(ne pas indiquer de texte alternatif).\n Ce qui donne : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\n\n - Pour inclure une image sans indiquer de texte alternatif :\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\"\"(laisser 3 espaces blancs avant la fermeture des crochets).\n Ce qui donne quand l\'image est trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif]]\n Quand l\'image n\'est pas trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/table.gif]]\n\n - Pour inclure une image en indiquant un texte alternatif :\n \"\"[[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif une puce ]]\"\"\n Ce qui donne quand l\'image est trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/images/table.gif une puce ]]\n Quand l\'image n\'est pas trouvée : [[http://wiki.tela-botanica.org/eflore/bibliotheque/table.gif une puce ]]\n\n//Note :// le texte alternatif est affiché à la place de l\'image s\'il y a une erreur lors de l\'affichage de celle-ci.\n\n=== Outils avancés : ===\n\n \"\"{{Backlinks}}\"\" permet de créer un lien vers la page précédente. \n \"\"{{Listusers}}\"\" affiche la liste des utilisateurs du site wikini.\n \"\"{{OrphanedPages}}\"\" affiche les pages orphelines du site wikini.\n \"\"{{ListPages/tree}}\"\" affiche le plan du site wikini.\n \"\"{{pageindex}}\"\" affiche un index des pages du site classées par lettres alphabétiques.\n \"\"{{ListPages}}\"\" affiche un index des pages du site avec le nom de leur propriétaire.\n \"\"{{WantedPages}}\"\" affiche la liste des pages restant à créer. Elles apparaissent dans le site avec un ? à la suite de leur nom.\n \"\"{{RecentChanges}}\"\" affiche la liste des sites faisant référence au site wikini.\n \"\"{{RecentlyCommented}}\"\" affichage de la liste des derniers commentaires.\n \"\"{{TextSearch}}\"\" recherche de texte dans les pages du site.\n\n**Note :** à cause d\'un [[http://bugzilla.mozilla.org/show_bug.cgi?id=10547 bogue dans son moteur de rendu]], les listes, utilisant la touche TAB, ne fonctionnent pas (encore) sous Mozilla.\nUne astuce consiste à réaliser une tabulation dans un éditeur de texte puis de la copier. On peut ensuite coller la tabulation dans la zone de saisie de Wikini.\nVous pouvez également indenter du texte en utilisant des caractères espace au lieu de la touche \"TAB\", les exemples ci-dessus restent valables mais attention à ne pas mélanger des \"TAB\" et des espaces dans la même énumération.\n\n---', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'ListeUtilisateurs', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des utilisateurs ===\n\n... du premier au dernier.\n\n{{Listusers}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'ListeUtilisateursInverse', body = '** Retour : ** [[TableauDeBord Tableau de bord]]\n----\n=== Liste des utilisateurs ===\n\n... du dernier au premier.\n\n{{Listusers/last}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'PlanDuSite', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Plan du site : ===\n\n{{ListPages/tree}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'IndexDesPages', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des pages : ===\n\n{{ListPages}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'IndexAlphabetiqueDesPages', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des pages par ordre alphabétique : ===\n\n{{pageindex}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'DerniersChangementsRSS', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\nCette page renvoie au fils RSS des derniers changement. Pour savoir comment l\'utiliser voir la page \"\"<a href=\"http://www.wikini.net/wakka.php?wiki=WikiniEtLesFluxRSS\" target=\"_blank\" title=\"Wikini et les flux RSS\">Wikini et les flux RSS</a>\"\".\n\n\"\"<!--\n\n{{recentchangesrss/link=\"DerniersChangements\"}}\n\n-->\"\"', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'ListeInterWiki', body = '**Retour : ** [[TableauDeBord tableau de bord]]\n----\n=== Liste des distributions wiki : ===\n\n{{interwikilist}}', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'BacASable', body = '** Retour : ** [[PagePrincipale Page pincipale]]\n----\nUtilisez cette page pour faire vos tests !', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'TableauDeBord', body = '** Retour : ** [[PagePrincipale Page Principale]]\n----\n===== Tableau de bord =====\n\n - Listes des utilisateurs : [[ListeUtilisateurs par ordre de création ]] ou [[ListeUtilisateursInverse par ordre inverse de création ]].\n\n - [[DerniersChangements Dernières modifications sur les pages]]\n - [[DerniersCommentaires Dernières modifications sur les commentaires]]\n\n\n - [[PagesOrphelines Pages orphelines]]\n - [[PagesACreer Pages à créer]]\n\n - [[RechercheTexte Recherche texte]]\n\n - [[PlanDuSite Plan du site]]\n - [[IndexDesPages Index des pages avec noms des propriétaires]]\n - [[IndexAlphabetiqueDesPages Index des pages par classement alphabétique]]\n\n - [[DerniersChangementsRSS La page permettant le flux RSS]]\n\n - [[ListeInterWiki Liste des wiki existants ]]\n----\n==== 5 derniers comptes utilisateurs ====\n{{Listusers last=\"5\"}}\n\n==== 5 dernières pages modifiées ====\n{{recentchanges max=\"5\"}}\n----', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
$this->_db->query("insert into ".$prefixe."pages set tag = 'NomWiki', body = '** Retour : ** [[PagePrincipale Page Principale]]\n----\nUn NomWiki est un nom qui est écrit \"\"CommeCela\"\".\n\nUn NomWiki est transformé automatiquement en lien. Si la page correspondante n\'existe pas, un \'?\' est affiché à côté du mot.', owner = 'AdminTela', user = 'WikiNiInstaller', time = now(), latest = 'Y'"); |
} // end of member function creation_tables |
/** |
* |
* |
* @param string prefixe Le préfixe des tables à supprimer |
* @return void |
* @access public |
*/ |
function suppression_tables( $prefixe ) |
{ |
$resultat = $this->_db->query("DROP TABLE ".$prefixe."_acls ,".$prefixe."_links ,".$prefixe."_pages ,". |
$prefixe."_referrers ,".$prefixe."_users") ; |
// if (DB::isError ($resultat)) { |
// echo ('Echec de la requete de suppression <br />'.$resultat->getMessage()) ; |
// } |
} // end of member function suppression_tables |
} // end of gestion_wikini |
?> |
/trunk/client/integrateur_wikini/bibliotheque/adwi_HTML_formulaireWikini.class.php |
---|
19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: adwi_HTML_formulaireWikini.class.php,v 1.3 2005-09-02 11:29:25 ddelon Exp $ |
// CVS : $Id: adwi_HTML_formulaireWikini.class.php,v 1.4 2005-09-09 09:37:17 ddelon Exp $ |
/** |
* |
* Admin Wikini |
32,7 → 32,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
102,7 → 102,7 |
// Défault : PagePrincipale |
$this->addElement ('text', 'page', ADWI_PAGE, array ('size' => 60)) ; |
$this->addElement ('text', '', 'Configuration avancée :') ; |
$this->addElement ('static', '', 'Configuration avancée : ') ; |
$this->addElement ('text', 'bdd_hote', ADWI_BDD_HOTE, array ('size' => 60)) ; |
$this->addElement ('text', 'bdd_nom', ADWI_BDD_NOM, array ('size' => 60)) ; |
109,7 → 109,6 |
$this->addElement ('text', 'bdd_utilisateur', ADWI_BDD_UTILISATEUR, array ('size' => 60)) ; |
$this->addElement ('text', 'bdd_mdp', ADWI_BDD_MDP, array ('size' => 60)) ; |
$this->addElement ('text', 'table_prefix', ADWI_TABLE_PREFIX, array ('size' => 60)) ; |
$this->addElement ('text', 'page', ADWI_PAGE, array ('size' => 60)) ; |
$this->addElement ('text', 'chemin', ADWI_CHEMIN, array ('size' => 60)) ; |
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADWI_CHAMPS_REQUIS) ; |