Merge branch '1.11.x' of git://github.com/aragonc/chamilo-lms into aragonc-1.11.x

pull/3559/head
Yannick Warnier 5 years ago
commit 2f0e0d6236
  1. 2
      app/Resources/public/assets/fullcalendar/dist/fullcalendar.js
  2. 28
      app/Resources/public/css/base.css
  3. 80
      app/Resources/public/css/custompage.css
  4. 80
      app/Resources/public/css/themes/chamilo/custompage.css
  5. BIN
      app/Resources/public/css/themes/chamilo/images/favicon.png
  6. 142
      app/Resources/public/css/themes/chamilo/images/header-logo.svg
  7. 109
      custompages/index-unlogged-dist.php
  8. 50
      custompages/lostpassword-dist.php
  9. 112
      custompages/registration-dist.php
  10. BIN
      favicon.png
  11. 10
      main/auth/inscription.php
  12. 13
      main/auth/lostPassword.php
  13. 225
      main/img/icons/svg/favicon.svg
  14. 5
      main/inc/lib/api.lib.php
  15. 56
      main/inc/lib/formvalidator/FormValidator.class.php
  16. 2
      main/inc/lib/pear/HTML/QuickForm/button.php
  17. 2
      main/inc/lib/pear/HTML/QuickForm/select.php
  18. 3
      main/inc/lib/pear/HTML/QuickForm/text.php
  19. 16
      main/inc/lib/template.lib.php
  20. 48
      main/template/default/custompage/login.tpl
  21. 17
      main/template/default/custompage/lostpassword.tpl
  22. 18
      main/template/default/custompage/registration.tpl
  23. 14
      main/template/default/layout/topbar.tpl

@ -5,6 +5,7 @@
*/ */
var FC = $.fullCalendar = { var FC = $.fullCalendar = {
version: "3.1.0", version: "3.1.0",
internalApiVersion: 7 internalApiVersion: 7
@ -14186,3 +14187,4 @@ fcViews.listYear = {
listDayAltFormat: 'dddd' // day-of-week is nice-to-have listDayAltFormat: 'dddd' // day-of-week is nice-to-have
} }
}; };

