if ($list->exist() && $list->getUserId() == $login->userid) { $name_error = $list->setNameAndVisibility($list_name, $list_visibility); if ($name_error) { $edit_list = true; } $list->setDescription($desctext, $descMode == 3); $list->save(); $list->watch($watch); if ($list_caches != '') { $result = $list->addCachesByWPs($list_caches); $tpl->assign('invalid_waypoints', $result === true ? false : implode(", ", $result)); $list_caches = ''; } foreach ($_REQUEST as $key => $value) { if (substr($key, 0, 7) == 'remove_') { $list->removeCacheById(substr($key, 7)); } } } } // delete a list if (isset($_REQUEST['delete'])) { sql("DELETE FROM `cache_lists` WHERE `user_id`='&1' AND `id`='&2'", $login->userid, $_REQUEST['delete'] + 0); // All dependent deletion and cleanup is done via trigger. } // redirect to list search output after editing a list from the search output page if ($fromsearch && !$switchDescMode && !$name_error && isset($_REQUEST['listid'])) { $tpl->redirect('cachelist.php?id=' . ($_REQUEST['listid'] + 0)); } // prepare editor and editing if ($descMode == 3) {