本文整理汇总了PHP中UserForm::display方法的典型用法代码示例。如果您正苦于以下问题:PHP UserForm::display方法的具体用法?PHP UserForm::display怎么用?PHP UserForm::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserForm
的用法示例。
在下文中一共展示了UserForm::display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UserForm
api_not_allowed();
}
} else {
api_not_allowed();
}
require_once 'lib/be.inc.php';
require_once 'lib/gradebook_functions.inc.php';
require_once 'lib/fe/userform.class.php';
block_students();
$form = new UserForm(UserForm::TYPE_USER_INFO, $user, 'user_info_form', null, api_get_self() . '?userid=' . $user_id . '&selectcat=' . Security::remove_XSS($_GET['selectcat']));
if ($form->validate()) {
header('Location: user_stats.php?selectcat=' . Security::remove_XSS($_GET['selectcat']) . '&userid=' . $user_id);
exit;
}
$interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
Display::display_header(get_lang('UserInfo'));
//User picture size is calculated from SYSTEM path
$image_syspath = UserManager::get_user_picture_path_by_id($user_id, 'system', false, true);
$image_size = getimagesize($image_syspath['dir'] . $image_syspath['file']);
//Web path
$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
$image_file = $image_path['dir'] . $image_path['file'];
$img_attributes = 'src="' . $image_file . '?rand=' . time() . '" ' . 'alt="' . api_get_person_name($user_data['firstname'], $user_data['lastname']) . '" ' . 'style="float:left; padding:5px;" ';
if ($image_size[0] > 300) {
//limit display width to 300px
$img_attributes .= 'width="300" ';
}
//@todo need a "makeup"
echo '<img ' . $img_attributes . '/>';
$form->display();
Display::display_footer();
示例2: updateUser
/**
* Update an existing user
* @param $args array
* @param $request PKPRequest
* @return string Serialized JSON object
*/
function updateUser($args, &$request)
{
// Identify the press
$press =& $request->getPress();
// Identify the user Id
$userId = $request->getUserVar('userId');
if ($userId !== null && !Validation::canAdminister($press->getId(), $userId)) {
// We don't have administrative rights over this user.
$json = new JSON('false', Locale::translate('grid.user.cannotAdminister'));
} else {
// Form handling
import('controllers.grid.users.user.form.UserForm');
$userForm = new UserForm($userId);
$userForm->readInputData();
if ($userForm->validate()) {
$user =& $userForm->execute($args, $request);
// If this is a newly created user, show role management form
if (!$userId) {
import('controllers.grid.users.user.form.UserRoleForm');
$userRoleForm = new UserRoleForm($user->getId());
$userRoleForm->initData($args, $request);
$json = new JSON('false', $userRoleForm->display($args, $request));
} else {
// Successful edit of an existing user
// Prepare the grid row data
$row =& $this->getRowInstance();
$row->setGridId($this->getId());
$row->setId($user->getId());
$row->setData($user);
$row->initialize($request);
$json = new JSON('true', $this->_renderRowInternally($request, $row));
}
} else {
$json = new JSON('false', $userForm->display($args, $request));
}
}
return $json->getString();
}