Fix group images #3805

pull/3890/head
Julio Montoya 5 years ago
parent df36be9960
commit 3df10a84d0
  1. 2
      public/main/inc/lib/formvalidator/FormValidator.class.php
  2. 2
      public/main/inc/lib/social.lib.php
  3. 10
      public/main/inc/lib/usergroup.lib.php
  4. 3
      public/main/social/group_view.php
  5. 10
      public/main/social/groups.php
  6. 6
      public/main/template/default/social/group_view.html.twig
  7. 10
      public/main/template/default/social/groups.html.twig

@ -30,7 +30,7 @@ class FormValidator extends HTML_QuickForm
public function __construct( public function __construct(
string $name, string $name,
string $method = 'post', string $method = 'post',
string $action = '', ?string $action = '',
?string $target = '', ?string $target = '',
?array $attributes = [], ?array $attributes = [],
string $layout = self::LAYOUT_HORIZONTAL, string $layout = self::LAYOUT_HORIZONTAL,

@ -3074,7 +3074,7 @@ class SocialManager extends UserManager
GROUP_IMAGE_SIZE_BIG GROUP_IMAGE_SIZE_BIG
); );
$result['picture'] = '<img class="img-responsive" src="'.$picture['file'].'" />'; $result['picture'] = '<img class="img-responsive" src="'.$picture.'" />';
$group_actions = '<div class="group-more"><a class="btn btn-default" href="groups.php?#tab_browse-2">'. $group_actions = '<div class="group-more"><a class="btn btn-default" href="groups.php?#tab_browse-2">'.
get_lang('See more').'</a></div>'; get_lang('See more').'</a></div>';
$group_info = '<div class="description"><p>'.cut($result['description'], 120, true)."</p></div>"; $group_info = '<div class="description"><p>'.cut($result['description'], 120, true)."</p></div>";

@ -4,6 +4,7 @@
use Chamilo\CoreBundle\Entity\Usergroup as UserGroupEntity; use Chamilo\CoreBundle\Entity\Usergroup as UserGroupEntity;
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/** /**
* Class UserGroup. * Class UserGroup.
@ -1599,14 +1600,7 @@ class UserGroup extends Model
return true; return true;
} }
/** public function manageFileUpload(UserGroupEntity $userGroup, UploadedFile $picture, string $cropParameters = ''): bool
* @param UserGroupEntity $groupId
* @param string $picture
* @param string $cropParameters
*
* @return bool
*/
public function manageFileUpload($userGroup, $picture, $cropParameters = '')
{ {
if ($userGroup) { if ($userGroup) {
$illustrationRepo = Container::getIllustrationRepository(); $illustrationRepo = Container::getIllustrationRepository();

@ -349,5 +349,4 @@ $tpl->assign('social_forum', $socialForum);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$tpl->assign('list_members', $listMembers); $tpl->assign('list_members', $listMembers);
$tpl->assign('list_topic', $listTopic); $tpl->assign('list_topic', $listTopic);
$social_layout = $tpl->get_template('social/group_view.tpl'); $tpl->display($tpl->get_template('social/group_view.html.twig'));
$tpl->display($social_layout);

@ -319,7 +319,7 @@ if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) {
} else { } else {
$my_group_content = '<span class="muted">'.get_lang('(none)').'</span>'; $my_group_content = '<span class="muted">'.get_lang('(none)').'</span>';
} }
if ('true' == api_get_setting('allow_students_to_create_groups_in_social')) { if ('true' === api_get_setting('allow_students_to_create_groups_in_social')) {
$create_group_item = $create_group_item =
'<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
get_lang('Create a social group').'</a>'; get_lang('Create a social group').'</a>';
@ -377,11 +377,9 @@ if (isset($_GET['view']) && 'mygroups' == $_GET['view']) {
$show_menu = $_GET['view']; $show_menu = $_GET['view'];
} }
$social_menu_block = SocialManager::show_social_menu($show_menu); //$social_menu_block = SocialManager::show_social_menu($show_menu);
$templateName = 'social/groups.tpl';
$tpl->setHelp('Groups'); $tpl->setHelp('Groups');
$tpl->assign('social_menu_block', $social_menu_block); //$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template($templateName); $tpl->display($tpl->get_template('social/groups.html.twig'));
$tpl->display($social_layout);

@ -4,12 +4,6 @@
{% block content %} {% block content %}
{% autoescape false %} {% autoescape false %}
<div class="row"> <div class="row">
<div class="col-md-4">
{% set avatar %}
{% include '@ChamiloCore/Social/user_block.html.twig' %}
{% endset %}
{{ macro.panel('', avatar ) }}
</div>
<div class="col-md-8"> <div class="col-md-8">
<div class="sm-groups-content"> <div class="sm-groups-content">
{{ create_link }} {{ create_link }}

@ -4,15 +4,7 @@
{% block content %} {% block content %}
{% autoescape false %} {% autoescape false %}
<div class="row"> <div class="row">
<div class="col-md-4"> {{ social_right_content }}
{% set avatar %}
{% include '@ChamiloCore/Social/user_block.html.twig' %}
{% endset %}
{{ macro.panel('', avatar ) }}
</div>
<div class="col-md-8">
{{ social_right_content }}
</div>
</div> </div>
{% endautoescape %} {% endautoescape %}
{% endblock %} {% endblock %}

Loading…
Cancel
Save