menu_edit_item_save

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/menu/menu.module, строка 522

Версии
5
menu_edit_item_save($edit)

Save changes to a menu item into the database.

Возвращаемое значение

mid

Код

<?php
function menu_edit_item_save($edit) {
  if (isset($edit['expanded'])) {
    if ($edit['expanded']) {
      $edit['type'] |= MENU_EXPANDED;
    }
    else {
      $edit['type'] &= ~MENU_EXPANDED;
    }
  }

  $edit['type'] = $edit['type'] | MENU_MODIFIED_BY_ADMIN;

  $status = menu_save_item($edit);

  $t_args = array('%title' => $edit['title']);
  if ($status == SAVED_UPDATED) {
    drupal_set_message(t('The menu item %title has been updated.', $t_args));
  }
  elseif ($status == SAVED_NEW) {
    drupal_set_message(t('The menu item %title has been added.', $t_args));
    watchdog('menu', t('Added menu item %title.', $t_args), WATCHDOG_NOTICE, l(t('view'), 'admin/build/menu'));
  }
  return $edit['mid'];
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему