function adds_power_menu_admin_submit in Power Menu 7
Same name and namespace in other branches
- 6 properties/adds.inc \adds_power_menu_admin_submit()
Callback function when submitting a menu item... storing the properties
_state
Parameters
$form:
1 string reference to 'adds_power_menu_admin_submit'
- adds_power_menu_properties in properties/
adds.inc - Implementation of hook_power_menu_properties().
File
- properties/
adds.inc, line 101
Code
function adds_power_menu_admin_submit($form, &$form_state) {
if (empty($form_state['values']['mlid']) || !($mlid = check_plain($form_state['values']['mlid']))) {
$mlid = 0;
}
$props = adds_power_menu_properties();
db_delete('power_menu_properties')
->condition('mlid', $mlid)
->execute();
foreach ($props as $prop) {
$db = array(
'mlid' => $mlid,
'property_name' => $prop['property_name'],
'value' => $form_state['values']['properties'][$prop['property_name']],
);
drupal_write_record('power_menu_properties', $db);
}
}