$smarty->registerPlugin("function", "clear_infos", "smarty_clear_infos_tag"); function smarty_clear_infos_tag($params, $smarty) { unset($_SESSION["info"]); } $smarty->assign("controller", $controller); $smarty->assign("action", $action); $controllerClass = "Controller\\" . ucfirst($controller); $actionMethod = "load" . ucfirst($action); if (!class_exists($controllerClass)) { echo "Error: No such class: " . $controllerClass; exit; } session_start(); $userManager = new Manager\UserManager(); $user = $userManager->getLoggedInUser(); if ($user == null && strtolower($controller) != "login" && strtolower($controller) != "register") { header("Location: " . generate_url("login", "default", array("redirect" => urlencode($_SERVER["REQUEST_URI"])))); exit; } else { $smarty->assign("user", $user); } $controllerInstance = new $controllerClass(); $controllerInstance->load(); if (method_exists($controllerInstance, $actionMethod)) { //fill all action parameters with GET/POST parameters $r = new ReflectionMethod($controllerClass, $actionMethod); $pars = array(); $params = $r->getParameters(); foreach ($params as $param) { $name = $param->getName();
function import_dir($path, $tags) { global $cm; $dir = opendir($path); while (false !== ($entry = readdir($dir))) { $f = $path . "/" . $entry; if (strlen($entry) > 2) { if (is_dir($f)) { import_dir($f, array_merge($tags, array($entry))); } else { if (is_file($f)) { $cm->importFile($f, array_merge($tags, array($entry))); } } } } } $mnm = new Manager\MindMapNodeManager(); $map = $mnm->createMindMap("niceMindMap"); $cards = $cm->getCardsByUser($um->getLoggedInUser()); $x = 0; foreach ($cards as $c) { if ($x++ == 5) { break; } $mnm->addCardToMindMap($map, $c); } $a = $mnm->createMindMap("untermap", 300, 200, 0, 120, 80, false, $map); $b = $mnm->createMindMap("untermap", 600, 300, 0, 120, 80, true, $map); $lm = new Manager\MindMapLinkManager(); $lm->createLink($a, $b, "is an", false, true);