tazpanel view lib/libtazpanel @ rev 15

Add libtazpanel for common functions
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 03 17:44:21 2011 +0200 (2011-04-03)
parents
children b4e001e85045
line source
1 #!/bin/sh
2 #
3 # Common functions for TazPanel CGI and cmdline interface
4 #
6 # We need a config file first
7 get_config() {
8 CONFIG="/etc/slitaz/tazpanel.conf"
9 [ -f $CONFIG ] && . $CONFIG
10 [ -f tazpanel.conf ] && . tazpanel.conf
11 [ ! -f $PANEL/lib/libtazpanel ] && \
12 echo "No config file or libtazpanel found: $CONFIG" && \
13 exit 1
14 }
16 #
17 # xHTML 5 (header and footer skel are from the style)
18 #
20 xhtml_header() {
21 cat $HEADER | sed s/'- %TITLE%'/"$TITLE"/
22 }
24 xhtml_footer() {
25 cat $FOOTER
26 }
28 table_start() {
29 cat << EOT
30 <table>
31 <tbody>
32 EOT
33 }
35 table_end () {
36 cat << EOT
37 </tbody>
38 </table>
39 EOT
40 }