svn:wkp_Test
Dernière modification : 2008/03/10 23:04
Accueil
/
Changements récents
/
Éditer (
Aide
) /
Historique
Voici un exemple de plugin qui ne fait rien. Vous pouvez l'utiliser comme base pour écrire les votres. Pensez à effacer les méthodes que vous n'utilisez pas. {{<?php # coding: utf-8 /** Plugin for test * Squeleton for a WiKiss plugin */ /* The file name must be : wkp_Test.php */ class Test { /* update thoses methods following your needs * remove any unused one */ function __construct() { // initialisations of the plugin } // __construct() function __destruct() { } // __destruct() function __toString() { return _('small description of the plugin'); } // __toString() function writedPage () { } // writedPage () function action ($action) { global $CONTENT; if ($action == "MyPluginAction") { // do stuff with $CONTENT for exemple return TRUE; } return FALSE; } // action ($action) function formatBegin () { global $CONTENT; // do stuff about formating the displayed page // $CONTENT = preg_replace ("/RegEx/","String",$CONTENT); return FALSE; } // formatBegin () function formatEnd () { global $CONTENT; // do stuff about formating the displayed page return FALSE; } // formatEnd () function template () { global $html; // replace tokens in the template // $html = str_replace ("{MY_PLUGIN_TOKEN}",something else,$html); return FALSE; } // template () } ?> }}
Mot de passe :
Wiki utilisant
WiKiss 0.3
2024/03/28 14:32 -- 18.213.110.162
Éditer (
Aide
) /
Historique