Warning: session_start(): open(/var/lib/php/sessions/sess_9gvlbe7lftkshgg4vaeko0746f, 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
module YesPopupModule {
transient YesPopup popup;
transient S moduleID; // which module are we showing the popup for
transient long popupSince;
start {
dm_onTopInput_q(voidfunc(S s) {
if "yes"
accept();
});
}
void accept {
if (popupShowing()) {
fS mod = moduleID;
hidePopup();
thread {
dm_callOpt(mod, 'yes);
}
}
}
void cleanMeUp {
hidePopup();
}
void hidePopup {
removeFromParent(popup);
popup = null;
moduleID = null;
popupSince = 0;
}
// API
void showYesPopup(S moduleID, Component component, O... _) {
hidePopup();
popup = showYesToAcceptPopup(component, _);
if (popup == null) ret;
this.moduleID = moduleID;
popupSince = now();
}
void hideYesPopup(S moduleID) {
if (eq(moduleID, this.moduleID)) hidePopup();
}
bool popupShowing() {
ret isShowing(popup);
}
S moduleShowingPopup() {
ret !popupShowing() ? null : moduleID;
}
}