/** * A function which detects all inputs from silence related forms, * from $_REQUEST parameters, and acts on them (e.g. creating silences, * disabling, etc) * * Validation, permission checking, etc, are done here, so that it can be * called from anywhere. * * @return string A text message containing the results. Will be "" if nothing happened. */ public static function formActions() { global $User; if (!$User->type['ForumModerator']) { return; } if (isset($_REQUEST['silencePostID']) && isset($_REQUEST['silenceReason'])) { // Validation is done within create(), so these values can be passed straight through return l_t("Silence created successfully"); } if (isset($_REQUEST['disableSilenceID'])) { $silence = new Silence(); $silence->load($_REQUEST['disableSilenceID']); $silence->disable(); return l_t("Silence disabled successfully"); } return ""; }