function variable_get_for_school
Search API
| 7.x db.inc | variable_get_for_school($name, $default_value = "", $school_id = 0, $bool_ignore_override = FALSE) |
| 6.x db.inc | variable_get_for_school($name, $default_value = "", $school_id = 0, $bool_ignore_override = FALSE) |
Get a value for a particular school. if bool_ignore_override is TRUE, then we won't worry if it's being overwritten or not.
125 calls to variable_get_for_school()
- admin.degrees.inc in modules/
admin/ admin.degrees.inc - admin.groups.inc in modules/
admin/ admin.groups.inc - admin.module in modules/
admin/ admin.module - The administrative configurations for FlightPath.
- admin_advising_settings_form in modules/
admin/ admin.module - This is a systems settings form, which lets the user edit advising variabled for FlightPath.
- admin_display_degrees_popup_add_group2 in modules/
admin/ admin.degrees.inc
File
- includes/
db.inc, line 943 - This file contains mostly db shortcuts.
Code
function variable_get_for_school($name, $default_value = "", $school_id = 0, $bool_ignore_override = FALSE) {
$school_id = intval($school_id);
// If this is the default school, OR, we are using NOT overriding the default vals for this school, then use variable_get normally
if ($school_id === 0 || ($bool_ignore_override == FALSE && variable_get("school_override__$name~~school_" . $school_id, '') !== 'yes')) {
return variable_get($name, $default_value); // for default school, just work normally.
}
if ($bool_ignore_override == TRUE && !variable_exists("school_override__$name~~school_" . $school_id)) {
return variable_get($name, $default_value); // Can't find the override anyway, so get the default.
}
// If we are here, we need to get using a fieldname suffix with the school id.
return variable_get($name . "~~school_" . $school_id, $default_value);
}
