0 ? $context_stack[$len-1] : null; } function fs_dump_actions() { $actions = &fs_get_actions(); echo "
".var_export($actions,true).""; } function fs_plugin_installed($name) { $plugins = &fs_get_plugins(); foreach($plugins as $plugin) { if (strtolower($plugin->plugin_name) == strtolower($name)) return true; } return false; } function fs_load_plugin($filename) { if (!fs_ends_with(strtolower($filename), ".php")) return; $r = sscanf($filename,"%s.php"); $full_path = FS_ABS_PATH ."/plugins/". $filename; $fp = fopen($full_path, "r"); if ($fp == false) return; $plugin = new stdClass(); while(true) { $s = fgets($fp); if ($s === false) break; if ($s == "$key = trim($value); } } fclose($fp); if (!isset($plugin->plugin_name)) return; // a plugin without a name is not a plugin! $plugin->id = $r[0]; $plugins = &fs_get_plugins(); $plugins[] = $plugin; // set current plugin id. //$plugin_id = $r[0]; fs_push_pcontext($plugin->id); // initialize plugin include($full_path); fs_pop_pcontext(); } ?>