// switching editor mode while editing existing list $list = new cachelist($_REQUEST['listid'] + 0); if ($list->exist() && $list->getUserId() == $login->userid) { $edit_list = true; $tpl->assign('show_editor', true); } } else { // switching desc mode while creating new list $tpl->assign('newlist_mode', true); $tpl->assign('show_editor', true); } } // save data entered in the 'edit list' form if (isset($_REQUEST['save']) && isset($_REQUEST['listid'])) { $list = new cachelist($_REQUEST['listid'] + 0); 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));