private function initialise_option($name, $default) {
        $param = optional_param($name, null, PARAM_BOOL);
        if (is_null($param)) {
            return get_user_preferences($name, $default);
        } else {
            set_user_preference($name, $param);
            return $param;
        }
    }
private function initialise_option($name, $default) {
        $param = optional_param($name, null, PARAM_BOOL);
        if (is_null($param)) {
            return get_user_preferences($name, $default);
        } else {
            set_user_preference($name, $param);
            return $param;
        }
    }
private function initialise_option ( $ name , $ default ) { $ param = optional_param ( $ name , null , PARAM_BOOL ) ; if ( is_null ( $ param ) ) { return get_user_preferences ( $ name , $ default ) ; } else { set_user_preference ( $ name , $ param ) ; return $ param ; } }
Initialise one of the option checkboxes, either from  the request, or failing that from the
user_preferences table, or finally from the given default.

@param string $name
@param mixed $default
@return mixed|null|string
Initialise one of the option checkboxes either from the request or failing that from the user_preferences table or finally from the given default .