Esempio n. 1
0
function select_permission()
{
    checkPerm('view');
    require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php';
    require_once _base_ . '/lib/lib.userselector.php';
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('middlearea', 'lms');
    $obj_index = importVar('obj_index', false, '');
    // first step load selector
    $man_ma = new Man_MiddleArea();
    $acl_manager = new DoceboACLManager();
    $user_select = new UserSelector();
    $user_select->show_user_selector = TRUE;
    $user_select->show_group_selector = TRUE;
    $user_select->show_orgchart_selector = TRUE;
    $user_select->show_orgchart_simple_selector = false;
    //$user_select->multi_choice = TRUE;
    // try to load previous saved
    if (isset($_GET['load'])) {
        $selected = $man_ma->getObjIdstList($obj_index);
        if (is_array($selected)) {
            $user_select->resetSelection($selected);
        }
    }
    if (isset($_POST['okselector'])) {
        $selected = $user_select->getSelection($_POST);
        $re = $man_ma->setObjIdstList($obj_index, $selected);
        Util::jump_to('index.php?modname=middlearea&op=view_area&result=' . ($re ? 'ok' : 'err'));
    }
    cout(getTitleArea(array('index.php?modname=middlearea&amp;op=view_area' => $lang->def('_MIDDLE_AREA'), Lang::t('_VIEW_PERMISSION', 'standard')), 'middlearea') . '<div class="std_block">');
    $user_select->addFormInfo(Form::getHidden('obj_index', 'obj_index', $obj_index));
    $user_select->loadSelector('index.php?modname=middlearea&amp;op=select_permission', false, false, true);
    cout('</div>');
}