当前位置: 首页>>代码示例>>PHP>>正文


PHP ca_users::htmlFormElement方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:57,代码来源:LoginRegController.php


注:本文中的ca_users::htmlFormElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。