# HG changeset patch # User Christophe Lincoln # Date 1301845461 -7200 # Node ID 0f9a95d9ca89001a9a8caa794406f0ba61ec1c92 # Parent 2ea20065417a43a08bc11da2c34696c2367ecc9a Add libtazpanel for common functions diff -r 2ea20065417a -r 0f9a95d9ca89 lib/libtazpanel --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/libtazpanel Sun Apr 03 17:44:21 2011 +0200 @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Common functions for TazPanel CGI and cmdline interface +# + +# We need a config file first +get_config() { + CONFIG="/etc/slitaz/tazpanel.conf" + [ -f $CONFIG ] && . $CONFIG + [ -f tazpanel.conf ] && . tazpanel.conf + [ ! -f $PANEL/lib/libtazpanel ] && \ + echo "No config file or libtazpanel found: $CONFIG" && \ + exit 1 +} + +# +# xHTML 5 (header and footer skel are from the style) +# + +xhtml_header() { + cat $HEADER | sed s/'- %TITLE%'/"$TITLE"/ +} + +xhtml_footer() { + cat $FOOTER +} + +table_start() { + cat << EOT + + +EOT +} + +table_end () { + cat << EOT + +
+EOT +}