Adding login input icons.

1.10.x
Julio Montoya 12 years ago
parent 978370e797
commit 38bc74e08b
  1. 3
      main/inc/lib/page.lib.php
  2. 4
      main/inc/lib/pear/HTML/Common.php
  3. 95
      main/inc/lib/pear/HTML/QuickForm/input.php
  4. 3
      main/inc/lib/pear/HTML/QuickForm/text.php
  5. 6
      src/ChamiloLMS/Controller/IndexController.php
  6. 5
      web/ChamiloLMS/css/base.css

@ -334,12 +334,11 @@ class PageController
$form = new FormValidator('formLogin', 'POST', null, null, array('class' => 'form-vertical'));
// 'placeholder'=>get_lang('UserName')
//'autocomplete'=>"off",
$form->addElement(
'text',
'login',
get_lang('UserName'),
array('class' => 'span2 autocapitalize_off', 'autofocus' => 'autofocus')
array('class' => 'span2 autocapitalize_off', 'autofocus' => 'autofocus', 'icon' => 'fa fa-key fa-fw')
);
$form->addElement('password', 'password', get_lang('Pass'), array('class' => 'span2'));
$form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn'));

@ -126,7 +126,7 @@ class HTML_Common
function _getTabs()
{
return str_repeat($this->_getTab(), $this->_tabOffset);
} // end func _getTabs
}
/**
* Returns an HTML formatted attribute string
@ -471,4 +471,4 @@ class HTML_Common
return $charset;
} // end func charset
} // end class HTML_Common
?>
?>

@ -1,45 +1,46 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Base class for <input /> form elements
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: input.php,v 1.10 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for form elements
*/
require_once 'HTML/QuickForm/element.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Base class for <input /> form elements
* Base class for <input /> form elements
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: input.php,v 1.10 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for form elements
*/
require_once 'HTML/QuickForm/element.php';
/**
* Base class for <input /> form elements
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* @abstract
*/
class HTML_QuickForm_input extends HTML_QuickForm_element
{
public $icon;
// {{{ constructor
/**
@ -52,13 +53,14 @@ class HTML_QuickForm_input extends HTML_QuickForm_element
* @access public
* @return void
*/
function HTML_QuickForm_input($elementName=null, $elementLabel=null, $attributes=null)
function HTML_QuickForm_input($elementName = null, $elementLabel = null, $attributes = null)
{
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
} //end constructor
// }}}
// {{{ setType()
if (isset($attributes) && is_array($attributes) && !empty($attributes['icon'])) {
$this->icon = $attributes['icon'];
}
}
/**
* Sets the element type
@ -72,10 +74,7 @@ class HTML_QuickForm_input extends HTML_QuickForm_element
{
$this->_type = $type;
$this->updateAttributes(array('type'=>$type));
} // end func setType
// }}}
// {{{ setName()
}
/**
* Sets the input field name
@ -151,7 +150,15 @@ class HTML_QuickForm_input extends HTML_QuickForm_element
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />';
$html = null;
if (!empty($this->icon)) {
$html .= '<div class="input-group"><span class="input-group-addon"><i class="'.$this->icon.'"></i></span>';
}
$html .= $this->_getTabs().'<input' . $this->_getAttrString($this->_attributes).' />';
if (!empty($this->icon)) {
$html .= '</div>';
}
return $html;
}
} //end func toHtml
@ -163,7 +170,7 @@ class HTML_QuickForm_input extends HTML_QuickForm_element
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object &$caller calling object
* @param object &$caller calling object
* @since 1.0
* @access public
* @return void

@ -40,8 +40,6 @@ require_once 'HTML/QuickForm/input.php';
class HTML_QuickForm_text extends HTML_QuickForm_input
{
// {{{ constructor
/**
* Class constructor
*
@ -62,7 +60,6 @@ class HTML_QuickForm_text extends HTML_QuickForm_input
$attributes = array('class' => 'form-control');
}
}
HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->setType('text');

@ -236,7 +236,8 @@ class IndexController extends CommonController
array(
'class' => 'input-medium autocapitalize_off virtualkey',
'placeholder' => get_lang('UserName'),
'autofocus' => 'autofocus'
'autofocus' => 'autofocus',
'icon' => 'fa fa-user fa-fw'
)
);
$form->addElement(
@ -245,7 +246,8 @@ class IndexController extends CommonController
null,
array(
'placeholder' => get_lang('Pass'),
'class' => 'input-medium virtualkey'
'class' => 'input-medium virtualkey',
'icon' => 'fa fa-key fa-fw'
)
);
$form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn btn-primary btn-block'));

@ -4844,9 +4844,11 @@ i.size-32.icon-new-work {
padding: 15px;
margin: 0 auto;
}
.form-signin-block button {
margin-top: 10px;
}
.form-signin-block input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
@ -4857,7 +4859,6 @@ i.size-32.icon-new-work {
border-bottom-right-radius: 0;
}
.form-signin {
max-width: 330px;
padding: 15px;

Loading…
Cancel
Save