コード例 #1
0
 $name = cut($result['name'], 20, true);
 if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
     $icon = Display::return_icon(
         'social_group_admin.png',
         get_lang('Admin'),
         array('style' => 'vertical-align:middle;width:16px;height:16px;')
     );
 } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
     $icon = Display::return_icon(
         'social_group_moderator.png',
         get_lang('Moderator'),
         array('style' => 'vertical-align:middle;width:16px;height:16px;')
     );
 }
 $count_users_group = count(
     GroupPortalManager::get_all_users_by_group($id)
 );
 if ($count_users_group == 1) {
     $count_users_group = $count_users_group . ' ' . get_lang(
             'Member'
         );
 } else {
     $count_users_group = $count_users_group . ' ' . get_lang(
             'Members'
         );
 }
 $picture = GroupPortalManager::get_picture_group(
     $result['id'],
     $result['picture_uri'],
     80
 );
コード例 #2
0
ファイル: profile.php プロジェクト: annickvdp/Chamilo1.9.10
            $icon = '';
            $name = cut($result['name'],CUT_GROUP_NAME,true);
            if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
                $icon = Display::return_icon(
                    'social_group_admin.png',
                    get_lang('Admin'),
                    array('style'=>'vertical-align:middle;width:16px;height:16px;')
                );
            } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
                $icon = Display::return_icon(
                    'social_group_moderator.png',
                    get_lang('Moderator'),
                    array('style'=>'vertical-align:middle;width:16px;height:16px;')
                );
            }
            $count_users_group = count(GroupPortalManager::get_all_users_by_group($id));
            if ($count_users_group == 1 ) {
                $count_users_group = $count_users_group.' '.get_lang('Member');
            } else {
                $count_users_group = $count_users_group.' '.get_lang('Members');
            }
            //$picture = GroupPortalManager::get_picture_group($result['id'], $result['picture_uri'],80);
            $item_name = $url_open.$name.$icon.$url_close;

            if ($result['description'] != '') {
                //$item_description = '<div class="box_shared_profile_group_description">'
                //.'<p class="social-groups-text4">'.cut($result['description'],100,true).'</p></div>';
            } else {
                //$item_description = '<div class="box_shared_profile_group_description">'
                //.'<span class="social-groups-text2"></span><p class="social-groups-text4"></p></div>';
            }
コード例 #3
0
ファイル: download.php プロジェクト: annickvdp/Chamilo1.9.10
// get message user id for inbox/outbox
$message_uid = '';
$message_type = array('inbox','outbox');
if (in_array($_GET['type'],$message_type)) {
	if ($_GET['type'] == 'inbox') {
		$message_uid = $row_users['user_receiver_id'];
	} else {
		$message_uid = $row_users['user_sender_id'];
	}
}

// allow to the correct user for download this file
$not_allowed_to_edit = false;
if (!empty($row_users['group_id'])) {
	$users_group = GroupPortalManager::get_all_users_by_group($row_users['group_id']);
	if (!in_array($current_uid,array_keys($users_group))) {
		$not_allowed_to_edit = true;
	}
} else {
	if ($current_uid != $message_uid) {
		$not_allowed_to_edit = true;
	}
}

if ($not_allowed_to_edit) {
	api_not_allowed();
	exit;
}

// set the path directory file