fix social wall - refs BT#15171

pull/3063/head
Alex Aragón 7 years ago
parent a1464dfbee
commit f35d202de5
  1. 4
      app/Resources/public/css/base.css
  2. 2
      index.php
  3. 53
      main/inc/lib/pear/HTML/QuickForm/button.php
  4. 6
      main/inc/lib/pear/HTML/QuickForm/file.php
  5. 15
      main/inc/lib/social.lib.php

@ -2847,7 +2847,7 @@ form .formw .freeze {
}
.js .input-file-trigger {
display: inline-block;
padding: 5px 15px;
padding: 6px 15px;
background: #f5f6f7;
color: #7a7a7a;
font-size: 12px;
@ -2862,7 +2862,7 @@ form .formw .freeze {
top: 0; left: 0;
opacity: 0;
padding: 5px 0;
width: 100%;
}
.js .input-file:hover + .input-file-trigger,
.js .input-file:focus + .input-file-trigger,

@ -195,7 +195,5 @@ if (isset($_GET['firstpage'])) {
api_delete_firstpage_parameter();
}
var_dump(api_get_user_info());
$controller->setGradeBookDependencyBar(api_get_user_id());
$controller->tpl->display_two_col_template();

@ -211,6 +211,7 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
public function getTemplate($layout)
{
$size = $this->getColumnsSize();
$attributes = $this->getAttributes();
if (empty($size)) {
$size = array(2, 8, 2);
@ -234,30 +235,38 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
';
break;
case FormValidator::LAYOUT_HORIZONTAL:
return '
<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].'">
if (isset($attributes['custom']) && $attributes['custom'] == true) {
$template = '
{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>';
';
} 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>';
}
return $template;
break;
case FormValidator::LAYOUT_BOX:
case FormValidator::LAYOUT_BOX_NO_LABEL:

@ -401,9 +401,6 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
case FormValidator::LAYOUT_HORIZONTAL:
if (isset($attributes['custom']) && $attributes['custom'] == true) {
$template = '
<div class="form-group">
<div class="col-sm-1"></div>
<div class="col-sm-10">
<div class="input-file-container">
{element}
<label tabindex="0" {label-for} class="input-file-trigger">
@ -411,9 +408,6 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
</label>
</div>
<p class="file-return"></p>
</div>
<div class="col-sm-1"></div>
</div>
<script type="text/javascript">
document.querySelector("html").classList.add(\'js\');

@ -2398,15 +2398,24 @@ class SocialManager extends UserManager
'aria-label' => $socialWallPlaceholder,
]
);
$form->addHtml('<div class="form-group">');
$form->addHtml('<div class="col-sm-4 col-md-offset-1">');
$form->addFile('picture', get_lang('UploadFile'),['custom'=> true]);
$form->addHidden('url_content', '');
$form->addHtml('</div>');
$form->addHtml('<div class="col-sm-6">');
$form->addButtonSend(
get_lang('Post'),
'wall_post_button',
false,
['cols-size' => [1, 10, 1]]
[
'cols-size' => [1, 10, 1],
'custom' => true
]
);
$form->addHtml('</div>');
$form->addHtml('</div>');
$form->addHidden('url_content', '');
$html = Display::panel($form->returnForm(), get_lang('SocialWall'));
return $html;

Loading…
Cancel
Save