@ -46,7 +46,6 @@ body {
margin-bottom: 60px; margin-bottom: 60px;
} }
.footer { .footer {
position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
/* Set the fixed height of the footer here */ /* Set the fixed height of the footer here */
@ -221,13 +220,10 @@ select {
#login-block .btn-language.open .dropdown-menu { #login-block .btn-language.open .dropdown-menu {
display: block; display: block;
} }
#toolbar-admin{
#toolbar-admin.navbar {
margin-bottom: 0; margin-bottom: 0;
border-radius: 0; border-radius: 0;
border: none;
} }
.blackboard_show { .blackboard_show {
float: left; float: left;
position: absolute; position: absolute;
@ -8358,10 +8354,6 @@ ul#toolnavbox-two li a.btn {
border-top: none !important; border-top: none !important;
} }
.page-blank {
padding: 20px 30px;
}
/* groups social */ /* groups social */
.group-tool { .group-tool {
padding: 10px; padding: 10px;
@ -9465,10 +9457,24 @@ ul.dropdown-menu.inner > li > a {
} }
.compilation_block .progress { .compilation_block .progress {
margin:0px; margin:0;
width:120px width:120px
} }
#registration .form_list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));;
}
#registration .form_list .form-group{
margin: 10px;
}
#registration .form_list > *:nth-child(3n-2):nth-last-of-type(2) {
border-color: red;
grid-column: span 2;
}
#registration .form_list > *:nth-child(3n-1):nth-last-of-type(1) {
border-color: red;
grid-column: span 2;
}
/* CSS Responsive */ /* CSS Responsive */
@media (min-width: 1025px) and (max-width: 1200px) { @media (min-width: 1025px) and (max-width: 1200px) {
.sidebar-scorm { .sidebar-scorm {

@ -0,0 +1,80 @@
:root {
--primary-color: #486F88;
--success-color: #16D090;
}
body, html {
height: 100%;
}
body {
margin: 0;
line-height: 1.5;
color: #212529;
background-color: #fff;
}
.custompage .limiter {
width: 100%;
margin: 0 auto;
}
.custompage .container-login {
width: 100%;
min-height: 100vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 15px;
background: #f2f2f2;
}
.custompage .wrap-login {
background: #fff;
border-radius: 10px;
padding: 30px 45px;
box-shadow: 0 12px 26px rgba(16, 30, 115, 0.06);
}
.custompage .width-login{
width: 390px;
}
.custompage .width-register{
width: 690px;
}
.custompage h3.title, legend{
font-weight: 900;
font-size: 24px;
color: #486F88;
padding: 1rem 0;
}
.custompage label{
color: #486F88;
font-weight: 400;
}
.custompage .form-control,
.custompage .bootstrap-select .dropdown-toggle.btn-default{
border: 2px solid #B3C8D7;
}
.custompage .last-password{
padding: 2.5rem 0;
text-align: center;
}
.btn-primary {
color: #fff;
background-color: var(--primary-color);
border-color: var(--primary-color);;
text-transform: uppercase;
font-weight: bold;
}
.btn-success {
color: #fff;
background-color: var(--success-color);
border-color: var(--success-color);
text-transform: uppercase;
font-weight: bold;
}
.custompage .software-name{
text-align: center;
padding: 2rem 0;
margin-top: 1rem;
display: inline-block;
width: 100%;
font-size: 12px;
}

@ -0,0 +1,80 @@
:root {
--primary-color: #486F88;
--success-color: #16D090;
}
body, html {
height: 100%;
}
body {
margin: 0;
line-height: 1.5;
color: #212529;
background-color: #fff;
}
.custompage .limiter {
width: 100%;
margin: 0 auto;
}
.custompage .container-login {
width: 100%;
min-height: 100vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 15px;
background: #f2f2f2;
}
.custompage .wrap-login {
background: #fff;
border-radius: 10px;
padding: 30px 45px;
box-shadow: 0 12px 26px rgba(16, 30, 115, 0.06);
}
.custompage .width-login{
width: 390px;
}
.custompage .width-register{
width: 690px;
}
.custompage h3.title, legend{
font-weight: 900;
font-size: 24px;
color: #486F88;
padding: 1rem 0;
}
.custompage label{
color: #486F88;
font-weight: 400;
}
.custompage .form-control,
.custompage .bootstrap-select .dropdown-toggle.btn-default{
border: 2px solid #B3C8D7;
}
.custompage .last-password{
padding: 2.5rem 0;
text-align: center;
}
.btn-primary {
color: #fff;
background-color: var(--primary-color);
border-color: var(--primary-color);;
text-transform: uppercase;
font-weight: bold;
}
.btn-success {
color: #fff;
background-color: var(--success-color);
border-color: var(--success-color);
text-transform: uppercase;
font-weight: bold;
}
.custompage .software-name{
text-align: center;
padding: 2rem 0;
margin-top: 1rem;
display: inline-block;
width: 100%;
font-size: 12px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

@ -8,6 +8,9 @@
require_once api_get_path(SYS_PATH).'main/inc/global.inc.php'; require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
require_once __DIR__.'/language.php'; require_once __DIR__.'/language.php';
$template = new Template(get_lang('SignIn'), false, false, false, false, true, true);
/** /**
* Homemade micro-controller. * Homemade micro-controller.
*/ */
@ -15,107 +18,41 @@ if (isset($_GET['loginFailed'])) {
if (isset($_GET['error'])) { if (isset($_GET['error'])) {
switch ($_GET['error']) { switch ($_GET['error']) {
case 'account_expired': case 'account_expired':
$error_message = custompages_get_lang('AccountExpired'); $error_message = get_lang('AccountExpired');
break; break;
case 'account_inactive': case 'account_inactive':
$error_message = custompages_get_lang('AccountInactive'); $error_message = get_lang('AccountInactive');
break; break;
case 'user_password_incorrect': case 'user_password_incorrect':
$error_message = custompages_get_lang('InvalidId'); $error_message = get_lang('InvalidId');
break; break;
case 'access_url_inactive': case 'access_url_inactive':
$error_message = custompages_get_lang('AccountURLInactive'); $error_message = get_lang('AccountURLInactive');
break; break;
default: default:
$error_message = custompages_get_lang('InvalidId'); $error_message = get_lang('InvalidId');
} }
} else { } else {
$error_message = get_lang('InvalidId'); $error_message = get_lang('InvalidId');
} }
} }
$rootWeb = api_get_path('WEB_PATH'); if (isset($error_message)) {
$template->assign('error', $error_message);
/**
* HTML output.
*/
?>
<html>
<head>
<title>Custompage - login</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="<?php echo $rootWeb; ?>web/assets/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $rootWeb; ?>web/assets/flag-icon-css/css/flag-icon.min.css" />
<script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/bootstrap/dist/js/bootstrap.min.js"></script>
<script>
$(document).ready(function() {
if (top.location != location) {
top.location.href = document.location.href;
} }
// Handler pour la touche retour $flash = Display::getFlashToString();
$('input').keyup(function(e) {
if (e.keyCode == 13) {
$('#login-form').submit();
}
});
});
</script>
</head>
<body>
<div id="backgroundimage">
<img src="<?php echo api_get_path(WEB_PATH); ?>/custompages/images/page-background.png" class="backgroundimage" />
</div>
<div id="wrapper">
<div id="header">
<img src="<?php echo api_get_path(WEB_PATH); ?>/custompages/images/header.png" alt="Logo" />
</div> <!-- #header -->
<div id="login-form-box" class="form-box">
<div id="login-form-info" class="form-info">
<?php
echo Display::getFlashToString();
Display::cleanFlashMessages(); Display::cleanFlashMessages();
if (isset($content['info']) && !empty($content['info'])) {
echo $content['info'];
}
?>
</div>
<?php if (isset($error_message)) {
echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>';
}
?>
<form id="login-form" class="form" action="<?php echo api_get_path(WEB_PATH); ?>index.php" method="post">
<div>
<label for="login">*<?php echo custompages_get_lang('User'); ?></label>
<input name="login" type="text" /><br />
<label for="password">*<?php echo custompages_get_lang('Password'); ?></label>
<input name="password" type="password" /><br />
</div>
</form>
<div id="login-form-submit" class="form-submit" onclick="document.forms['login-form'].submit();">
<span><?php echo custompages_get_lang('LoginEnter'); ?></span>
</div> <!-- #form-submit -->
<div id="links">
<?php if (api_get_setting('allow_registration') === 'true') {
?>
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/inscription.php?language=<?php echo api_get_interface_language(); ?>">
<?php echo custompages_get_lang('Registration'); ?>
</a><br />
<?php
} ?>
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/lostPassword.php?language=<?php echo api_get_interface_language(); ?>"> if (api_get_setting('allow_registration') === 'true') {
<?php echo custompages_get_lang('LostPassword'); ?> $urlRegister = api_get_path(WEB_CODE_PATH) . 'auth/inscription.php?language=' . api_get_interface_language();
</a> $template->assign('url_register', $urlRegister);
</div> }
</div> <!-- #form --> $urlLostPassword = api_get_path(WEB_CODE_PATH) . 'auth/lostPassword.php?language=' . api_get_interface_language();
<div id="footer"> $template->assign('url_lost_password', $urlLostPassword);
<img src="<?php echo api_get_path(WEB_PATH); ?>/custompages/images/footer.png" /> $template->assign('mgs_flash', $flash);
</div> <!-- #footer -->
</div> <!-- #wrapper --> $layout = $template->get_template('custompage/login.tpl');
</body> $content = $template->fetch($layout);
</html> $template->assign('content', $content);
$template->display_blank_template();

@ -8,48 +8,16 @@
require_once api_get_path(SYS_PATH).'main/inc/global.inc.php'; require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
require_once __DIR__.'/language.php'; require_once __DIR__.'/language.php';
$rootWeb = api_get_path('WEB_PATH'); $template = new Template(get_lang('LostPassword'), false, false, false, false, true, true);
?>
<html>
<head>
<title><?php echo custompages_get_lang('LostPassword'); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $rootWeb; ?>web/assets/bootstrap/dist/css/bootstrap.min.css" /> $error = null;
<script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Handler pour la touche retour
$('input').keyup(function(e) {
if (e.keyCode == 13) {
$('#lostpassword-form').submit();
}
});
});
</script>
</head>
<body>
<div id="backgroundimage">
<img src="/custompages/images/page-background.png" class="backgroundimage" />
</div>
<div id="wrapper">
<div id="header">
<img src="../../custompages/images/header.png" alt="Ambassador logo" />
</div> <!-- #header -->
<div id="lostpassword-form-box" class="form-box">
<?php
if (isset($content['info']) && !empty($content['info'])) { if (isset($content['info']) && !empty($content['info'])) {
echo '<div id="registration-form-error" class="form-error"><ul>'.$content['info'].'</ul></div>'; $error = $content['info'];
} }
$template->assign('error');
echo isset($content['form']) ? $content['form'] : ''; $template->assign('form', $content['form']);
?> $layout = $template->get_template('custompage/lostpassword.tpl');
</div> <!-- #form --> $content = $template->fetch($layout);
<div id="footer"> $template->assign('content', $content);
<img src="../../custompages/images/footer.png" /> $template->display_blank_template();
</div> <!-- #footer -->
</div> <!-- #wrapper -->
</body>
</html>

@ -10,6 +10,9 @@
*/ */
require_once api_get_path(SYS_PATH).'main/inc/global.inc.php'; require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
require_once __DIR__.'/language.php'; require_once __DIR__.'/language.php';
$template = new Template(get_lang('Registration'), false, false, false, false, true, true);
/** /**
* Removes some unwanted elementend of the form object. * Removes some unwanted elementend of the form object.
* 03-26-2020 Added check if element exist. * 03-26-2020 Added check if element exist.
@ -23,104 +26,11 @@ if (isset($content['form']->_elementIndex['extra_mail_notify_message'])) {
if (isset($content['form']->_elementIndex['extra_mail_notify_group_message'])) { if (isset($content['form']->_elementIndex['extra_mail_notify_group_message'])) {
$content['form']->removeElement('extra_mail_notify_group_message'); $content['form']->removeElement('extra_mail_notify_group_message');
} }
$content['form']->removeElement('official_code');
if (isset($content['form']->_elementIndex['status'])) { $content['form']->removeElement('phone');
$content['form']->removeElement('status');
$content['form']->removeElement('status'); $template->assign('form', $content['form']->returnForm());
} $layout = $template->get_template('custompage/registration.tpl');
$rootWeb = api_get_path('WEB_PATH'); $content = $template->fetch($layout);
$template->assign('content', $content);
// Deprecated since 2015-03-26 $template->display_blank_template();
/**
* Code to change the way QuickForm render html.
*/
/*
$renderer = & $content['form']->defaultRenderer();
$form_template = <<<EOT
<form {attributes}>
{content}
<div class="clear">
&nbsp;
</div>
<p><a href="#" class="btn btn-primary" onclick="$('#registration-form').submit()"><span>S'inscrire</span></a></p>
</form>
EOT;
$renderer->setFormTemplate($form_template);
$element_template = <<<EOT
<div class="field decalle">
<label>
<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
</label>
<div class="formw">
<!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}
</div>
</div>
EOT;
$element_template_wimage = <<<EOT
<div class="field decalle display">
<label>
<!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
</label>
<div class="formw">
<!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}
<img src="/custompages/images/perso.jpg" alt="" />
</div>
</div>
EOT;
$renderer->setElementTemplate($element_template_wimage,'pass1');
$renderer->setElementTemplate($element_template);
$header_template = <<<EOT
<div class="row">
<div class="form_header">{header}</div>
</div>
EOT;
*/
?>
<html>
<head>
<title><?php echo custompages_get_lang('Registration'); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
</head>
<body>
<img id="backgroundimage" src="/custompages/images/page-background.png"">
<section id="registration">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="form-wrap">
<div class="logo">
<img src="/custompages/images/header.png">
</div>
<?php if (isset($content['error']) && !empty($content['error'])) {
echo '<div id="registration-form-error" class="alert alert-danger">'.$content['error'].'</div>';
}?>
<div id="registration-form-box" class="form-box">
<div class="block-form-login">
<?php
$content['form']->display();
?>
</div>
<div id="links">
<!--<a href="mailto: support@cblue.be"><?php echo custompages_get_lang('NeedContactAdmin'); ?></a><br />-->
</div>
</div>
<div id="footer">
<img src="/custompages/images/footer.png" />
</div> <!-- #footer -->
</div>
</div>
</div>
</div>
</section>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -73,7 +73,13 @@ if ($extraConditions && isset($extraConditions['conditions'])) {
} }
} }
$form = new FormValidator('registration'); if (CustomPages::enabled() && CustomPages::exists(CustomPages::REGISTRATION)) {
$layoutForm = FormValidator::LAYOUT_GRID;
} else{
$layoutForm = FormValidator::LAYOUT_HORIZONTAL;
}
$form = new FormValidator('registration','post','','',[],$layoutForm);
$user_already_registered_show_terms = false; $user_already_registered_show_terms = false;
if (api_get_setting('allow_terms_conditions') === 'true') { if (api_get_setting('allow_terms_conditions') === 'true') {
$user_already_registered_show_terms = isset($_SESSION['term_and_condition']['user_id']); $user_already_registered_show_terms = isset($_SESSION['term_and_condition']['user_id']);
@ -630,7 +636,7 @@ if ($allowDoubleValidation && $showTerms == false) {
$user_already_registered_show_terms || $user_already_registered_show_terms ||
$showTerms $showTerms
) { ) {
$form->addButtonNext(get_lang('RegisterUser')); $form->addButton('register', get_lang('RegisterUser'), null, 'primary', 'btn-block');
$formContainsSendButton = true; $formContainsSendButton = true;
} }
} }

