header("Location: " . $_SERVER["HTTP_REFERER"]); exit; } break; case 'take-copy': $obj = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]); $koala_obj = koala_object::get_koala_object($obj); $container = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["where"], CLASS_CONTAINER); $koala_container = new koala_container($container); if ($_GET["modifier"] != "from" || !is_object($obj) || !is_object($container)) { break; } $copy = steam_factory::create_copy($GLOBALS["STEAM"]->get_id(), $obj); if (!is_object($copy)) { $msg = gettext("Could not obtain a copy of '%OBJECT'."); $_SESSION["confirmation"] = str_replace(array("%OBJECT", "%CONTAINER"), array($koala_obj->get_display_name(), $koala_container->get_display_name()), $msg); header("Location: " . $_SERVER["HTTP_REFERER"]); exit; } if ($copy->move($user)) { $msg = gettext("A copy of '%OBJECT' has been placed into your clipboard."); $_SESSION["confirmation"] = str_replace(array("%OBJECT", "%CONTAINER"), array($koala_obj->get_display_name(), $koala_container->get_display_name()), $msg); header("Location: " . $_SERVER["HTTP_REFERER"]); exit; } else { try { if (is_object($copy)) { $copy->delete(); } } catch (Exception $e) { }