fix home course - refs #2681

pull/2877/head
Alex Aragón 7 years ago
parent ae6f5de617
commit 9c3d0c3379
  1. 1
      assets/css/scss/_forms.scss
  2. 4
      main/inc/introductionSection.inc.php
  3. 14
      main/inc/lib/formvalidator/FormValidator.class.php
  4. 54
      main/inc/lib/pear/HTML/QuickForm/button.php
  5. 2
      main/inc/lib/pear/HTML/QuickForm/textarea.php

@ -23,7 +23,6 @@ legend{
.btn{
@each $color, $value in $theme-colors-custom{
&.btn-#{$color}{
font-size: 12px;
background-color: $value;
border-color: darken($value, 10%);
color: color-yiq-const($value);

@ -59,8 +59,8 @@ $config = [
'Height' => '300',
];
$form->addHtmlEditor('intro_content', null, false, false, $config, ['card-full' => true]);
$form->addButtonSave(get_lang('SaveIntroText'), 'intro_cmdUpdate');
$form->addHtmlEditor('intro_content', null, false, false, $config, ['data-block' => true]);
$form->addButtonSave(get_lang('Save introductory text'), 'intro_cmdUpdate','success',false,['data-block'=> true]);
/* INTRODUCTION MICRO MODULE - COMMANDS SECTION (IF ALLOWED) */
$course_id = api_get_course_int_id();

@ -374,22 +374,24 @@ 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 string $style
* @param bool $createElement Whether to use the create or add method
*
* @param $attributes
* @return HTML_QuickForm_button
*/
public function addButtonSave($label, $name = 'submit', $createElement = false)
public function addButtonSave($label, $name = 'submit', $style = 'primary', $createElement = false, $attributes)
{
return $this->addButton(
$name,
$label,
'check',
'primary',
$style,
null,
null,
[],
$attributes,
$createElement
);
}

@ -226,30 +226,38 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
{element}
';
} else {
$template = '
<div class="form-group {error_class}">
<label {label-for} class="col-sm-'.$size[0].' control-label" >
<!-- BEGIN required --><span class="form_required">*</span><!-- END required -->
{label}
</label>
<div class="col-sm-'.$size[1].'">
{icon}
{element}
<!-- BEGIN label_2 -->
<p class="help-block">{label_2}</p>
<!-- END label_2 -->
if(isset($attributes['data-block']) && $attributes['data-block'] == true){
$template = '
<div class="form-group text-center">
{icon}
{element}
</div>
';
} else {
$template = '
<div class="form-group {error_class}">
<label {label-for} class="col-sm-'.$size[0].' control-label" >
<!-- BEGIN required --><span class="form_required">*</span><!-- END required -->
{label}
</label>
<div class="col-sm-'.$size[1].'">
{icon}
{element}
<!-- BEGIN label_2 -->
<p class="help-block">{label_2}</p>
<!-- END label_2 -->
<!-- BEGIN error -->
<span class="help-inline help-block">{error}</span>
<!-- END error -->
</div>
<div class="col-sm-'.$size[2].'">
<!-- BEGIN label_3 -->
{label_3}
<!-- END label_3 -->
</div>
</div>';
}
<!-- BEGIN error -->
<span class="help-inline help-block">{error}</span>
<!-- END error -->
</div>
<div class="col-sm-'.$size[2].'">
<!-- BEGIN label_3 -->
{label_3}
<!-- END label_3 -->
</div>
</div>';
}
return $template;
break;

@ -233,7 +233,7 @@ class HTML_QuickForm_textarea extends HTML_QuickForm_element
</div>
</div>';
if(isset($custom['card-full']) && $custom['card-full'] == true){
if(isset($custom['data-block']) && $custom['data-block'] == true){
$template = '
<label {label-for}>{label}</label>
<div class="card-textarea">

Loading…
Cancel
Save