improvement for custom pages, with template

pull/3619/head
Alex Aragon 5 years ago
parent 3c1b201b8c
commit 7d62ad717b
  1. 23
      app/Resources/public/css/base.css
  2. 83
      app/Resources/public/css/themes/chamilo/custompage.css
  3. BIN
      app/Resources/public/css/themes/chamilo/images/favicon.png
  4. 142
      app/Resources/public/css/themes/chamilo/images/header-logo.svg
  5. 110
      custompages/index-unlogged-dist.php
  6. 50
      custompages/lostpassword-dist.php
  7. 112
      custompages/registration-dist.php
  8. BIN
      favicon.png
  9. 4
      main/auth/inscription.php
  10. 13
      main/auth/lostPassword.php
  11. 225
      main/img/icons/svg/favicon.svg
  12. 1
      main/inc/lib/api.lib.php
  13. 56
      main/inc/lib/formvalidator/FormValidator.class.php
  14. 2
      main/inc/lib/pear/HTML/QuickForm/button.php
  15. 2
      main/inc/lib/pear/HTML/QuickForm/select.php
  16. 3
      main/inc/lib/pear/HTML/QuickForm/text.php
  17. 14
      main/inc/lib/template.lib.php
  18. 48
      main/template/default/custompage/login.tpl
  19. 17
      main/template/default/custompage/lostpassword.tpl
  20. 18
      main/template/default/custompage/registration.tpl

@ -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 */
@ -8351,10 +8350,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;
@ -9453,10 +9448,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,83 @@
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap');
:root {
--primary-color: #486F88;
--success-color: #16D090;
}
body, html {
height: 100%;
}
body {
margin: 0;
line-height: 1.5;
color: #212529;
background-color: #fff;
font-family: 'Lato', sans-serif;
}
.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,42 @@ 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 --> $template->assign('section_name', $this_section);
</div> <!-- #wrapper -->
</body> $layout = $template->get_template('custompage/login.tpl');
</html> $content = $template->fetch($layout);
$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,7 @@ if ($extraConditions && isset($extraConditions['conditions'])) {
} }
} }
$form = new FormValidator('registration'); $form = new FormValidator('registration','post','','',[],FormValidator::LAYOUT_GRID);
$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']);
@ -623,7 +623,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');

@ -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,12 @@ 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';
}
}
$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());
@ -1833,14 +1839,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()) {
@ -1857,7 +1863,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>
Loading…
Cancel
Save