@ -34,15 +34,6 @@ $tool_name = get_lang('LostPassword');
if ($reset && $userId) { if ($reset && $userId) {
$messageText = Login::reset_password($reset, $userId, true); $messageText = Login::reset_password($reset, $userId, true);
/*if (CustomPages::enabled() && CustomPages::exists(CustomPages::INDEX_UNLOGGED)) {
CustomPages::display(
CustomPages::INDEX_UNLOGGED,
['info' => $messageText]
);
exit;
}*/
Display::addFlash( Display::addFlash(
Display::return_message($messageText, 'info', false) Display::return_message($messageText, 'info', false)
); );
@ -50,7 +41,7 @@ if ($reset && $userId) {
exit; exit;
} }
$form = new FormValidator('lost_password'); $form = new FormValidator('lost_password', 'post', '', '', [], FormValidator::LAYOUT_GRID);
$form->addHeader($tool_name); $form->addHeader($tool_name);
$form->addText( $form->addText(
'user', 'user',
@ -91,7 +82,7 @@ if ($allowCaptcha) {
$form->addRule('captcha', get_lang('TheTextYouEnteredDoesNotMatchThePicture'), 'CAPTCHA', $captcha_question); $form->addRule('captcha', get_lang('TheTextYouEnteredDoesNotMatchThePicture'), 'CAPTCHA', $captcha_question);
} }
$form->addButtonSend(get_lang('Send')); $form->addButtonSend(get_lang('Send'), 'submit', false, [], 'btn-block', null);
if ($form->validate()) { if ($form->validate()) {
$values = $form->exportValues(); $values = $form->exportValues();

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 113 KiB

@ -164,6 +164,7 @@ define('SECTION_DASHBOARD', 'dashboard');
define('SECTION_REPORTS', 'reports'); define('SECTION_REPORTS', 'reports');
define('SECTION_GLOBAL', 'global'); define('SECTION_GLOBAL', 'global');
define('SECTION_INCLUDE', 'include'); define('SECTION_INCLUDE', 'include');
define('SECTION_CUSTOMPAGE', 'custompage');
// CONSTANT name for local authentication source // CONSTANT name for local authentication source
define('PLATFORM_AUTH_SOURCE', 'platform'); define('PLATFORM_AUTH_SOURCE', 'platform');
@ -2403,7 +2404,7 @@ function api_format_course_array($course_data)
$_course['course_image_source'] = $courseSys.'/course-pic85x85.png'; $_course['course_image_source'] = $courseSys.'/course-pic85x85.png';
} else { } else {
$url_image = Display::return_icon( $url_image = Display::return_icon(
'course.png', 'blackboard.png',
null, null,
null, null,
ICON_SIZE_LARGE, ICON_SIZE_LARGE,
@ -2427,7 +2428,7 @@ function api_format_course_array($course_data)
null, null,
null, null,
true, true,
false true
); );
} }

@ -36,7 +36,8 @@ class FormValidator extends HTML_QuickForm
$attributes = [], $attributes = [],
$layout = self::LAYOUT_HORIZONTAL, $layout = self::LAYOUT_HORIZONTAL,
$trackSubmit = true $trackSubmit = true
) { )
{
// Default form class. // Default form class.
if (is_array($attributes) && !isset($attributes['class']) || empty($attributes)) { if (is_array($attributes) && !isset($attributes['class']) || empty($attributes)) {
$attributes['class'] = 'form-horizontal'; $attributes['class'] = 'form-horizontal';
@ -133,15 +134,7 @@ EOT;
{ {
return ' return '
<style> <style>
.form_list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));;
grid-gap: 10px 30px;
gap: 10px 30px;
}
.form_list .input-group {
display:block;
}
</style> </style>
<form{attributes}> <form{attributes}>
<div class="form_list"> <div class="form_list">
@ -152,9 +145,9 @@ EOT;
} }
/** /**
* @return string
* @todo this function should be added in the element class * @todo this function should be added in the element class
* *
* @return string
*/ */
public function getDefaultElementTemplate() public function getDefaultElementTemplate()
{ {
@ -288,9 +281,9 @@ EOT;
* @param array $options * @param array $options
* @param array $attributes * @param array $attributes
* *
* @return HTML_QuickForm_element
* @throws Exception * @throws Exception
* *
* @return HTML_QuickForm_element
*/ */
public function addSelectAjax($name, $label, $options = [], $attributes = []) public function addSelectAjax($name, $label, $options = [], $attributes = [])
{ {
@ -381,7 +374,8 @@ EOT;
$class = null, $class = null,
$attributes = [], $attributes = [],
$createElement = false $createElement = false
) { )
{
if ($createElement) { if ($createElement) {
return $this->createElement( return $this->createElement(
'button', 'button',
@ -553,18 +547,19 @@ EOT;
* @param string $name Element name (for form treatment purposes) * @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method * @param bool $createElement Whether to use the create or add method
* @param array $attributes * @param array $attributes
* * @param $size
* @param $class
* @return HTML_QuickForm_button * @return HTML_QuickForm_button
*/ */
public function addButtonSend($label, $name = 'submit', $createElement = false, $attributes = []) public function addButtonSend($label, $name = 'submit', $createElement = false, $attributes = [], $size, $class)
{ {
return $this->addButton( return $this->addButton(
$name, $name,
$label, $label,
'paper-plane', 'paper-plane',
'primary', 'primary',
null, $size,
null, $class,
$attributes, $attributes,
$createElement $createElement
); );
@ -901,7 +896,8 @@ EOT;
$attributes = [], $attributes = [],
$addNoneOption = false, $addNoneOption = false,
$textCallable = '' $textCallable = ''
) { )
{
$options = []; $options = [];
if ($addNoneOption) { if ($addNoneOption) {
@ -956,9 +952,9 @@ EOT;
* @param string $label * @param string $label
* @param array $attributes * @param array $attributes
* *
* @return HTML_QuickForm_file
* @throws Exception if the file doesn't have an id * @throws Exception if the file doesn't have an id
* *
* @return HTML_QuickForm_file
*/ */
public function addFile($name, $label, $attributes = []) public function addFile($name, $label, $attributes = [])
{ {
@ -1056,7 +1052,8 @@ EOT;
$required = true, $required = true,
$fullPage = false, $fullPage = false,
$config = [] $config = []
) { )
{
$attributes = []; $attributes = [];
$attributes['rows'] = isset($config['rows']) ? $config['rows'] : 15; $attributes['rows'] = isset($config['rows']) ? $config['rows'] : 15;
$attributes['cols'] = isset($config['cols']) ? $config['cols'] : 80; $attributes['cols'] = isset($config['cols']) ? $config['cols'] : 80;
@ -1283,7 +1280,8 @@ EOT;
$label, $label,
$required = false, $required = false,
$attributes = [] $attributes = []
) { )
{
$attributes = array_merge( $attributes = array_merge(
$attributes, $attributes,
[ [
@ -1349,7 +1347,8 @@ EOT;
$label, $label,
$required = false, $required = false,
$attributes = [] $attributes = []
) { )
{
$attributes = array_merge( $attributes = array_merge(
$attributes, $attributes,
[ [
@ -1399,7 +1398,8 @@ EOT;
$allowNegative = false, $allowNegative = false,
$minValue = null, $minValue = null,
$maxValue = null $maxValue = null
) { )
{
$this->addElement( $this->addElement(
'FloatNumber', 'FloatNumber',
$name, $name,
@ -1475,7 +1475,8 @@ EOT;
$label, $label,
$required = false, $required = false,
$attributes = [] $attributes = []
) { )
{
$attributes = array_merge( $attributes = array_merge(
$attributes, $attributes,
[ [
@ -1522,7 +1523,8 @@ EOT;
$label, $label,
$required = false, $required = false,
$attributes = [] $attributes = []
) { )
{
$attributes = array_merge( $attributes = array_merge(
$attributes, $attributes,
[ [
@ -1634,14 +1636,14 @@ EOT;
* Add an element with user ID and avatar to the form. * Add an element with user ID and avatar to the form.
* It needs a Chamilo\UserBundle\Entity\User as value. The exported value is the Chamilo\UserBundle\Entity\User ID. * It needs a Chamilo\UserBundle\Entity\User as value. The exported value is the Chamilo\UserBundle\Entity\User ID.
* *
* @see \UserAvatar
*
* @param string $name * @param string $name
* @param string $label * @param string $label
* @param string $imageSize Optional. Small, medium or large image * @param string $imageSize Optional. Small, medium or large image
* @param string $subtitle Optional. The subtitle for the field * @param string $subtitle Optional. The subtitle for the field
* *
* @return \UserAvatar * @return \UserAvatar
* @see \UserAvatar
*
*/ */
public function addUserAvatar($name, $label, $imageSize = 'small', $subtitle = '') public function addUserAvatar($name, $label, $imageSize = 'small', $subtitle = '')
{ {

@ -254,7 +254,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
case FormValidator::LAYOUT_GRID: case FormValidator::LAYOUT_GRID:
case FormValidator::LAYOUT_BOX_NO_LABEL: case FormValidator::LAYOUT_BOX_NO_LABEL:
default: default:
$template = ' {element} '; $template = '<div class="form-group"> {element} </div>';
break; break;
} }

@ -611,7 +611,7 @@ class HTML_QuickForm_select extends HTML_QuickForm_element
case FormValidator::LAYOUT_GRID: case FormValidator::LAYOUT_GRID:
case FormValidator::LAYOUT_BOX: case FormValidator::LAYOUT_BOX:
return ' return '
<div class="input-group" style="z-index: auto"> <div class="form-group">
<label>{label}</label> <label>{label}</label>
{icon} {icon}
{element} {element}

@ -119,6 +119,9 @@ class HTML_QuickForm_text extends HTML_QuickForm_input
{label} {label}
</label> </label>
{element} {element}
<!-- BEGIN label_2 -->
<p class="help-block">{label_2}</p>
<!-- END label_2 -->
</div>'; </div>';
break; break;
case FormValidator::LAYOUT_HORIZONTAL: case FormValidator::LAYOUT_HORIZONTAL:

@ -662,6 +662,14 @@ class Template
$css[] = api_get_path(WEB_CSS_PATH).$this->themeDir.'learnpath.css'; $css[] = api_get_path(WEB_CSS_PATH).$this->themeDir.'learnpath.css';
} }
} }
if (CustomPages::enabled()) {
$cssCustomPage = api_get_path(SYS_CSS_PATH).$this->themeDir."custompage.css";
if (is_file($cssCustomPage)) {
$css[] = api_get_path(WEB_CSS_PATH).$this->themeDir.'custompage.css';
} else {
$css[] = api_get_path(WEB_CSS_PATH).'custompage.css';
}
}
$css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).$this->themeDir.'default.css'); $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).$this->themeDir.'default.css');
$css[] = api_get_cdn_path(ChamiloApi::getEditorBlockStylePath()); $css[] = api_get_cdn_path(ChamiloApi::getEditorBlockStylePath());
@ -1845,14 +1853,14 @@ class Template
private function assignFavIcon() private function assignFavIcon()
{ {
// Default root chamilo favicon // Default root chamilo favicon
$favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_PATH).'favicon.ico" type="image/x-icon" />'; $favico = '<link rel="icon" href="'.api_get_path(WEB_PATH).'favicon.png" type="image/png" />';
//Added to verify if in the current Chamilo Theme exist a favicon //Added to verify if in the current Chamilo Theme exist a favicon
$favicoThemeUrl = api_get_path(SYS_CSS_PATH).$this->themeDir.'images/'; $favicoThemeUrl = api_get_path(SYS_CSS_PATH).$this->themeDir.'images/';
//If exist pick the current chamilo theme favicon //If exist pick the current chamilo theme favicon
if (is_file($favicoThemeUrl.'favicon.ico')) { if (is_file($favicoThemeUrl.'favicon.png')) {
$favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_CSS_PATH).$this->themeDir.'images/favicon.ico" type="image/x-icon" />'; $favico = '<link rel="icon" href="'.api_get_path(WEB_CSS_PATH).$this->themeDir.'images/favicon.png" type="image/png" />';
} }
if (api_is_multiple_url_enabled()) { if (api_is_multiple_url_enabled()) {
@ -1869,7 +1877,7 @@ class Template
$icon_real_homep = api_get_path(SYS_HOME_PATH).$clean_url; $icon_real_homep = api_get_path(SYS_HOME_PATH).$clean_url;
//we create the new dir for the new sites //we create the new dir for the new sites
if (is_file($icon_real_homep.'favicon.ico')) { if (is_file($icon_real_homep.'favicon.ico')) {
$favico = '<link rel="shortcut icon" href="'.$homep.'favicon.ico" type="image/x-icon" />'; $favico = '<link rel="icon" href="'.$homep.'favicon.png" type="image/png" />';
} }
} }
} }

@ -0,0 +1,48 @@
<div class="custompage">
<div class="limiter">
<div class="container-login">
<div class="wrap-login width-login">
<form class="login100-form validate-form" action="{{ _p.web }}" method="post">
<div class="logo">
<img width="250px" class="img-responsive" title="{{ _s.site_name }}" src="{{ _p.web_css_theme }}images/header-logo.svg">
</div>
<h3 class="title">{{ 'Login'|get_lang() }}</h3>
{{ mgs_flash }}
{% if error %}
<div class="alert alert-warning" role="alert">
{{ error }}
</div>
{% endif %}
<div class="form-group">
<label for="user">{{ 'LoginOrEmailAddress'|get_lang() }}</label>
<input type="text" class="form-control" id="user" name="login" ">
</div>
<div class="form-group">
<label for="password">{{ 'Password'|get_lang() }}</label>
<input type="password" class="form-control" name="password" id="password" >
</div>
<button type="submit" class="btn btn-primary btn-block">
{{ 'LoginEnter'|get_lang() }}
</button>
{% if url_register %}
<a href="{{ url_register }}" class="btn btn-success btn-block" >
{{ 'Registration'|get_lang() }}
</a >
{% endif %}
<div class="last-password">
<a href="{{ url_lost_password }}">
{{ 'LostPassword'|get_lang() }}
</a>
</div>
</form>
<div class="software-name">
<a href="{{_p.web}}" target="_blank">
{{ "PoweredByX" |get_lang | format(_s.software_name) }}
</a>&copy; {{ "now"|date("Y") }}
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,17 @@
<div class="custompage">
<div class="limiter">
<div class="container-login">
<div class="wrap-login width-register">
<div class="logo">
<img width="250px" class="img-responsive" title="{{ _s.site_name }}" src="{{ _p.web_css_theme }}images/header-logo.svg">
</div>
{{ form }}
<div class="software-name">
<a href="{{_p.web}}" target="_blank">
{{ "PoweredByX" |get_lang | format(_s.software_name) }}
</a>&copy; {{ "now"|date("Y") }}
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,18 @@
<div class="custompage">
<div class="limiter">
<div class="container-login">
<div class="wrap-login width-register">
<div class="logo">
<img width="250px" class="img-responsive" title="{{ _s.site_name }}" src="{{ _p.web_css_theme }}images/header-logo.svg">
</div>
<h3 class="title">{{ 'UserRegistrationTitle'|get_lang() }}</h3>
{{ form }}
<div class="software-name">
<a href="{{_p.web}}" target="_blank">
{{ "PoweredByX" |get_lang | format(_s.software_name) }}
</a>&copy; {{ "now"|date("Y") }}
</div>
</div>
</div>
</div>
</div>

@ -3,7 +3,7 @@
<nav id="toolbar-admin" class="navbar navbar-inverse"> <nav id="toolbar-admin" class="navbar navbar-inverse">
<div class="container-fluid"> <div class="container-fluid">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#toolbar"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
@ -13,8 +13,8 @@
<img src="{{ "icon-chamilo.png"|icon(22) }}" title="{{ "siteName" | api_get_setting }}"> <img src="{{ "icon-chamilo.png"|icon(22) }}" title="{{ "siteName" | api_get_setting }}">
</a> </a>
</div> </div>
{% if _u.logged %}
<div class="collapse navbar-collapse" id="toolbar"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li class="active"><a href="{{ _p.web }}user_portal.php"> {{ "MyCourses"|get_lang }}</a></li> <li class="active"><a href="{{ _p.web }}user_portal.php"> {{ "MyCourses"|get_lang }}</a></li>
<li class="dropdown"> <li class="dropdown">
@ -27,6 +27,7 @@
<li><a href="{{ _p.web_main }}dashboard/">{{ "Dashboard"|get_lang }}</a></li> <li><a href="{{ _p.web_main }}dashboard/">{{ "Dashboard"|get_lang }}</a></li>
</ul> </ul>
</li> </li>
{% if _u.logged %}
{% if _u.is_admin == 1 %} {% if _u.is_admin == 1 %}
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Administration'|get_lang }}<b class="caret"></b></a> <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Administration'|get_lang }}<b class="caret"></b></a>
@ -57,14 +58,15 @@
{% if _u.is_admin == 1 %} {% if _u.is_admin == 1 %}
<form class="navbar-form navbar-left" role="search" action="{{ _p.web_main }}admin/user_list.php" method="get"> <form class="navbar-form navbar-left" role="search" action="{{ _p.web_main }}admin/user_list.php" method="get">
<input type="text" class="form-control" placeholder="{{'SearchUsers'|get_lang }}" name="keyword"> <input type="text" class="form-control" placeholder="{{'SearchUsers'|get_lang }}" name="keyword">
<button type="submit" class="btn btn-primary">{{'Search'|get_lang }}</button>
</form> </form>
{% endif %} {% endif %}
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><a href="{{ _p.web }}index.php?logout=logout&uid={{_u.user_id}}">{{ "Logout"|get_lang }}</a></li> <li><a href="{{ _p.web }}index.php?logout=logout&uid={{_u.user_id}}">{{ "Logout"|get_lang }}</a></li>
</ul> </ul>
</div> <!-- /nav collapse -->
{% endif %} {% endif %}
</div> <!-- /container--> </div><!-- /.navbar-collapse -->
</nav><!-- /topbar --> </div><!-- /.container-fluid -->
</nav>
{% endif %} {% endif %}

Loading…
Cancel
Save