From 2ffc47a1ebfde767112d8158465e5eb8bcd05e5c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 17 Feb 2014 17:28:18 +0100 Subject: [PATCH] Improving actions UI. --- main/admin/course_list.php | 2 - main/admin/user_list.php | 15 ++-- main/inc/lib/pear/HTML/QuickForm/text.php | 84 ++++++++++++----------- main/template/default/layout/footer.tpl | 4 ++ web/ChamiloLMS/css/base.css | 19 ++--- 5 files changed, 62 insertions(+), 62 deletions(-) diff --git a/main/admin/course_list.php b/main/admin/course_list.php index 6258ed6cd5..d6f0faed8c 100644 --- a/main/admin/course_list.php +++ b/main/admin/course_list.php @@ -249,13 +249,11 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') { $form->addElement('style_submit_button', 'submit', get_lang('SearchCourse'), 'class="btn"'); $form->addElement('static', 'search_advanced_link', null, ''.get_lang('AdvancedSearch').''); - $actions .= '
'; $actions .= ''.Display::return_icon('new_course.png', get_lang('AddCourse'),'',ICON_SIZE_MEDIUM).' '; if (api_get_setting('course_validation') == 'true') { $actions .= ''.Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'),'',ICON_SIZE_MEDIUM).''; } - $actions .= '
'; $actions .= $form->return_form(); // Create a sortable table with the course data diff --git a/main/admin/user_list.php b/main/admin/user_list.php index e67f916ac7..4800b7ddc4 100644 --- a/main/admin/user_list.php +++ b/main/admin/user_list.php @@ -617,20 +617,19 @@ if (!empty($action)) { // Create a search-box $form = new FormValidator('search_simple','get', '', '', array('class' => 'form-search'),false); -$renderer =& $form->defaultRenderer(); -$renderer->setElementTemplate('{element} '); -$form->addElement('text','keyword',get_lang('keyword'), 'size="25"'); -$form->addElement('style_submit_button', 'submit',get_lang('Search'),'class="btn"'); +/*$renderer =& $form->defaultRenderer(); +$renderer->setElementTemplate('{element} ');*/ +$form->addElement('text', 'keyword', get_lang('keyword')); +$form->addElement('button', 'submit' ,get_lang('Search')); $form->addElement('advanced_settings', 'user_list_filter', get_lang('AdvancedSearch')); $actions = ''; if (api_is_platform_admin()) { - $actions .= ''. - ''. - Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).''. - ''; + $actions .= ''. + Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).''; } $actions .= $form->return_form(); + if (isset ($_GET['keyword'])) { $parameters = array ('keyword' => Security::remove_XSS($_GET['keyword'])); } elseif (isset ($_GET['keyword_firstname'])) { diff --git a/main/inc/lib/pear/HTML/QuickForm/text.php b/main/inc/lib/pear/HTML/QuickForm/text.php index fe46e64882..34de29fa69 100755 --- a/main/inc/lib/pear/HTML/QuickForm/text.php +++ b/main/inc/lib/pear/HTML/QuickForm/text.php @@ -1,41 +1,41 @@ - * @author Bertrand Mansion - * @copyright 2001-2009 The PHP Group - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: text.php,v 1.7 2009/04/04 21:34:04 avb Exp $ - * @link http://pear.php.net/package/HTML_QuickForm - */ - -/** - * Base class for form elements - */ -require_once 'HTML/QuickForm/input.php'; +/** + * HTML class for a text field + * + * 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 + * @author Bertrand Mansion + * @copyright 2001-2009 The PHP Group + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @version CVS: $Id: text.php,v 1.7 2009/04/04 21:34:04 avb Exp $ + * @link http://pear.php.net/package/HTML_QuickForm + */ + +/** + * Base class for form elements + */ +require_once 'HTML/QuickForm/input.php'; /** * HTML class for a text field * - * @category HTML - * @package HTML_QuickForm - * @author Adam Daniel - * @author Bertrand Mansion - * @version Release: 3.2.11 - * @since 1.0 + * @category HTML + * @package HTML_QuickForm + * @author Adam Daniel + * @author Bertrand Mansion + * @version Release: 3.2.11 + * @since 1.0 */ class HTML_QuickForm_text extends HTML_QuickForm_input { @@ -53,8 +53,16 @@ class HTML_QuickForm_text extends HTML_QuickForm_input * @access public * @return void */ - function HTML_QuickForm_text($elementName=null, $elementLabel=null, $attributes=null) + function HTML_QuickForm_text($elementName = null, $elementLabel = null, $attributes = null) { + if (isset($attributes) && is_array($attributes) && !empty($attributes['class'])) { + $attributes['class'] .= $attributes['class'].' form-control'; + } else { + if (empty($attributes['class'])) { + $attributes = array('class' => 'form-control'); + } + } + HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes); $this->_persistantFreeze = true; $this->setType('text'); @@ -89,10 +97,6 @@ class HTML_QuickForm_text extends HTML_QuickForm_input */ function setMaxlength($maxlength) { - $this->updateAttributes(array('maxlength'=>$maxlength)); - } //end func setMaxlength - - // }}} - -} //end class HTML_QuickForm_text -?> + $this->updateAttributes(array('maxlength' => $maxlength )); + } +} diff --git a/main/template/default/layout/footer.tpl b/main/template/default/layout/footer.tpl index a588475257..573a1cb47e 100644 --- a/main/template/default/layout/footer.tpl +++ b/main/template/default/layout/footer.tpl @@ -197,6 +197,10 @@ $(document).ready( function() { interval: 10000 }); + $('.actions').addClass('btn-group'); + + $('.actions a').addClass('btn btn-default'); + // Tooltip. $(function() { $('a').tooltip({ diff --git a/web/ChamiloLMS/css/base.css b/web/ChamiloLMS/css/base.css index e7c8920fc1..56c4c358b4 100644 --- a/web/ChamiloLMS/css/base.css +++ b/web/ChamiloLMS/css/base.css @@ -199,14 +199,13 @@ footer .container .row { } .actions { - min-height: 20px; - padding: 8px 15px; margin-top: 10px; - margin-bottom: 20px; - background-color: #f5f5f5; - border: 1px solid #e3e3e3; - border-radius: 4px; - height: 50px; + margin-bottom: 10px; +} + +.actions form { + margin-left: 10px; + float:right; } .actions .actions-pagination { @@ -243,14 +242,10 @@ footer .container .row { } .actions a { - display: block; - float: left; - margin-right: 10px; - vertical-align: middle; } .actions .btn-toolbar { - margin: 0px; + } #friend-container .thumbnail {