From a5a8f101564a94c182867c77a760b6aef1f3e2d2 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 4 Mar 2011 17:38:10 +0100 Subject: [PATCH] Fixing group add button --- main/social/groups.php | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/main/social/groups.php b/main/social/groups.php index ad84305ee9..dc3e2aa912 100755 --- a/main/social/groups.php +++ b/main/social/groups.php @@ -511,13 +511,14 @@ if ($group_id != 0 ) { $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); } if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') { - $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; - $my_group_content = $create_group_item. $my_group_content; + $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; + $my_group_content = $create_group_item. $my_group_content; } else { - if (api_is_allowed_to_edit(null,true)) { - $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; - $my_group_content = $create_group_item. $my_group_content; - } + + if (api_is_allowed_to_edit(null,true)) { + $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; + $my_group_content = $create_group_item. $my_group_content; + } } break; @@ -544,19 +545,19 @@ if ($group_id != 0 ) { break; } } else { - if (count($grid_my_groups) > 0) { + if (count($grid_my_groups) > 0) { //echo '

'.get_lang('MyGroups').'

'; - $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); - if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') { - $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; - $my_group_content = $create_group_item. $my_group_content; - } else { - if (api_is_allowed_to_edit(null,true)) { - $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; - $my_group_content = $create_group_item. $my_group_content; - } - } + $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); } + if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') { + $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; + $my_group_content = $create_group_item. $my_group_content; + } else { + if (api_is_allowed_to_edit(null,true)) { + $create_group_item = ''.Display::return_icon('group_add.png',get_lang('CreateASocialGroup'),array('hspace'=>'6','style'=>'float:left')).get_lang('CreateASocialGroup').''; + $my_group_content = $create_group_item. $my_group_content; + } + } if (count($grid_newest_groups) > 0) { //echo '

'.get_lang('Newest').'

'; $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));