function legal_conditions_updated in Legal 7
Same name and namespace in other branches
- 5 legal.module \legal_conditions_updated()
- 6.8 legal.admin.inc \legal_conditions_updated()
- 6.7 legal.module \legal_conditions_updated()
- 7.2 legal.admin.inc \legal_conditions_updated()
Check if T&Cs have been updated.
1 call to legal_conditions_updated()
File
- ./
legal.admin.inc, line 409 - Administration UI for the Legal module.
Code
function legal_conditions_updated($new) {
$previous_same_language = legal_get_conditions($new['language']);
$previous = legal_get_conditions();
if ($previous_same_language['conditions'] != $new['conditions'] && $previous['conditions'] != $new['conditions']) {
return TRUE;
}
$count = count($new['extras']);
for ($counter = 1; $counter <= $count; $counter++) {
$previous_same_language_extra = isset($previous_same_language['extras']['extras-' . $counter]) ? $previous_same_language['extras']['extras-' . $counter] : '';
$previous_extra = isset($previous['extras']['extras-' . $counter]) ? $previous['extras']['extras-' . $counter] : '';
if ($previous_same_language_extra != $new['extras']['extras-' . $counter] && $previous_extra != $new['extras']['extras-' . $counter]) {
return TRUE;
}
}
return FALSE;
}