当前位置: 首页>>代码示例>>PHP>>正文


PHP GroupManager::is_self_unregistration_allowed方法代码示例

本文整理汇总了PHP中GroupManager::is_self_unregistration_allowed方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManager::is_self_unregistration_allowed方法的具体用法?PHP GroupManager::is_self_unregistration_allowed怎么用?PHP GroupManager::is_self_unregistration_allowed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GroupManager的用法示例。


在下文中一共展示了GroupManager::is_self_unregistration_allowed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_lang

    Display::display_normal_message(get_lang('StudentDeletesHimself'));
}
echo '<div class="actions">';
echo '<a href="group.php">' . Display::return_icon('back.png', get_lang('BackToGroupList'), '', ICON_SIZE_MEDIUM) . '</a>';
/*
 * Register to group
 */
$subscribe_group = '';
if (GroupManager::is_self_registration_allowed($user_id, $current_group['id'])) {
    $subscribe_group = '<a class="btn btn-default" href="' . api_get_self() . '?selfReg=1&group_id=' . $current_group['id'] . '" onclick="javascript: if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES)) . "'" . ')) return false;">' . get_lang("RegIntoGroup") . '</a>';
}
/*
 * Unregister from group
 */
$unsubscribe_group = '';
if (GroupManager::is_self_unregistration_allowed($user_id, $current_group['id'])) {
    $unsubscribe_group = '<a class="btn btn-default" href="' . api_get_self() . '?selfUnReg=1" onclick="javascript: if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES)) . "'" . ')) return false;">' . get_lang("StudentUnsubscribe") . '</a>';
}
echo '&nbsp;</div>';
/*	Main Display Area */
$edit_url = '';
if (api_is_allowed_to_edit(false, true) || GroupManager::is_tutor_of_group(api_get_user_id(), api_get_group_id())) {
    $my_origin = isset($origin) ? $origin : '';
    $edit_url = '<a href="' . api_get_path(WEB_CODE_PATH) . 'group/settings.php?' . api_get_cidreq() . '&origin=' . $my_origin . '">' . Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL) . '</a>';
}
echo Display::page_header(Security::remove_XSS($current_group['name']) . ' ' . $edit_url . ' ' . $subscribe_group . ' ' . $unsubscribe_group);
if (!empty($current_group['description'])) {
    echo '<p>' . Security::remove_XSS($current_group['description']) . '</p>';
}
/*
 * Group Tools
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:group_space.php

示例2: isset

$my_group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null;
$my_msg = isset($_GET['msg']) ? Security::remove_XSS($_GET['msg']) : null;
$my_group = isset($_REQUEST['group']) ? Security::remove_XSS($_REQUEST['group']) : null;
$my_get_id1 = isset($_GET['id1']) ? Security::remove_XSS($_GET['id1']) : null;
$my_get_id2 = isset($_GET['id2']) ? Security::remove_XSS($_GET['id2']) : null;
$my_get_id = isset($_GET['id']) ? Security::remove_XSS($_GET['id']) : null;
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'self_reg':
            if (GroupManager::is_self_registration_allowed($_SESSION['_user']['user_id'], $my_group_id)) {
                GroupManager::subscribe_users($_SESSION['_user']['user_id'], $my_group_id);
                Display::display_confirmation_message(get_lang('GroupNowMember'));
            }
            break;
        case 'self_unreg':
            if (GroupManager::is_self_unregistration_allowed($_SESSION['_user']['user_id'], $my_group_id)) {
                GroupManager::unsubscribe_users($_SESSION['_user']['user_id'], $my_group_id);
                Display::display_confirmation_message(get_lang('StudentDeletesHimself'));
            }
            break;
        case 'show_msg':
            Display::display_confirmation_message($my_msg);
            break;
        case 'warning_message':
            Display::display_warning_message($my_msg);
            break;
        case 'success_message':
            Display::display_confirmation_message($my_msg);
            break;
    }
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:group.php

示例3: header

                GroupManager::setInvisible($my_get_id);
                Display::addFlash(Display::return_message(get_lang('ItemUpdated')));
                header("Location: {$currentUrl}");
                exit;
            }
            break;
        case 'self_reg':
            if (GroupManager::is_self_registration_allowed($userId, $my_group_id)) {
                GroupManager::subscribe_users($userId, $my_group_id);
                Display::addFlash(Display::return_message(get_lang('GroupNowMember')));
                header("Location: {$currentUrl}");
                exit;
            }
            break;
        case 'self_unreg':
            if (GroupManager::is_self_unregistration_allowed($userId, $my_group_id)) {
                GroupManager::unsubscribe_users($userId, $my_group_id);
                Display::addFlash(Display::return_message(get_lang('StudentDeletesHimself')));
                header("Location: {$currentUrl}");
                exit;
            }
            break;
    }
}
/*
 * Group-admin functions
 */
if (api_is_allowed_to_edit(false, true)) {
    // Post-actions
    if (isset($_POST['action'])) {
        switch ($_POST['action']) {
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:group.php

示例4: switch

}
/*	Header */
Display::display_header(Security::remove_XSS($current_group['name']) . ' ' . $edit_url . ' ' . $subscribe_group . ' ' . $unsubscribe_group, 'Group');
/*	Introduction section (editable by course admin) */
Display::display_introduction_section(TOOL_GROUP);
/*
 * User wants to register in this group
 */
if (!empty($_GET['selfReg']) && GroupManager::is_self_registration_allowed($user_id, $current_group['id'])) {
    GroupManager::subscribe_users($user_id, $current_group['id']);
    Display::display_normal_message(get_lang('GroupNowMember'));
}
/*
 * User wants to unregister from this group
 */
if (!empty($_GET['selfUnReg']) && GroupManager::is_self_unregistration_allowed($user_id, $current_group['id'])) {
    GroupManager::unsubscribe_users($user_id, $current_group['id']);
    Display::display_normal_message(get_lang('StudentDeletesHimself'));
}
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'show_msg':
            Display::display_normal_message(Security::remove_XSS($_GET['msg']));
            break;
    }
}
/*	Main Display Area */
$course_code = api_get_course_id();
$is_course_member = CourseManager::is_user_subscribed_in_real_or_linked_course(api_get_user_id(), $course_code);
// Edit the group.
if (!empty($current_group['description'])) {
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:group_space.php


注:本文中的GroupManager::is_self_unregistration_allowed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。