moved interfaces ui into a seperate php file.
[CBFWR.git] / libcbfwr / lib.php
1 <?php
2 /*
3  * 
4  * The Main lib.php file.
5  * 
6  */
7
8 //require_once();
9
10 // get the lib root, and set include path from it
11 $LIB_ROOT_FS = realpath(dirname(__FILE__));
12 global $LIB_ROOT_FS;
13
14 /*
15  * I shouldnt ever need to do this bit, but its here, just in case
16 $adpath = realpath($LIB_ROOT_FS."/../");
17 error_log("added libglcas path as $adpath");
18 set_include_path(get_include_path().PATH_SEPARATOR.$adpath);
19
20 */
21
22 global $BASE_URL;
23
24
25 require_once("libcbfwr/config.php");
26 require_once("libcbfwr/comms.php");
27 require_once("libcbfwr/web.php");
28 require_once("libcbfwr/fwui.php");
29 require_once("libcbfwr/interfaceui.php");
30
31 function glcas_pluginLoader($path="")
32 {
33         global $LIB_ROOT_FS;
34         if($path ==  "") {
35                 // try and find it
36                 $plpath = realpath($LIB_ROOT_FS."/../plugins/");
37                 if(file_exists($plpath."/plugin.php")) {
38                         // here it is, load away
39                         error_log("attempting to load plugins from $plpath");
40                         $dh = opendir("$plpath");
41                         if($dh) {
42                                 while(($file = readdir($dh))!==false) {
43                                         $mt = preg_match("/.*.php$/", $file);
44                                         if($mt > 0) {
45                                                 error_log("loading plugin $file");
46                                                 require_once("$plpath/$file");
47                                                 //echo "required $basedir/$file\n";
48                                         }
49                                 }
50                         }                       
51                 }
52         }
53 }
54
55
56 ?>