echo "emptyName"; } else { if ($nameCount !== 0) { echo "alreadyExists"; } else { $lists->create($name); } } } } // update if (isset($_POST["name"]) and isset($_POST["newname"])) { $name = strip_tags($_POST["name"]); $newname = strip_tags($_POST["newname"]); $newNameCount = $lists->verifListExist($newname); if (strlen($newname) < 3 or strlen($newname) > 30) { echo "errorListLengthNew"; } else { if (empty($newname) or $newname === "undefined") { echo "emptyNewName"; } else { if ($newNameCount !== 0) { echo "alreadyExists"; } else { $lists->update($name, $newname); } } } } break; }
function saveList(Lists $list, $new_name, $editable, $list_id, $user_id) { $list->update($new_name, $editable, $list_id, $user_id); }