$variable) { if (!empty($variable['localize']) || in_array($name, $conf)) { $translatable[] = $name; } } // The final list will be the sum of both lists. We may have unknown variables we want to preserve. $list = array_unique(array_merge($translatable, $current)); $list[] = 'unknown_variable'; $form['variables'] = array( '#type' => 'fieldset', '#title' => t('Select variables to be translated'), '#theme' => 'variable_table_select', '#tree' => TRUE, ); foreach ($list as $name) { $form['variables'][$name] = array( '#type' => 'checkbox', '#default_value' => in_array($name, $current), ); } $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration')); return $form; } /** * Handle form submission. */ function i18n_variable_admin_settings_submit($form, $form_state) { // Get main variable names $variables = $form_state['values']['variables']; $variables = array_keys(array_filter($variables)); variable_set('i18n_variable_conf', $variables); // Spawn multiple variables and translate into actual variables variable_set('i18n_variable_list', variable_children($variables)); // Clear list from cache cache_clear_all('*', I18N_VARIABLE_CACHE, TRUE); }