Example #1
0
File: signin.php Project: anqh/anqh
 /**
  * Get form.
  *
  * @return  string
  */
 public static function form()
 {
     ob_start();
     echo HTML::anchor(Route::url('oauth', array('action' => 'login', 'provider' => 'facebook')), '&nbsp;<i class="fa fa-facebook"></i> ' . __('Connect with Facebook') . '&nbsp;', array('class' => 'btn btn-block btn-facebook', 'title' => __('Sign in with your Facebook account')));
     echo '<hr>';
     echo Form::open(Route::url('sign', array('action' => 'in')));
     echo Form::input_wrap('username', null, array('autofocus'), __('Username or email'));
     echo Form::password_wrap('password', null, null, __('Password') . ' &nbsp; ' . HTML::anchor(Route::url('sign', array('action' => 'password')), __('Forgot?'), array('class' => 'text-muted')));
     echo Form::form_group(Form::checkbox_wrap('remember', 'true', true, null, __('Stay logged in')));
     echo Form::button(null, __('Login'), array('class' => 'btn btn-block btn-primary', 'title' => __('Remember to sign out if on a public computer!')));
     echo Form::close();
     return ob_get_clean();
 }
Example #2
0
File: form.php Project: anqh/anqh
 /**
  * Creates a textarea form input.
  *
  * @param   string        $name           textarea name
  * @param   string        $body           textarea body
  * @param   array         $attributes     html attributes
  * @param   boolean       $double_encode  encode existing HTML characters
  *
  * @param   string        $label
  * @param   string|array  $error
  * @param   string|array  $tip
  * @param   boolean       $bbcode
  * @return  string
  */
 public static function textarea_wrap($name, $body = '', array $attributes = null, $double_encode = true, $label = null, $error = null, $tip = null, $bbcode = false)
 {
     $attributes = (array) $attributes + array('id' => self::input_id($name));
     $attributes['class'] .= ' form-control';
     $label = $label ? array($attributes['id'] => $label) : '';
     $input = Form::textarea($name, $body, $attributes, $double_encode);
     // Add BBCode editor?
     if ($bbcode) {
         if ($element = Arr::get($attributes, 'id')) {
             $element = '#' . $element;
         } else {
             $element = 'textarea[name=' . $name . ']';
         }
         $input = new View_Generic_Smileys($element) . $input . '<script>head.ready("vendor", function() { $("' . $element . '").markItUp(bbCodeSettings); });</script>';
     }
     return Form::form_group($input, $label, $error, $tip);
 }