tag // function gCR() tag // function gOC($options) tag // function gCC() tag // function gCell($contents) insert $contents between tags // function gLink($link,$title) insert a link // function gReq($file) require a file // function gInc($file) include a file // function gBR() break tag // function gHR($options)
tag // function gEcho($text) echo $text to current line // function gEchoP($text) echo $text in a separate paragraph // function gOpenPage() open page tags // function gClosePage() close page tags // function gErrMsg($string) format and output an error message // function gDebug($string) format and output a debug message // function gGetDateStamp() return timestamp for database entries // // NOTES // // This is the Glial library - one component of the Sinaps web portal system. // // CHANGELOG // // 0.01 1 August 2000 Code cleanup and Initial release // 0.02 18 Sept 2000 More cleanup // //****************************************************************************** // let us know that glial.inc has been included on a page define("GLIALINC","1"); if ( !defined("CONFIGINC") ) { require("sinaps/config.inc"); } // Given $PHP_SELF getscript() will return the rightmost argument. // There is a bug here, perhaps due to a PHP scope issue - the name // returned is not always correct. function gGetScript($longname) { $bits = split("/", $longname); $iam = end($bits); return $iam; } // output a tag with arbitrary options function gOpenTable($options = "") { if ( $options != "" ) { echo "
\n"; } else { echo "
\n"; } } // insert a nicely-formatted
tag. function gCloseTable() { echo "\n"; } // insert a nicely-formatted tag. function gOR($options = "") { if ( $options != "" ) { echo "\n"; } else { echo "\n"; } } // insert a nicely-formatted tag. function gCR() { echo "\n"; } // formatted tag with arbitrary options function gOC($options = "") { if ( $options != "" ) { echo "\n"; } else { echo "\n"; } } // insert a nicely-formatted tag. function gCC() { echo "\n"; } function gCell($contents = " ") { if ( $contents != " " ) { echo "\n"; echo "$contents\n"; echo "\n"; } else { echo "\n"; echo " \n"; echo "\n"; } } function gLink($link,$title) { echo "\n"; echo $title; echo "\n"; } // i am too lazy to type a path on all my requires function gReq($file) { //gDebug("require()-ing $file!"); require("sinaps/$file"); } // i am too lazy to type a path on all of my includes function gInc($file) { include("sinaps/$file"); } // insert a nicely-formatted
tag. function gBR() { echo "
\n"; } // insert a nicely-formatted
tag. function gHR($options) { echo "
\n"; } function gEcho($text) { echo "$text\n"; } function gEchoP($text) { echo "

$text

\n"; } function gOpenPage() { gEcho(""); } function gOpenBody($options = "") { if ( $options != "" ) { echo "\n"; } else { echo "\n"; } } function gCloseBody() { gEcho(""); } function gClosePage() { gEcho(""); } function gErrMsg($string) { gEchoP("ERROR : $string"); } function gDebug($string) { global $PHP_SELF; gEchoP("DEBUG : $PHP_SELF : $string"); } function gGetDateStamp() { $datetime = date("YdmHis"); return $datetime; } // // saves some typing when an error is thrown in a Sinaps page using the STANDARD // page form. // function gCloseOnError() { gCC(); gCloseTable(); gCC(); gCR(); gCloseTable(); gCloseBody(); gClosePage(); exit; } ?>