function availability_calendar_convert_state in Availability Calendars 7.5
Same name and namespace in other branches
- 7.3 availability_calendar.inc \availability_calendar_convert_state()
- 7.4 availability_calendar.inc \availability_calendar_convert_state()
array_walk callback to convert all states retrieved from the database.
Parameters
array $state: Array containing a state.
string $key:
string $op:
1 string reference to 'availability_calendar_convert_state'
- availability_calendar_get_states in ./
availability_calendar.inc - Returns an array of records (or labels) of states keyed by sid.
File
- ./
availability_calendar.inc, line 419
Code
function availability_calendar_convert_state(&$state, $key, $op) {
if ($op === 'JavaScript') {
$state = array(
'sid' => (int) $state['sid'],
'cssClass' => $state['css_class'],
'isAvailable' => $state['is_available'] == 1,
);
}
else {
if ($op === 'label') {
$state = t($state['label']);
}
}
}