getSubtype() == "disctopic" && $dt->canEdit()) { $_SESSION['disctitle'] = $title; $_SESSION['discauthor'] = $author; $_SESSION['discemail'] = $email; $_SESSION['discbody'] = $body; $_SESSION['disctags'] = $tags; $_SESSION['discsection'] = $section; // Convert string of tags into a preformed array $tagarray = string_to_tag_array($tags); if ( empty($title) || empty($body) || empty($section) || !array_key_exists($section, $sections)) { /*translation:Please fill all required fields.*/ register_error(elgg_echo("koolielu:error_blank")); forward("pg/discussions/edit_topic?disctopic=" . $guid); } else { $owner = get_entity($dt->getOwner()); $dt->access_id = $access_id; $dt->title = $title; $dt->description = $body; $dt->save(); $dt->clearMetadata('tags'); $dt->tags = $tagarray; $dt->clearMetadata('section'); $dt->section = $section; // Changing discauthor or discemail is not allowed //$dt->discauthor = $author; //$dt->discemail = $email; unset($_SESSION['disctitle']); unset($_SESSION['discauthor']); unset($_SESSION['discemail']); unset($_SESSION['discbody']); unset($_SESSION['disctags']); unset($_SESSION['discsection']); /*translation:Discussion changed.*/ system_message(elgg_echo("koolielu:message_discussion_changed")); forward("pg/discussions"); } } ?>