Commit bf41b22c authored by Dries's avatar Dries
Browse files

- Patch #83914 by nickl: form API clean-up: remove stuff.

parent 5f8027f9
......@@ -187,14 +187,11 @@ function menu_perm() {
*/
function menu_form_alter($form_id, &$form) {
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
$edit = isset($_POST) ? $_POST : '';
$edit['nid'] = $form['nid']['#value'];
$item = array();
if ($edit['nid'] > 0) {
$item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $edit['nid']));
if (isset($edit['menu']) && is_array($edit['menu'])) {
$item = !is_array($item) ? $edit['menu'] : (($_POST['op'] == t('Preview')) ? array_merge($item, $edit['menu']) : array_merge($edit['menu'], $item));
if ($form['nid']['#value'] > 0) {
$item = db_fetch_array(db_query("SELECT * FROM {menu} WHERE path = 'node/%d'", $form['nid']['#value']));
if (isset($form['#post']['menu']) && is_array($form['#post']['menu'])) {
$item = !is_array($item) ? $form['#post']['menu'] : (($form['#post']['op'] == t('Preview')) ? array_merge($item, $form['#post']['menu']) : array_merge($form['#post']['menu'], $item));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment