00001 <?php
00002
00007
00008 if (!defined('GALAXIA_TABLE_PREFIX')) {
00009 define('GALAXIA_TABLE_PREFIX', 'galaxia_');
00010 }
00011
00012
00013 if (!defined('GALAXIA_LIBRARY')) {
00014 define('GALAXIA_LIBRARY', dirname(__FILE__));
00015 }
00016
00017
00018 if (!defined('GALAXIA_PROCESSES')) {
00019
00020 define('GALAXIA_PROCESSES', GALAXIA_LIBRARY . '/processes');
00021 }
00022
00023
00024
00025 if (!defined('GALAXIA_TEMPLATES')) {
00026
00027 define('GALAXIA_TEMPLATES', 'templates');
00028
00029 }
00030
00031
00032 if (!defined('GALAXIA_TEMPLATE_HEADER')) {
00033 define('GALAXIA_TEMPLATE_HEADER', '{*Smarty template*}');
00034
00035 }
00036
00037
00038
00039 if (!defined('GALAXIA_LOGFILE')) {
00040
00041
00042 define('GALAXIA_LOGFILE', '');
00043 }
00044
00045
00046
00047 if (!defined('GRAPHVIZ_BIN_DIR')) {
00048 define('GRAPHVIZ_BIN_DIR', '');
00049
00050 }
00051
00056
00057 if (!isset($dbGalaxia)) {
00058 $dbGalaxia =& $dbTiki;
00059 }
00060
00061
00062 if (!function_exists('galaxia_show_error')) {
00063 function galaxia_show_error($msg)
00064 {
00065 global $smarty, $style_base;
00066 $smarty->assign('msg',tra($msg));
00067 $smarty->display("error.tpl");
00068 }
00069 }
00070
00071
00072 if (!function_exists('galaxia_execute_activity')) {
00073 function galaxia_execute_activity($activityId = 0, $iid = 0, $auto = 1)
00074 {
00075
00076
00077 $parsed = parse_url($_SERVER["REQUEST_URI"]);
00078 $URI = httpPrefix().$parsed["path"];
00079 $parts = explode('/',$URI);
00080 $parts[count($parts)-1] = "tiki-g-run_activity.php?activityId=$activityId&iid=$iid&auto=$auto";
00081 $URI = implode('/',$parts);
00082 $fp = fopen($URI,"r");
00083 $data = '';
00084 if (!$fp) {
00085 trigger_error(tra("Fatal error: cannot execute automatic activity $activityId"),E_USER_WARNING);
00086 die;
00087 }
00088 while (!feof($fp)) {
00089 $data.=fread($fp,8192);
00090 }
00091
00092
00093
00094
00095
00096
00097 fclose($fp);
00098
00099 }
00100 }
00101
00102 ?>