Warning: session_start(): open(/var/lib/php/sessions/sess_3qfm1f6ecd314j93tp1jnh8759, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule GListMaker > DynObjectTable {
bool active = true;
S globalID = aGlobalID();
start {
onChange(r { saveStructFile(javaxDataDir("User Lists/" + aGlobalID() + ".txt"), clonedList()); });
}
S answer(S s) {
if (!active) null;
if "list done|done" {
dm_call(dm_gazelle_modulesManager(), 'removeModule, this);
ret "Okidoki! Here's the final list with " + n2(list(), "entry", "entries") + ", saved as " + globalID + "):\n" + joinWithComma(list());
}
new Matches m;
if "add ..." {
if (contains($1)) ret $1 + " is already on the list!";
add($1);
ret $1 + " added to list. Now " + n2(list(), "entry", "entries") + ".";
}
if "remove ..." {
LS list = list();
int i = indexOfIC(list, $1);
if (i < 0) ret $1 + " is not on the list anyway.";
S item = list.get(i);
remove(item);
ret $1 + " removed from list!. Now " + n2(list(), "entry", "entries") + ".";
}
if "what's the list|list"
ret empty(list()) ? "Your list is empty." : joinWithComma(list());
null;
}
// API
bool contains(S s) { ret cic(list(), s); }
}