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


PHP FormUI::set_settings方法代码示例

本文整理汇总了PHP中FormUI::set_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUI::set_settings方法的具体用法?PHP FormUI::set_settings怎么用?PHP FormUI::set_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormUI的用法示例。


在下文中一共展示了FormUI::set_settings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login_form

 /**
  * Display the login form
  *
  * @param string $name Pre-fill the name field with this name
  */
 protected function login_form()
 {
     // Build theme and login page template
     $this->setup_theme();
     if (!$this->theme->template_exists('login')) {
         $this->theme = Themes::create('admin', 'RawPHPEngine', Site::get_dir('admin_theme', true));
         $this->theme->assign('admin_page', 'login');
     }
     // Build the login form
     $form = new FormUI('habari_login');
     //$form->on_success( array( $this, 'loginform_success' ) );
     $login_form_title = _t('<h1><a href="%1$s" title="%2$s"><img alt="%2$s" src="%3$s" style="height:1em;margin-right:10px;vertical-align:top;">%4$s</a></h1>', array(Site::get_url('site'), _t('Go to Site'), Site::get_url('habari', '/system/admin/images/habari.logo.png'), Options::get('title')));
     $form->append(FormControlStatic::create('title')->set_static($login_form_title));
     $form->append(FormControlStatic::create('reset_message')->set_static('<p id="reset_message" class="on_reset">' . _t('Please enter the username you wish to reset the password for.  A unique password reset link will be emailed to that user.') . '</p>'));
     $form->append(FormControlLabel::wrap(_t('Name'), FormControlText::create('habari_username')->set_property('autofocus', 'autofocus'))->set_template('control.label.outsideleft'));
     $form->append(FormControlLabel::wrap(_t('Password'), FormControlPassword::create('habari_password', null, array('class' => 'off_reset')))->set_template('control.label.outsideleft')->set_properties(array('class' => 'off_reset')));
     $form->append($drop_button = FormControlDropbutton::create('submit_button')->add_template_class('ul', 'off_reset'));
     $drop_button->append(FormControlSubmit::create('login')->on_success(array($this, 'loginform_do_login'))->set_caption(_t('Login')));
     $form->append(FormControlStatic::create('reset_link')->set_static('<a href="#" class="off_reset reset_link">' . _t('Reset password') . '</a>'));
     $form->append(FormControlStatic::create('login_link')->set_static('<a href="#" class="on_reset reset_link">' . _t('Login') . '</a>'));
     $form->append(FormControlSubmit::create('reset_button')->set_caption(_t('Reset password'))->set_properties(array('class' => 'on_reset'))->on_success(array($this, 'loginform_do_reset')));
     // Use the dropbutton's visualizer to select the primary action for form submission upon pressing enter
     $form->set_settings(array('prefix_html' => '<script>$(function(){$("body").on("keypress", "form[name=' . $form->input_name() . ']", function(e){if(e.which==13){$(this).find("#' . $form->submit_button->get_visualizer() . ' .primary").click();return e.preventDefault()&&false;}});})</script>'));
     // Let plugins alter this form
     Plugins::act('form_login', $form);
     // Assign login form and display the page
     $this->theme->form = $form;
     $this->display('login');
     return true;
 }
开发者ID:habari,项目名称:system,代码行数:35,代码来源:userhandler.php


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