You are here

function rb_thinktwice_action_page_alter in Rules Bonus Pack 7

The 'rb_thinktwice_action_page_alter' action.

File

./rb_thinktwice.rules.inc, line 115
Rules actions that you should think twice about. Plus some helper functions.

Code

function rb_thinktwice_action_page_alter($property, $value) {
  $alter =& drupal_static('rb_page_alter', array());

  // Type set.
  switch (trim(drupal_strtoupper($value))) {
    case 'TRUE':
      $value = (bool) TRUE;
    case 'FALSE':
      $value = (bool) FALSE;
      break;
    case ctype_digit($value):
      $value = (int) $value;
      break;
  }

  // To filter or not to filter, that is the question!
  $index['property'] = check_plain($property);
  $index['value'] = $value;

  // Populate $alter for rb_thinktwice_page_alter().
  $alter[] = $index;
}