function devel_variable_edit in Devel 6
Same name and namespace in other branches
- 5 devel.module \devel_variable_edit()
- 7 devel.pages.inc \devel_variable_edit()
1 string reference to 'devel_variable_edit'
- devel_menu in ./
devel.module - Implementation of hook_menu().
File
- ./
devel.module, line 1411
Code
function devel_variable_edit($form_state, $name) {
$value = variable_get($name, 'not found');
$form['name'] = array(
'#type' => 'value',
'#value' => $name,
);
$form['value'] = array(
'#type' => 'item',
'#title' => t('Old value'),
'#value' => dpr($value, TRUE),
);
if (is_string($value) || is_numeric($value)) {
$form['new'] = array(
'#type' => 'textarea',
'#title' => t('New value'),
'#default_value' => $value,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
}
else {
$api = variable_get('devel_api_url', 'api.drupal.org');
$form['new'] = array(
'#type' => 'item',
'#title' => t('New value'),
'#value' => t('Sorry, complex variable types may not be edited yet. Use the <em>Execute PHP</em> block and the <a href="@variable-set-doc">variable_set()</a> function.', array(
'@variable-set-doc' => "http://{$api}/api/HEAD/function/variable_set",
)),
);
}
drupal_set_title(check_plain($name));
return $form;
}