wok-current view tazwikiss/stuff/var/www/wiki/plugins/wkp_ListPlugins.sh @ rev 5859

Add tazwikiss
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 18 12:02:49 2010 +0200 (2010-07-18)
parents
children
line source
1 plugin="<a href=\"?action=list\">ListPlugins</a>"
2 description_fr="Affiche la liste des plugins chargés"
3 description="List plugins"
5 action()
6 {
7 [ "$1" == "list" -o "$1" == "config" ] || return 1
8 CONTENT='
9 <table width="100%">
10 <tr><td span=2><h2>Plugins</h2></td></tr>
11 '
12 PAGE_TITLE_link=false
13 editable=false
14 lang="${HTTP_ACCEPT_LANGUAGE%%,*}"
15 PAGE_TITLE="Configuration"
16 for i in $plugins_dir/*.sh ; do
17 plugin=
18 eval $(grep ^plugin= $i)
19 [ -n "$plugin" ] || continue
20 eval $(grep ^description= $i)
21 alt="$(grep ^description_$lang= $i)"
22 [ -n "$alt" ] && eval $(echo "$alt" | sed 's/_..=/=/')
23 CONTENT="$CONTENT
24 <tr><td><b>
25 <input type=checkbox disabled=disabled $([ -x $i ] && echo 'checked=checked ')/>
26 $plugin</b></td><td><i>$description</i></td></tr>"
27 done
28 CONTENT="$CONTENT
29 <tr><td span=2><br /><h2>Locales</h2></td></tr>
30 "
31 for i in config-*.sh ; do
32 i=${i#config-}
33 i=${i%.sh}
34 [ -n "$i" ] || continue
35 CONTENT="$CONTENT
36 <tr><td><b>
37 <input type=checkbox disabled=disabled $([ "$i" == "$lang" ] && echo 'checked=checked ')/>
38 $i</b></td></tr>
39 "
40 done
41 CONTENT="$CONTENT
42 <tr><td><br /><h2>Data</h2></td>
43 <td><form method=\"get\" action=\"?action=saveconf\">
44 <input disabled type=\"submit\" name=\"save\" value=\"save\" />
45 <input disabled type=\"file\" name=\"file\" value=\"file\" />
46 <input disabled type=\"submit\" name=\"restore\" value=\"restore\" />
47 </form></td></tr>
48 $(du -hs */ | awk '{ printf "<tr><td><b>%s</b></td><td><i>%s</i></td></tr>\n",$1,$2 }')
49 </table>
50 "
51 }