本文整理汇总了PHP中ca_users::htmlFormElement方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_users::htmlFormElement方法的具体用法?PHP ca_users::htmlFormElement怎么用?PHP ca_users::htmlFormElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_users
的用法示例。
在下文中一共展示了ca_users::htmlFormElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
function login()
{
$t_user = new ca_users();
# --- pass form elements for reg form
$this->view->setVar("fname", $t_user->htmlFormElement("fname", "<div><b>" . _t("First name") . "</b><br/>^ELEMENT</div>"));
$this->view->setVar("lname", $t_user->htmlFormElement("lname", "<div><b>" . _t("Last name") . "</b><br/>^ELEMENT</div>"));
$this->view->setVar("email", $t_user->htmlFormElement("email", "<div><b>" . _t("Email address") . "</b><br/>^ELEMENT</div>"));
$this->view->setVar("password", $t_user->htmlFormElement("password", "<div><b>" . _t("Password") . "</b><br/>^ELEMENT</div>"));
if (!$this->request->doAuthentication(array('dont_redirect' => true, 'user_name' => $this->request->getParameter('username', pString), 'password' => $this->request->getParameter('password', pString)))) {
$this->view->setVar('loginMessage', _t("Login failed. Please try again."));
$this->form($t_user);
} else {
if ($this->request->isLoggedIn()) {
# --- login successful so redirect to search page
$this->notification->addNotification(_t("You are now logged in"), __NOTIFICATION_TYPE_INFO__);
$vo_session = $this->request->getSession();
$vs_last_page = $vo_session->getVar('site_last_page');
$vo_session->setVar('site_last_page', "");
switch ($vs_last_page) {
case "Sets":
$this->response->setRedirect(caNavUrl($this->request, "", "Sets", "addItem", array("object_id" => $vo_session->getVar('site_last_page_object_id'))));
break;
# --------------------
# --------------------
case "ObjectDetail":
$this->response->setRedirect(caNavUrl($this->request, "Detail", "Object", "Show", array("object_id" => $vo_session->getVar('site_last_page_object_id'))));
break;
# --------------------
# --------------------
default:
if (!($vs_url = $this->request->session->getVar('pawtucket2_last_page'))) {
$vs_action = $vs_controller = $vs_module_path = '';
if ($vs_default_action = $this->request->config->get('default_action')) {
$va_tmp = explode('/', $vs_default_action);
$vs_action = array_pop($va_tmp);
if (sizeof($va_tmp)) {
$vs_controller = array_pop($va_tmp);
}
if (sizeof($va_tmp)) {
$vs_module_path = join('/', $va_tmp);
}
} else {
$vs_controller = 'Splash';
$vs_action = 'Index';
}
$vs_url = caNavUrl($this->request, $vs_module_path, $vs_controller, $vs_action);
}
$this->response->setRedirect($vs_url);
break;
# --------------------
}
} else {
$va_errors["register"] = _t("Login failed.");
}
return;
}
}