user_edit

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

modules/user/user.module, строка 1439

Версии
5
user_edit($category = 'account')
6
user_edit($account, $category = 'account')

Код

<?php
function user_edit($category = 'account') {
  global $user;

  $account = user_load(array('uid' => arg(1)));
  if ($account === FALSE) {
    drupal_set_message(t('The account does not exist or has already been deleted.'));
    drupal_goto('admin/user/user');
  }

  $edit = $_POST['op'] ? $_POST : (array)$account;

  if (arg(2) == 'delete') {
    return drupal_get_form('user_confirm_delete', $account->name, $account->uid);
  }
  else if ($_POST['op'] == t('Delete')) {
    if ($_REQUEST['destination']) {
      $destination = drupal_get_destination();
      unset($_REQUEST['destination']);
    }
    // Note: we redirect from user/uid/edit to user/uid/delete to make the tabs disappear.
    drupal_goto("user/$account->uid/delete", $destination);
  }

  $form = _user_forms($edit, $account, $category);
  $form['_category'] = array('#type' => 'value', '#value' => $category);
  $form['_account'] = array('#type' => 'value', '#value' => $account);
  $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 30);
  if (user_access('administer users')) {
    $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'), '#weight' => 31);
  }
  $form['#attributes']['enctype'] = 'multipart/form-data';

  drupal_set_title(check_plain($account->name));
  return $form;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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