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. 146
      app/Resources/public/css/themes/chamilo/images/header-logo.svg
  5. 114
      custompages/index-unlogged-dist.php
  6. 54
      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. 410
      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;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
@ -8351,10 +8350,6 @@ ul#toolnavbox-two li a.btn {
border-top: none !important;
}
.page-blank {
padding: 20px 30px;
}
/* groups social */
.group-tool {
padding: 10px;
@ -9453,10 +9448,24 @@ ul.dropdown-menu.inner > li > a {
}
.compilation_block .progress {
margin:0px;
margin:0;
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 */
@media (min-width: 1025px) and (max-width: 1200px) {
.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 __DIR__.'/language.php';
$template = new Template(get_lang('SignIn'),false,false,false,false,true,true);
/**
* Homemade micro-controller.
*/
@ -15,107 +18,42 @@ if (isset($_GET['loginFailed'])) {
if (isset($_GET['error'])) {
switch ($_GET['error']) {
case 'account_expired':
$error_message = custompages_get_lang('AccountExpired');
$error_message = get_lang('AccountExpired');
break;
case 'account_inactive':
$error_message = custompages_get_lang('AccountInactive');
$error_message = get_lang('AccountInactive');
break;
case 'user_password_incorrect':
$error_message = custompages_get_lang('InvalidId');
$error_message = get_lang('InvalidId');
break;
case 'access_url_inactive':
$error_message = custompages_get_lang('AccountURLInactive');
$error_message = get_lang('AccountURLInactive');
break;
default:
$error_message = custompages_get_lang('InvalidId');
$error_message = get_lang('InvalidId');
}
} else {
$error_message = get_lang('InvalidId');
}
}
$rootWeb = api_get_path('WEB_PATH');
/**
* 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
$('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();
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">
if (isset($error_message)) {
$template->assign('error', $error_message);
}
<?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
} ?>
$flash = Display::getFlashToString();
Display::cleanFlashMessages();
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/lostPassword.php?language=<?php echo api_get_interface_language(); ?>">
<?php echo custompages_get_lang('LostPassword'); ?>
</a>
</div>
</div> <!-- #form -->
<div id="footer">
<img src="<?php echo api_get_path(WEB_PATH); ?>/custompages/images/footer.png" />
</div> <!-- #footer -->
</div> <!-- #wrapper -->
</body>
</html>
if (api_get_setting('allow_registration') === 'true') {
$urlRegister = api_get_path(WEB_CODE_PATH).'auth/inscription.php?language='.api_get_interface_language();
$template->assign('url_register', $urlRegister);
}
$urlLostPassword = api_get_path(WEB_CODE_PATH).'auth/lostPassword.php?language='.api_get_interface_language();
$template->assign('url_lost_password', $urlLostPassword);
$template->assign('mgs_flash', $flash);
$template->assign('section_name', $this_section);
$layout = $template->get_template('custompage/login.tpl');
$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 __DIR__.'/language.php';
$rootWeb = api_get_path('WEB_PATH');
?>
<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>
$template = new Template(get_lang('LostPassword'),false,false,false,false,true,true);
<link rel="stylesheet" type="text/css" href="<?php echo $rootWeb; ?>web/assets/bootstrap/dist/css/bootstrap.min.css" />
<script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/bootstrap/dist/js/bootstrap.min.js"></script>
$error = null;
<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'])) {
echo '<div id="registration-form-error" class="form-error"><ul>'.$content['info'].'</ul></div>';
}
echo isset($content['form']) ? $content['form'] : '';
?>
</div> <!-- #form -->
<div id="footer">
<img src="../../custompages/images/footer.png" />
</div> <!-- #footer -->
</div> <!-- #wrapper -->
</body>
</html>
if (isset($content['info']) && !empty($content['info'])) {
$error = $content['info'];
}
$template->assign('error');
$template->assign('form', $content['form']);
$layout = $template->get_template('custompage/lostpassword.tpl');
$content = $template->fetch($layout);
$template->assign('content', $content);
$template->display_blank_template();

@ -10,6 +10,9 @@
*/
require_once api_get_path(SYS_PATH).'main/inc/global.inc.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.
* 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'])) {
$content['form']->removeElement('extra_mail_notify_group_message');
}
if (isset($content['form']->_elementIndex['status'])) {
$content['form']->removeElement('status');
$content['form']->removeElement('status');
}
$rootWeb = api_get_path('WEB_PATH');
// Deprecated since 2015-03-26
/**
* 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>
$content['form']->removeElement('official_code');
$content['form']->removeElement('phone');
$template->assign('form', $content['form']->returnForm());
$layout = $template->get_template('custompage/registration.tpl');
$content = $template->fetch($layout);
$template->assign('content', $content);
$template->display_blank_template();

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;
if (api_get_setting('allow_terms_conditions') === 'true') {
$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 ||
$showTerms
) {
$form->addButtonNext(get_lang('RegisterUser'));
$form->addButton('register',get_lang('RegisterUser'),null,'primary','btn-block');
$formContainsSendButton = true;
}
}

@ -34,15 +34,6 @@ $tool_name = get_lang('LostPassword');
if ($reset && $userId) {
$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::return_message($messageText, 'info', false)
);
@ -50,7 +41,7 @@ if ($reset && $userId) {
exit;
}
$form = new FormValidator('lost_password');
$form = new FormValidator('lost_password','post','','',[],FormValidator::LAYOUT_GRID);
$form->addHeader($tool_name);
$form->addText(
'user',
@ -91,7 +82,7 @@ if ($allowCaptcha) {
$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()) {
$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_GLOBAL', 'global');
define('SECTION_INCLUDE', 'include');
define('SECTION_CUSTOMPAGE', 'custompage');
// CONSTANT name for local authentication source
define('PLATFORM_AUTH_SOURCE', 'platform');

@ -19,13 +19,13 @@ class FormValidator extends HTML_QuickForm
/**
* Constructor.
*
* @param string $name Name of the form
* @param string $method (optional) Method ('post' (default) or 'get')
* @param string $action (optional) Action (default is $PHP_SELF)
* @param string $target (optional) Form's target defaults to '_self'
* @param mixed $attributes (optional) Extra attributes for <form> tag
* @param string $name Name of the form
* @param string $method (optional) Method ('post' (default) or 'get')
* @param string $action (optional) Action (default is $PHP_SELF)
* @param string $target (optional) Form's target defaults to '_self'
* @param mixed $attributes (optional) Extra attributes for <form> tag
* @param string $layout
* @param bool $trackSubmit (optional) Whether to track if the form was
* @param bool $trackSubmit (optional) Whether to track if the form was
* submitted by adding a special hidden field (default = true)
*/
public function __construct(
@ -36,7 +36,8 @@ class FormValidator extends HTML_QuickForm
$attributes = [],
$layout = self::LAYOUT_HORIZONTAL,
$trackSubmit = true
) {
)
{
// Default form class.
if (is_array($attributes) && !isset($attributes['class']) || empty($attributes)) {
$attributes['class'] = 'form-horizontal';
@ -102,7 +103,7 @@ class FormValidator extends HTML_QuickForm
//Set required field template
$this->setRequiredNote(
'<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>'
'<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>'
);
$noteTemplate = <<<EOT
@ -133,15 +134,7 @@ EOT;
{
return '
<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>
<form{attributes}>
<div class="form_list">
@ -152,9 +145,9 @@ EOT;
}
/**
* @return string
* @todo this function should be added in the element class
*
* @return string
*/
public function getDefaultElementTemplate()
{
@ -203,10 +196,10 @@ EOT;
* Adds a text field to the form.
* A trim-filter is attached to the field.
*
* @param string|array $label The label for the form-element
* @param string $name The element name
* @param bool $required (optional) Is the form-element required (default=true)
* @param array $attributes (optional) List of attributes for the form-element
* @param string|array $label The label for the form-element
* @param string $name The element name
* @param bool $required (optional) Is the form-element required (default=true)
* @param array $attributes (optional) List of attributes for the form-element
*
* @return HTML_QuickForm_text
*/
@ -244,14 +237,14 @@ EOT;
*
* @param string $name
* @param string $label
* @param bool $required
* @param array $attributes
* @param bool $required
* @param array $attributes
*/
public function addDateRangePicker($name, $label, $required = true, $attributes = [])
{
$this->addElement('date_range_picker', $name, $label, $attributes);
$this->addElement('hidden', $name.'_start');
$this->addElement('hidden', $name.'_end');
$this->addElement('hidden', $name . '_start');
$this->addElement('hidden', $name . '_end');
if ($required) {
$this->addRule($name, get_lang('ThisFieldIsRequired'), 'required');
@ -261,7 +254,7 @@ EOT;
/**
* @param string $name
* @param string $label
* @param array $attributes
* @param array $attributes
*
* @return DatePicker
*/
@ -273,7 +266,7 @@ EOT;
/**
* @param string $name
* @param string $label
* @param array $attributes
* @param array $attributes
*
* @return mixed
*/
@ -285,12 +278,12 @@ EOT;
/**
* @param string $name
* @param string $label
* @param array $options
* @param array $attributes
* @param array $options
* @param array $attributes
*
* @return HTML_QuickForm_element
* @throws Exception
*
* @return HTML_QuickForm_element
*/
public function addSelectAjax($name, $label, $options = [], $attributes = [])
{
@ -308,9 +301,9 @@ EOT;
}
/**
* @param string $name
* @param string $name
* @param string|array $label
* @param array $attributes
* @param array $attributes
*
* @return DateTimePicker
*/
@ -320,9 +313,9 @@ EOT;
}
/**
* @param string $name
* @param string $name
* @param string|array $label
* @param array $attributes
* @param array $attributes
*
* @return DateTimeRangePicker
*/
@ -334,7 +327,7 @@ EOT;
/**
* @param string $name
* @param string $value
* @param array $attributes
* @param array $attributes
*/
public function addHidden($name, $value, $attributes = [])
{
@ -342,10 +335,10 @@ EOT;
}
/**
* @param string $name
* @param string $name
* @param string|array $label
* @param array $attributes
* @param bool $required
* @param array $attributes
* @param bool $required
*
* @return HTML_QuickForm_textarea
*/
@ -363,12 +356,12 @@ EOT;
/**
* @param string $name
* @param string $label
* @param string $icon font-awesome
* @param string $style default|primary|success|info|warning|danger|link
* @param string $size large|default|small|extra-small
* @param string $class Example plus is transformed to icon fa fa-plus
* @param array $attributes
* @param bool $createElement
* @param string $icon font-awesome
* @param string $style default|primary|success|info|warning|danger|link
* @param string $size large|default|small|extra-small
* @param string $class Example plus is transformed to icon fa fa-plus
* @param array $attributes
* @param bool $createElement
*
* @return HTML_QuickForm_button
*/
@ -381,7 +374,8 @@ EOT;
$class = null,
$attributes = [],
$createElement = false
) {
)
{
if ($createElement) {
return $this->createElement(
'button',
@ -410,9 +404,9 @@ EOT;
/**
* Returns a button with the primary color and a check mark.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -433,9 +427,9 @@ EOT;
/**
* Returns a cancel button.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -456,10 +450,10 @@ EOT;
/**
* Returns a button with the primary color and a "plus" icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param array $attributes Additional attributes
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param array $attributes Additional attributes
*
* @return HTML_QuickForm_button
*/
@ -480,9 +474,9 @@ EOT;
/**
* Returns a button with the primary color and a pencil icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -503,9 +497,9 @@ EOT;
/**
* Returns a button with the danger color and a trash icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -526,9 +520,9 @@ EOT;
/**
* Returns a move style button.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -549,22 +543,23 @@ EOT;
/**
* Returns a button with the primary color and a paper-plane icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param array $attributes
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param array $attributes
* @param $size
* @param $class
* @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(
$name,
$label,
'paper-plane',
'primary',
null,
null,
$size,
$class,
$attributes,
$createElement
);
@ -574,7 +569,7 @@ EOT;
* Returns a button with the default (grey?) color and a magnifier icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param string $name Element name (for form treatment purposes)
*
* @return HTML_QuickForm_button
*/
@ -590,9 +585,9 @@ EOT;
/**
* Returns a button with the primary color and a right-pointing arrow icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param array $attributes Additional attributes
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param array $attributes Additional attributes
*
* @return HTML_QuickForm_button
*/
@ -612,9 +607,9 @@ EOT;
/**
* Returns a button with the primary color and a check mark icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -635,9 +630,9 @@ EOT;
/**
* Returns a button with the primary color and a check-mark icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -658,9 +653,9 @@ EOT;
/**
* Shortcut to filter button.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -681,9 +676,9 @@ EOT;
/**
* Shortcut to reset button.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -723,9 +718,9 @@ EOT;
/**
* Returns a button with the primary color and an upload icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -746,9 +741,9 @@ EOT;
/**
* Returns a button with the primary color and a download icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -769,9 +764,9 @@ EOT;
/**
* Returns a button with the primary color and a magnifier icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -792,9 +787,9 @@ EOT;
/**
* Returns a button with the primary color and a copy (double sheet) icon.
*
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
* @param string $label Text appearing on the button
* @param string $name Element name (for form treatment purposes)
* @param bool $createElement Whether to use the create or add method
*
* @return HTML_QuickForm_button
*/
@ -816,7 +811,7 @@ EOT;
* @param string $name
* @param string $label
* @param string $text
* @param array $attributes
* @param array $attributes
*
* @return HTML_QuickForm_checkbox
*/
@ -828,8 +823,8 @@ EOT;
/**
* @param string $name
* @param string $label
* @param array $options
* @param array $attributes
* @param array $options
* @param array $attributes
*
* @return HTML_QuickForm_group
*/
@ -853,8 +848,8 @@ EOT;
/**
* @param string $name
* @param string $label
* @param array $options
* @param array $attributes
* @param array $options
* @param array $attributes
*
* @return HTML_QuickForm_group
*/
@ -873,9 +868,9 @@ EOT;
/**
* @param string $name
* @param mixed $label String, or array if form element with a comment
* @param array $options
* @param array $attributes
* @param mixed $label String, or array if form element with a comment
* @param array $options
* @param array $attributes
*
* @return HTML_QuickForm_select
*/
@ -888,9 +883,9 @@ EOT;
* @param $name
* @param $label
* @param $collection
* @param array $attributes
* @param bool $addNoneOption
* @param string $textCallable set a function getStringValue() by default __toString()
* @param array $attributes
* @param bool $addNoneOption
* @param string $textCallable set a function getStringValue() by default __toString()
*
* @return HTML_QuickForm_element
*/
@ -901,7 +896,8 @@ EOT;
$attributes = [],
$addNoneOption = false,
$textCallable = ''
) {
)
{
$options = [];
if ($addNoneOption) {
@ -924,7 +920,7 @@ EOT;
/**
* @param string $label
* @param string $text
* @param bool $createElement
* @param bool $createElement
*
* @return HTML_QuickForm_Element
*/
@ -954,11 +950,11 @@ EOT;
/**
* @param string $name
* @param string $label
* @param array $attributes
* @param array $attributes
*
* @return HTML_QuickForm_file
* @throws Exception if the file doesn't have an id
*
* @return HTML_QuickForm_file
*/
public function addFile($name, $label, $attributes = [])
{
@ -970,19 +966,19 @@ EOT;
}
$this->addHtml(
'
<div class="form-group" id="'.$id.'-form-group" style="display: none;">
<div class="form-group" id="' . $id . '-form-group" style="display: none;">
<div class="col-sm-offset-2 col-sm-8">
<div id="'.$id.'_crop_image" class="cropCanvas thumbnail">
<img id="'.$id.'_preview_image">
<div id="' . $id . '_crop_image" class="cropCanvas thumbnail">
<img id="' . $id . '_preview_image">
</div>
<button class="btn btn-primary" type="button" name="cropButton" id="'.$id.'_crop_button">
<em class="fa fa-crop"></em> '.get_lang('CropYourPicture').'
<button class="btn btn-primary" type="button" name="cropButton" id="' . $id . '_crop_button">
<em class="fa fa-crop"></em> ' . get_lang('CropYourPicture') . '
</button>
</div>
</div>'
);
$this->addHidden($id.'_crop_result', '');
$this->addHidden($id.'_crop_image_base_64', '');
$this->addHidden($id . '_crop_result', '');
$this->addHidden($id . '_crop_image_base_64', '');
}
return $element;
@ -1004,25 +1000,25 @@ EOT;
/**
* Draws a panel of options see the course_info/infocours.php page.
*
* @param string $name internal name
* @param string $title visible title
* @param array $groupList list of group or elements
* @param string $name internal name
* @param string $title visible title
* @param array $groupList list of group or elements
*/
public function addPanelOption($name, $title, $groupList)
{
$this->addHtml('<div class="panel panel-default">');
$this->addHtml(
'
<div class="panel-heading" role="tab" id="heading-'.$name.'-settings">
<div class="panel-heading" role="tab" id="heading-' . $name . '-settings">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion"
href="#collapse-'.$name.'-settings" aria-expanded="false" aria-controls="collapse-'.$name.'-settings">
href="#collapse-' . $name . '-settings" aria-expanded="false" aria-controls="collapse-' . $name . '-settings">
'
);
$this->addHtml($title);
$this->addHtml('</a></h4></div>');
$this->addHtml('<div id="collapse-'.$name.'-settings" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="heading-'.$name.'-settings">
$this->addHtml('<div id="collapse-' . $name . '-settings" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="heading-' . $name . '-settings">
<div class="panel-body">
');
@ -1044,11 +1040,11 @@ EOT;
/**
* Adds a HTML-editor to the form.
*
* @param string $name
* @param string|array $label The label for the form-element
* @param bool $required (optional) Is the form-element required (default=true)
* @param bool $fullPage (optional) When it is true, the editor loads completed html code for a full page
* @param array $config (optional) Configuration settings for the online editor
* @param string $name
* @param string|array $label The label for the form-element
* @param bool $required (optional) Is the form-element required (default=true)
* @param bool $fullPage (optional) When it is true, the editor loads completed html code for a full page
* @param array $config (optional) Configuration settings for the online editor
*/
public function addHtmlEditor(
$name,
@ -1056,7 +1052,8 @@ EOT;
$required = true,
$fullPage = false,
$config = []
) {
)
{
$attributes = [];
$attributes['rows'] = isset($config['rows']) ? $config['rows'] : 15;
$attributes['cols'] = isset($config['cols']) ? $config['cols'] : 80;
@ -1102,8 +1099,8 @@ EOT;
if ($geolocalization && $gMapsPlugin->javascriptIncluded === false) {
$gmapsApiKey = $gMapsPlugin->get('api_key');
$url = '//maps.googleapis.com/maps/api/js?key='.$gmapsApiKey;
$this->addHtml('<script type="text/javascript" src="'.$url.'" ></script>');
$url = '//maps.googleapis.com/maps/api/js?key=' . $gmapsApiKey;
$this->addHtml('<script type="text/javascript" src="' . $url . '" ></script>');
$gMapsPlugin->javascriptIncluded = true;
}
@ -1115,9 +1112,9 @@ EOT;
);
$this->addHidden(
$name.'_coordinates',
$name . '_coordinates',
'',
['id' => $name.'_coordinates']
['id' => $name . '_coordinates']
);
$this->applyFilter($name, 'stripslashes');
@ -1162,16 +1159,16 @@ EOT;
$this->with_progress_bar = true;
$id = $this->getAttribute('id');
$this->updateAttributes("onsubmit=\"javascript: addProgress('".$id."')\"");
$this->addHtml('<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>');
$this->updateAttributes("onsubmit=\"javascript: addProgress('" . $id . "')\"");
$this->addHtml('<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>');
}
/**
* This function has been created for avoiding changes directly within QuickForm class.
* When we use it, the element is threated as 'required' to be dealt during validation.
*
* @param array $elements The array of elements
* @param string $message The message displayed
* @param array $elements The array of elements
* @param string $message The message displayed
*/
public function add_multiple_required_rule($elements, $message)
{
@ -1203,7 +1200,7 @@ EOT;
$element->setLayout($this->getLayout());
$elementError = parent::getElementError($element->getName());
if (!is_null($elementError)) {
$returnValue .= Display::return_message($elementError, 'warning').'<br />';
$returnValue .= Display::return_message($elementError, 'warning') . '<br />';
break;
}
}
@ -1214,7 +1211,7 @@ EOT;
if (isset($this->with_progress_bar) && $this->with_progress_bar) {
// @todo improve UI
$returnValue .= '<br />
<div id="loading_div_'.$id.'" class="loading_div" style="display:none;margin-left:40%; margin-top:10px; height:50px;">
<div id="loading_div_' . $id . '" class="loading_div" style="display:none;margin-left:40%; margin-top:10px; height:50px;">
<div class="wobblebar-loader"></div>
</div>
';
@ -1253,10 +1250,10 @@ EOT;
/**
* Adds a input of type url to the form.
*
* @param string $name The label for the form-element
* @param string $label The element name
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
* @param string $name The label for the form-element
* @param string $label The element name
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
*/
public function addUrl($name, $label, $required = true, $attributes = [])
{
@ -1273,17 +1270,18 @@ EOT;
* Adds a text field for letters to the form.
* A trim-filter is attached to the field.
*
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
*/
public function addTextLettersOnly(
$name,
$label,
$required = false,
$attributes = []
) {
)
{
$attributes = array_merge(
$attributes,
[
@ -1319,8 +1317,8 @@ EOT;
/**
* @param string $name
* @param string $label
* @param array $attributes
* @param bool $required
* @param array $attributes
* @param bool $required
*
* @return HTML_QuickForm_element
*/
@ -1339,17 +1337,18 @@ EOT;
* Adds a text field for alphanumeric characters to the form.
* A trim-filter is attached to the field.
*
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
*/
public function addTextAlphanumeric(
$name,
$label,
$required = false,
$attributes = []
) {
)
{
$attributes = array_merge(
$attributes,
[
@ -1385,11 +1384,11 @@ EOT;
/**
* @param string $name
* @param $label
* @param bool $required
* @param bool $required
* @param array $attributes
* @param bool $allowNegative
* @param int $minValue
* @param null $maxValue
* @param bool $allowNegative
* @param int $minValue
* @param null $maxValue
*/
public function addFloat(
$name,
@ -1399,7 +1398,8 @@ EOT;
$allowNegative = false,
$minValue = null,
$maxValue = null
) {
)
{
$this->addElement(
'FloatNumber',
$name,
@ -1465,17 +1465,18 @@ EOT;
* Adds a text field for letters and spaces to the form.
* A trim-filter is attached to the field.
*
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
*/
public function addTextLettersAndSpaces(
$name,
$label,
$required = false,
$attributes = []
) {
)
{
$attributes = array_merge(
$attributes,
[
@ -1512,17 +1513,18 @@ EOT;
* Adds a text field for alphanumeric and spaces characters to the form.
* A trim-filter is attached to the field.
*
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
* @param string $name The element name
* @param string $label The label for the form-element
* @param bool $required Optional. Is the form-element required (default=true)
* @param array $attributes Optional. List of attributes for the form-element
*/
public function addTextAlphanumericAndSpaces(
$name,
$label,
$required = false,
$attributes = []
) {
)
{
$attributes = array_merge(
$attributes,
[
@ -1566,17 +1568,17 @@ EOT;
$this->addHtml('
<div class="description-upload">
'.get_lang('ClickToSelectOrDragAndDropMultipleFilesOnTheUploadField').'
' . get_lang('ClickToSelectOrDragAndDropMultipleFilesOnTheUploadField') . '
</div>
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>'.get_lang('AddFiles').'</span>
<span>' . get_lang('AddFiles') . '</span>
<!-- The file input field used as target for the file upload widget -->
<input id="'.$inputName.'" type="file" name="files[]" multiple>
<input id="' . $inputName . '" type="file" name="files[]" multiple>
</span>
<div id="dropzone">
<div class="button-load">
'.get_lang('UploadFiles').'
' . get_lang('UploadFiles') . '
</div>
</div>
<br />
@ -1590,7 +1592,7 @@ EOT;
/**
* @param string $elementName
* @param string $groupName if element is inside a group
* @param string $groupName if element is inside a group
*
* @throws Exception
*/
@ -1598,7 +1600,7 @@ EOT;
{
// Constant defined in old config/profile.conf.php
if (CHECK_PASS_EASY_TO_FIND === true) {
$message = get_lang('PassTooEasy').': '.api_generate_password();
$message = get_lang('PassTooEasy') . ': ' . api_generate_password();
if (!empty($groupName)) {
$groupObj = $this->getElement($groupName);
@ -1634,14 +1636,14 @@ EOT;
* 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.
*
* @see \UserAvatar
*
* @param string $name
* @param string $label
* @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
* @see \UserAvatar
*
*/
public function addUserAvatar($name, $label, $imageSize = 'small', $subtitle = '')
{
@ -1670,18 +1672,18 @@ EOT;
}
}
$url = api_get_path(WEB_AJAX_PATH).'mail.ajax.php?a=select_option';
$typeNoDots = 'email_template_option_'.str_replace('.tpl', '', $type);
$url = api_get_path(WEB_AJAX_PATH) . 'mail.ajax.php?a=select_option';
$typeNoDots = 'email_template_option_' . str_replace('.tpl', '', $type);
$this->addSelect(
'email_template_option['.$type.']',
'email_template_option[' . $type . ']',
$name,
$options,
['id' => $typeNoDots]
);
$templateNoDots = 'email_template_'.str_replace('.tpl', '', $type);
$templateNoDotsBlock = 'email_template_block_'.str_replace('.tpl', '', $type);
$this->addHtml('<div id="'.$templateNoDotsBlock.'" style="display:none">');
$templateNoDots = 'email_template_' . str_replace('.tpl', '', $type);
$templateNoDotsBlock = 'email_template_block_' . str_replace('.tpl', '', $type);
$this->addHtml('<div id="' . $templateNoDotsBlock . '" style="display:none">');
$this->addTextarea(
$templateNoDots,
get_lang('Preview'),
@ -1723,7 +1725,7 @@ EOT;
}
/**
* @param string $url page that will handle the upload
* @param string $url page that will handle the upload
* @param string $inputName
* @param string $urlToRedirect
*/
@ -1738,25 +1740,25 @@ EOT;
<script>
$(function () {
'use strict';
$('#".$this->getAttribute('id')."').submit(function() {
$('#" . $this->getAttribute('id') . "').submit(function() {
return false;
});
$('#dropzone').on('click', function() {
$('#".$inputName."').click();
$('#" . $inputName . "').click();
});
var url = '".$url."';
var url = '" . $url . "';
var uploadButton = $('<button/>')
.addClass('btn btn-primary')
.prop('disabled', true)
.text('".addslashes(get_lang('Loading'))."')
.text('" . addslashes(get_lang('Loading')) . "')
.on('click', function () {
var \$this = $(this),
data = \$this.data();
\$this
.off('click')
.text('".addslashes(get_lang('Cancel'))."')
.text('" . addslashes(get_lang('Cancel')) . "')
.on('click', function () {
\$this.remove();
data.abort();
@ -1766,7 +1768,7 @@ EOT;
});
});
$('#".$inputName."').fileupload({
$('#" . $inputName . "').fileupload({
url: url,
dataType: 'json',
// Enable image resizing, except for Android and Opera,
@ -1790,7 +1792,7 @@ EOT;
if (file.preview) {
data.context.prepend($('<div class=\"col-sm-4\">').html(file.preview));
} else {
data.context.prepend($('<div class=\"col-sm-4\">').html('".$icon."'));
data.context.prepend($('<div class=\"col-sm-4\">').html('" . $icon . "'));
}
if (index + 1 === data.files.length) {
data.context.find('button')
@ -1827,15 +1829,15 @@ EOT;
// Update file name with new one from Chamilo
$(data.context.children()[index]).parent().find('.file_name').html(file.name);
var message = $('<div class=\"col-sm-3\">').html(
$('<span class=\"message-image-success\"/>').text('".addslashes(get_lang('UplUploadSucceeded'))."')
$('<span class=\"message-image-success\"/>').text('" . addslashes(get_lang('UplUploadSucceeded')) . "')
);
$(data.context.children()[index]).parent().append(message);
});
$('#dropzone').removeClass('hover');
".$redirectCondition."
" . $redirectCondition . "
}).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index) {
var failedMessage = '".addslashes(get_lang('UplUploadFailed'))."';
var failedMessage = '" . addslashes(get_lang('UplUploadFailed')) . "';
var error = $('<div class=\"col-sm-3\">').html(
$('<span class=\"alert alert-danger\"/>').text(failedMessage)
);
@ -1862,7 +1864,7 @@ EOT;
* Cleans HTML text filter.
*
* @param string $html HTML to clean
* @param int $mode (optional)
* @param int $mode (optional)
*
* @return string The cleaned HTML
*/

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

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

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

@ -662,6 +662,12 @@ class Template
$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(ChamiloApi::getEditorBlockStylePath());
@ -1833,14 +1839,14 @@ class Template
private function assignFavIcon()
{
// 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
$favicoThemeUrl = api_get_path(SYS_CSS_PATH).$this->themeDir.'images/';
//If exist pick the current chamilo theme favicon
if (is_file($favicoThemeUrl.'favicon.ico')) {
$favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_CSS_PATH).$this->themeDir.'images/favicon.ico" type="image/x-icon" />';
if (is_file($favicoThemeUrl.'favicon.png')) {
$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()) {
@ -1857,7 +1863,7 @@ class Template
$icon_real_homep = api_get_path(SYS_HOME_PATH).$clean_url;
//we create the new dir for the new sites
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