public function get_unit_objects() { $workroom = new koala_container($this->containing_course->get_workroom()); $workroom->set_types_visible(CLASS_ROOM | CLASS_CONTAINER | CLASS_DOCEXTERN); $workroom->set_obj_types_invisible(array("container_wiki_koala", "room_wiki_koala", "KOALA_WIKI")); return $workroom->get_inventory(); }
public function __construct($steam_object, $unit) { parent::__construct($steam_object); $this->unit = $unit; }
public function __construct($steam_object, $link_base = FALSE) { parent::__construct($steam_object, $link_base); $this->set_types_invisible(CLASS_USER | CLASS_CALENDAR); $this->set_obj_types_invisible(array("container_wiki_koala", "KOALA_WIKI")); }
$msg = gettext("'%OBJECT' has been picked up from '%CONTAINER' and 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 { $msg = gettext("Could not pick up '%OBJECT' from '%CONTAINER' and place it into your clipboard."); $_SESSION["problem"] = str_replace(array("%OBJECT", "%CONTAINER"), array($koala_obj->get_display_name(), $koala_container->get_display_name()), $msg); 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;
<?php if (!$container->check_access_write($user)) { throw new Exception($user->get_login() . ": no right to delete " . $container->get_id(), E_USER_RIGHTS); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $values = $_POST["values"]; $container_name = $container->get_name(); $environment = $container->get_environment(); if (is_object($environment) && $environment instanceof steam_container) { $koala_environment = new koala_container($environment); $upper_link = $koala_environment->get_url(); } else { $upper_link = lms_steam::get_link_to_root($container); $upper_link["link"]; } if (lms_steam::delete($container)) { $_SESSION["confirmation"] = str_replace("%NAME", h($container_name), gettext("The folder '%NAME' has been deleted.")); header("Location: " . $upper_link); exit; } else { throw new Exception("Cannot delete container"); } } $content = new HTML_TEMPLATE_IT(); $content->loadTemplateFile(PATH_TEMPLATES . "container_delete.template.html"); $content->setVariable("FORM_ACTION", ""); $content->setVariable("LABEL_ARE_YOU_SURE", gettext("Are you sure?")); $content->setVariable("INFO_DELETE_CONTAINER", str_replace("%CONTAINER_NAME", h($container->get_name()), gettext("You are going to delete '%CONTAINER_NAME'."))); $content->setVariable("LABEL_DELETE_IT", gettext("Yes, delete this container")); $content->setVariable("DELETE_BACK_LINK", $_SERVER["HTTP_REFERER"]);
// check if group is a course $grouptype = (string) $group->get_attribute("OBJ_TYPE"); if ($grouptype == "course") { $group_staff = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $group->get_groupname() . ".staff"); $group_admins = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $group->get_groupname() . ".admins"); $group_members = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $group->get_groupname() . ".learners"); $workroom = $group_members->get_workroom(); } // create new container: if (!isset($koala_container) || !is_object($koala_container)) { $new_container = koala_container::create_container($values["name"], $environment, $values["short_dsc"]); if (isset($values["dsc"]) && !empty($values["dsc"])) { $new_container->set_attribute("OBJ_LONG_DESC", $values["dsc"]); } if (is_object($new_container)) { $koala_container = new koala_container($new_container); $_SESSION["confirmation"] = str_replace(array("%NAME", "%ENVIRONMENT"), array(h($new_container->get_name()), h($environment_koala_container->get_display_name())), gettext("New container '%NAME' has been created in '%ENVIRONMENT'.")); } else { $problems .= str_replace(array("%NAME", "%ENVIRONMENT"), array(h($new_container->get_name(), h($environment_koala_container->get_display_name()))), gettext("Could not create new container '%NAME' in '%ENVIRONMENT'.")); } } else { $changed = FALSE; if ($container->get_name() !== $values["name"]) { $container->set_name($values["name"]); } if ($container->get_attribute(OBJ_DESC) !== $values["short_dsc"]) { $container->set_attribute(OBJ_DESC, $values["short_dsc"]); } if ($container->get_attribute("OBJ_LONG_DESC") !== $values["dsc"]) { $container->set_attribute("OBJ_LONG_DESC", $values["dsc"]); }
$content->parse("BLOCK_UNIT_ACTION"); } $content->parse("BLOCK_UNIT_ACTIONS"); } } $content->parse("BLOCK_UNIT"); $item_ids[] = (string) $unit->get_id(); } } $content->parse("BLOCK_UNIT_LIST"); if ($course->get_workroom()->check_access_write($current_user)) { $content->setCurrentBlock("BLOCK_STAFF"); $portal->add_javascript_code('units', 'containerStart=' . $start . '; containerEnd=' . $end . '; itemIds=Array(' . implode(',', $item_ids) . ');'); $content->setVariable("CONTAINER_ID", $course->get_workroom()->get_id()); $content->setVariable('KOALA_VERSION', KOALA_VERSION); $content->setVariable("PATH_JAVASCRIPT", PATH_JAVASCRIPT); $infotext = gettext("Units can be sorted by dragging and dropping them.") . "<br/>"; $koala_container = new koala_container($course->get_workroom()); $webdav_url = $koala_container->get_webdav_url(); if (!empty($webdav_url)) { $infotext .= gettext("This folder is available as a web folder") . ": " . $webdav_url; } $content->setVariable("INFO_TEXT", $infotext); $content->parse("BLOCK_STAFF"); } } else { $content->setVariable('LABEL_UNITS', gettext('No units available. Either no units have been created in this context, or you are not allowed to see them.')); } $html_handler->set_html_left($content->get()); $portal->set_page_main($html_handler->get_headline(), $html_handler->get_html(), ""); $portal->show_html();
public function __construct($steam_object, $unit) { parent::__construct($steam_object); $this->max_group_size = $steam_object->get_attribute("HOMEWORK_MAX_GROUPSIZE"); $this->unit = $unit; }