本文整理汇总了PHP中UserController::createUserForm方法的典型用法代码示例。如果您正苦于以下问题:PHP UserController::createUserForm方法的具体用法?PHP UserController::createUserForm怎么用?PHP UserController::createUserForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserController
的用法示例。
在下文中一共展示了UserController::createUserForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: users
public function users()
{
$id = (int) $this->request->get("id");
$response = new ActionResponse();
$availableUserGroups = array('' => $this->translate('_default_user_group'));
foreach (UserGroup::getRecordSet(new ARSelectFilter()) as $group) {
$availableUserGroups[$group->getID()] = $group->name->get();
}
$form = UserController::createUserForm($this, null, $response);
$form->setData(array_merge($form->getData(), array('UserGroup' => $id, 'ID' => 0, 'isEnabled' => 1)));
$response->set('newUser', array('UserGroup' => array('ID' => $id), 'ID' => 0, 'isEnabled' => 1));
$response->set('availableUserGroups', $availableUserGroups);
$response->set('form', $form);
$response->set('countries', array_merge(array('' => ''), $this->application->getEnabledCountries()));
$response->set("userGroupID", $id);
$this->setGridResponse($response);
return $response;
}
示例2: quickEdit
public function quickEdit()
{
$this->loadQuickEditLanguageFile();
$request = $this->getRequest();
$userID = $request->get('id');
$user = User::getInstanceByID($userID, ActiveRecordModel::LOAD_DATA, array('UserGroup'));
$f = new ARSelectFilter(new EqualsCond(new ARFieldHandle('CustomerOrder', 'userID'), $user->getID()));
$f->setOrder(new ARFieldHandle('CustomerOrder', 'dateCompleted'), 'desc');
$customerOrders = ActiveRecordModel::getRecordSet('CustomerOrder', $f, ActiveRecordModel::LOAD_REFERENCES);
$response = new ActionResponse();
$response->set('someUser', $user->toArray());
$lastOrder = false;
$ordersArray = array();
if ($customerOrders->size() > 0) {
$i = 0;
foreach ($customerOrders as $order) {
$order->loadAddresses();
$order->getShipments();
$order->loadDiscounts();
$ordersArray[$i] = $order->toArray();
$ordersArray[$i]['status_name'] = CustomerOrder::getStatusName($ordersArray[$i]['status'] ? $ordersArray[$i]['status'] : CustomerOrder::STATUS_NEW);
$i++;
}
$response->set('orders', $ordersArray);
$response->set('lastOrder', $ordersArray[0]);
}
$form = UserController::createUserForm($this, $user, $response);
$response->set('form', $form);
$availableUserGroups = array('' => $this->translate('_default_user_group'));
foreach (UserGroup::getRecordSet(new ARSelectFilter()) as $group) {
$availableUserGroups[$group->getID()] = $group->name->get();
}
$response->set('availableUserGroups', $availableUserGroups);
return $response;
}