Cette page présente le webware DokuWiki.
DokuWiki n'utilise pas de base de données (BDD) ! C'est un logiciel qui propose les fonctions essentielles d'un wiki:
Les fichiers conf/acl.auth.php et conf/users.auth.php définissent les droits d'accès et les users du système.
Le fichier local.php permet de (re-)définir les paramètres de son dokuwiki.
Un fichier local.protected.php permet de forcer une configuration particulière, que l'admin ne pourra pas écraser.
Enfin si on utilise l'URL rewrite avec le .htaccess, il faut se souvenir de changer le RewriteBase au nom de son dossier dokuwiki…
## Not all installations will require the following line. If you do, ## change "/dokuwiki" to the path to your dokuwiki directory relative ## to your document root. RewriteBase /dokuwiki
Il n'y pas beaucoup de fichiers pour créer un template. Le plus simple est de copier el template default et puis de l'adapter à ses besoins.
Le tutoriel officiel pour développer un template est ici:
http://wiki.splitbrain.org/wiki:tpl:devel
Il faut créer dans le dossier lib/tpl/ un nouveau dossier avec le nom du template.
lib/tpl/miwa/
Il faut ensuite modifier le fichier conf/dokuwiki.php, pour rediriger vers le nouveau dossier:
$conf['template'] = 'miwa'; //see tpl directory
il y a un fichier design.css et un layout.css.
Il y a des variables que l'on peut définir avec le fichier style.ini
Un template DokuWiki se constitue de 3 fichiers PHP:
C'est le fichier qui affiche la page principale.
<?php /** * DokuWiki Default Template * * This is the template you need to change for the overall look * of DokuWiki. * * You should leave the doctype at the very top - It should * always be the very first line of a document. * * @link http://wiki.splitbrain.org/wiki:tpl:templates * @author Andreas Gohr <andi@splitbrain.org> */ // must be run from within DokuWiki if (!defined('DOKU_INC')) die(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang']?>" lang="<?php echo $conf['lang']?>" dir="<?php echo $lang['direction']?>"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> <?php tpl_pagetitle()?> [<?php echo strip_tags($conf['title'])?>] </title> <?php tpl_metaheaders()?> <link rel="shortcut icon" href="<?php echo DOKU_TPL?>images/favicon.ico" /> <?php /*old includehook*/ @include(dirname(__FILE__).'/meta.html')?> </head> <body> <?php /*old includehook*/ @include(dirname(__FILE__).'/topheader.html')?> <div class="dokuwiki"> <?php html_msgarea()?> <div class="stylehead"> <div class="header"> <div class="pagename"> [[<?php tpl_link(wl($ID,'do=backlink'),tpl_pagetitle($ID,true))?>]] </div> <div class="logo"> <?php tpl_link(wl(),$conf['title'],'name="dokuwiki__top" id="dokuwiki__top" accesskey="h" title="[ALT+H]"')?> </div> <div class="clearer"></div> </div> <?php /*old includehook*/ @include(dirname(__FILE__).'/header.html')?> <div class="bar" id="bar__top"> <div class="bar-left" id="bar__topleft"> <?php tpl_button('edit')?> <?php tpl_button('history')?> </div> <div class="bar-right" id="bar__topright"> <?php tpl_button('recent')?> <?php tpl_searchform()?> </div> <div class="clearer"></div> </div> <?php if($conf['breadcrumbs']){?> <div class="breadcrumbs"> <?php tpl_breadcrumbs()?> <?php //tpl_youarehere() //(some people prefer this)?> </div> <?php }?> <?php if($conf['youarehere']){?> <div class="breadcrumbs"> <?php tpl_youarehere() ?> </div> <?php }?> </div> <?php flush()?> <?php /*old includehook*/ @include(dirname(__FILE__).'/pageheader.html')?> <div class="page"> <!-- wikipage start --> <?php tpl_content()?> <!-- wikipage stop --> </div> <div class="clearer"> </div> <?php flush()?> <div class="stylefoot"> <div class="meta"> <div class="user"> <?php tpl_userinfo()?> </div> <div class="doc"> <?php tpl_pageinfo()?> </div> </div> <?php /*old includehook*/ @include(dirname(__FILE__).'/pagefooter.html')?> <div class="bar" id="bar__bottom"> <div class="bar-left" id="bar__bottomleft"> <?php tpl_button('edit')?> <?php tpl_button('history')?> </div> <div class="bar-right" id="bar__bottomright"> <?php tpl_button('subscription')?> <?php tpl_button('admin')?> <?php tpl_button('profile')?> <?php tpl_button('login')?> <?php tpl_button('index')?> <?php tpl_button('top')?> </div> <div class="clearer"></div> </div> </div> </div> <?php /*old includehook*/ @include(dirname(__FILE__).'/footer.html')?> <div class="no"><?php /* provide DokuWiki housekeeping, required in all templates */ tpl_indexerWebBug()?></div> </body> </html>
Le fichier est assez réduit! C'est étonnant.
Il a l'air de servir pour la fenêtre pop-up de Upload.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php /** * DokuWiki Default Template * * This is the template for the media manager popup * * You should leave the doctype at the very top - It should * always be the very first line of a document. * * @link http://wiki.splitbrain.org/wiki:tpl:templates * @author Andreas Gohr <andi@splitbrain.org> */ ?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang']?>" lang="<?php echo $conf['lang']?>" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> <?php echo hsc($lang['mediaselect'])?> [<?php echo strip_tags($conf['title'])?>] </title> <?php tpl_metaheaders()?> <link rel="shortcut icon" href="<?php echo DOKU_TPL?>images/favicon.ico" /> </head> <body> <div id="media__manager" class="dokuwiki"> <div id="media__left"> <?php html_msgarea()?> <h1><?php echo hsc($lang['mediaselect'])?></h1> <?php /* keep the id! additional elements are inserted via JS here */?> <div id="media__opts"></div> <?php tpl_mediaTree() ?> </div> <div id="media__right"> <?php tpl_mediaContent() ?> </div> </div> </body> </html>
Encore un fichier assez petit! Il a l'air de servir pour l'affichage des images avec les détails EXIF.
<?php /** * DokuWiki Image Detail Template * * This is the template for displaying image details * * You should leave the doctype at the very top - It should * always be the very first line of a document. * * @link http://wiki.splitbrain.org/wiki:tpl:templates * @author Andreas Gohr <andi@splitbrain.org> */ // must be run from within DokuWiki if (!defined('DOKU_INC')) die(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang']?>" lang="<?php echo $conf['lang']?>" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> <?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?> [<?php echo strip_tags($conf['title'])?>] </title> <?php tpl_metaheaders()?> <link rel="shortcut icon" href="<?php echo DOKU_TPL?>images/favicon.ico" /> </head> <body> <div class="dokuwiki"> <?php html_msgarea()?> <div class="page"> <?php if($ERROR){ print $ERROR; }else{ ?> <h1><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG))?></h1> <div class="img_big"> <?php tpl_img(900,700) ?> </div> <div class="img_detail"> <p class="img_caption"> <?php print nl2br(hsc(tpl_img_getTag(array('IPTC.Caption', 'EXIF.UserComment', 'EXIF.TIFFImageDescription', 'EXIF.TIFFUserComment')))); ?> </p> <p>← <?php echo $lang['img_backto']?> <?php tpl_pagelink($ID)?></p> <dl class="img_tags"> <?php $t = tpl_img_getTag('Date.EarliestTime'); if($t) print '<dt>'.$lang['img_date'].':</dt><dd>'.date($conf['dformat'],$t).'</dd>'; $t = tpl_img_getTag('File.Name'); if($t) print '<dt>'.$lang['img_fname'].':</dt><dd>'.hsc($t).'</dd>'; $t = tpl_img_getTag(array('Iptc.Byline','Exif.TIFFArtist','Exif.Artist','Iptc.Credit')); if($t) print '<dt>'.$lang['img_artist'].':</dt><dd>'.hsc($t).'</dd>'; $t = tpl_img_getTag(array('Iptc.CopyrightNotice','Exif.TIFFCopyright','Exif.Copyright')); if($t) print '<dt>'.$lang['img_copyr'].':</dt><dd>'.hsc($t).'</dd>'; $t = tpl_img_getTag('File.Format'); if($t) print '<dt>'.$lang['img_format'].':</dt><dd>'.hsc($t).'</dd>'; $t = tpl_img_getTag('File.NiceSize'); if($t) print '<dt>'.$lang['img_fsize'].':</dt><dd>'.hsc($t).'</dd>'; $t = tpl_img_getTag('Simple.Camera'); if($t) print '<dt>'.$lang['img_camera'].':</dt><dd>'.hsc($t).'</dd>'; $t = tpl_img_getTag(array('IPTC.Keywords','IPTC.Category')); if($t) print '<dt>'.$lang['img_keywords'].':</dt><dd>'.hsc($t).'</dd>'; ?> </dl> <?php //Comment in for Debug// dbg(tpl_img_getTag('Simple.Raw'));?> </div> <?php } ?> </div> </div> </body> </html>
Pour copier le contenu d'un site Dokuwiki, il suffit de copier le dossier data/
Il faut ensuite ré-afficher les pages pour reconstruire les index de recherche.