You are here

function legal_conditions_updated in Legal 7

Same name and namespace in other branches
  1. 5 legal.module \legal_conditions_updated()
  2. 6.8 legal.admin.inc \legal_conditions_updated()
  3. 6.7 legal.module \legal_conditions_updated()
  4. 7.2 legal.admin.inc \legal_conditions_updated()

Check if T&Cs have been updated.

1 call to legal_conditions_updated()
legal_administration_submit in ./legal.admin.inc

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;
}