You are here

function mmenu_convert_settings in Mobile sliding menu 7

Same name and namespace in other branches
  1. 7.3 mmenu.module \mmenu_convert_settings()
  2. 7.2 mmenu.module \mmenu_convert_settings()

Converts value from PHP to JSON format.

Parameters

array $values: An associative array that contains the mmenu settings.

Return value

array A converted mmenu settings array.

1 call to mmenu_convert_settings()
mmenu_admin_settings_form_submit in ./mmenu.admin.inc
Form submission handler for mmenu_admin_settings_form().

File

./mmenu.module, line 1011
Primarily Drupal hooks and global API functions to manipulate mmenus.

Code

function mmenu_convert_settings($values = array()) {
  foreach ($values as $k => $value) {
    if (is_array($value)) {
      $values[$k] = mmenu_convert_settings($value);
    }
    if ($value == 'true') {
      $values[$k] = TRUE;
    }
    elseif ($value == 'false') {
      $values[$k] = FALSE;
    }
    elseif (is_numeric($value)) {
      $values[$k] = (double) $value;
    }
  }
  return $values;
}