Created
April 30, 2013 20:55
-
-
Save chrisjdavis/5491862 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function action_modify_form_habari_login(FormUI $form) { | |
$form->add_class( 'large-7 large-centered columns' ); | |
$form->set_property( 'id', 'login-form' ); | |
$form->remove( $form->title ); | |
$form->remove( $form->reset_message ); | |
$form->habari_username->set_property( 'placeholder', 'Email Address' ); | |
$form->habari_password->set_property( 'placeholder', 'Password' ); | |
$buttons = $form->append( FormControlWrapper::create('buttons')->set_setting('wrap_element', 'ul')->add_class('button-group radius')->set_setting('wrap_each', '<li>%s</li>') ); | |
$form->move_into( $form->login, $buttons ); | |
$form->remove( $form->submit_button ); | |
$buttons->append( FormControlSubmit::create('register')->set_caption('Register?')->on_success(function() { /* do registraion things */} ) ); | |
$form->move_into( $form->reset_button, $buttons ); | |
$buttons->each(function($control) { $control->add_class('secondary button'); }); | |
$buttons->reset_button->set_caption('Forgot password'); | |
$buttons->login->add_class('success'); | |
$form->remove( $form->reset_link ); | |
$form->remove( $form->login_link ); | |
$form->insert( $form->label_for_habari_username, $inputs = FormControlFieldset::create('inputs') ); | |
$form->move_into($form->label_for_habari_username, $inputs); | |
$form->move_into($form->label_for_habari_password, $inputs); | |
$form->move_into($form->buttons, $inputs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment