wok rev 13569

Add blazekiss
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Nov 03 16:17:38 2012 +0100 (2012-11-03)
parents a16d86b1e8ae
children 9f84fa885954
files blazekiss/receipt blazekiss/stuff/plugins/wkp_ToDo.php
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/blazekiss/receipt	Sat Nov 03 16:17:38 2012 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="blazekiss"
     1.7 +VERSION="current"
     1.8 +CATEGORY="office"
     1.9 +SHORT_DESC="Tiny Wiki Engine in french."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +TARBALL="$PACKAGE.zip"
    1.12 +WEB_SITE="http://dizplay.idleman.fr/Projects/Wiki/blazekiss/"
    1.13 +WGET_URL="http://dizplay.idleman.fr/Projects/Archives/$TARBALL"
    1.14 +DEPENDS="lighttpd php"
    1.15 +CONFIG_FILES="/var/www/blazekiss/_config.php"
    1.16 +
    1.17 +# Rules to configure and make the package.
    1.18 +compile_rules()
    1.19 +{
    1.20 +	true
    1.21 +}
    1.22 +
    1.23 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.24 +genpkg_rules()
    1.25 +{
    1.26 +	index=$(find $src -name index.php)
    1.27 +	src=$(dirname $index)
    1.28 +	mkdir -p $fs/var/www
    1.29 +	cp -a $src $fs/var/www/blazekiss
    1.30 +	rm -f $fs/var/www/blazekiss/historique/*/*.bak
    1.31 +	cp -a $stuff/* $fs/var/www/blazekiss/
    1.32 +	chown -R www.www $fs/var/www/blazekiss
    1.33 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/blazekiss/stuff/plugins/wkp_ToDo.php	Sat Nov 03 16:17:38 2012 +0100
     2.3 @@ -0,0 +1,55 @@
     2.4 +<?php # coding: utf-8
     2.5 +
     2.6 +/** Indexe les tags {TODO ...} de pages/*.txt
     2.7 + * Accès via : ?action=todo
     2.8 + */
     2.9 +class Todo
    2.10 +{
    2.11 +   public $description = "Indexe les tags {TODO ...} de la base Wiki";
    2.12 +      
    2.13 +   function action($a)
    2.14 +   {
    2.15 +      global $CONTENT,$PAGE_TITLE,$PAGE_TITLE_link,$editable;
    2.16 +      
    2.17 +      switch ($a) {
    2.18 +      case "todo" :
    2.19 +         $PAGE_TITLE_link = FALSE; // pas de lien sur le titre
    2.20 +         $editable = FALSE; // non editable
    2.21 +         $PAGE_TITLE = "To do"; // titre de la page
    2.22 +         $CONTENT = '
    2.23 +<h2>{TODO ...} tags</h2>
    2.24 +';
    2.25 +
    2.26 +todo_index()
    2.27 +{
    2.28 +	grep -l '{TODO' pages/*.txt | while read file; do
    2.29 +		page=$(basename $file .txt)
    2.30 +		ref="<a href=\"?page=$page#TODO\">$page</a>"
    2.31 +		grep '{TODO' $file | sed "s|.*{TODO\\([^}]*\\)}.*|<p>$ref\\1</p>|"
    2.32 +	done
    2.33 +}
    2.34 +
    2.35 +	 if ($handle = @opendir("pages/data")) {
    2.36 +		while(($item = readdir($handle)) !== false) {
    2.37 +			 if ($item == '..' || $item == '.') continue;
    2.38 +		         $CONTENT .= '<tr><td><input type=checkbox ';
    2.39 +		         exec('grep -qs "pages/data/'.$item.'" pages/*.txt', $tmp, $ret);
    2.40 +		         if ($ret == 0) $CONTENT .= 'checked=checked ';
    2.41 +		         $CONTENT .= 'disabled=disabled /><a href="pages/data/'.
    2.42 +		         	$item.'">'.$item.'</a></td></tr>';
    2.43 +		}
    2.44 +	 }
    2.45 +	 return TRUE;
    2.46 +      }
    2.47 +      return FALSE; // action non traitée
    2.48 +      $CONTENT = preg_replace('#\[(.*)|(pages/.*)\]#','<a href="$1">$2</a>',$CONTENT);
    2.49 +   } // action
    2.50 +
    2.51 +   function formatBegin()
    2.52 +   {
    2.53 +      global $CONTENT;
    2.54 +      $CONTENT = preg_replace('#{TODO[^}]*}#','<a name="TODO"></a>',$CONTENT);
    2.55 +   }
    2.56 +}
    2.57 +
    2.58 +?>