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


PHP FieldList::removeUserEntry方法代码示例

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


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

示例1: extendedParsing

 function extendedParsing($arrayState)
 {
     if (isset($arrayState['editgroupsave'])) {
         $idst = $_POST['idst'];
         $groupid = $_POST['groupid'];
         $description = $_POST['description'];
         $type = $_POST['group_type'];
         $show_on_platform = '';
         if (isset($_POST['show_on_platform'])) {
             while (list($code, ) = each($_POST['show_on_platform'])) {
                 $show_on_platform .= $code . ',';
             }
         }
         if ($idst !== '') {
             $this->aclManager->updateGroup($idst, $groupid, $description, NULL, $type, $show_on_platform);
         } else {
             $this->aclManager->registerGroup($groupid, $description, NULL, $type, $show_on_platform);
         }
     } elseif (isset($arrayState['deletegroup'])) {
         $idst = $_POST['idst'];
         if ($idst !== '') {
             $this->aclManager->deleteGroup($idst);
         }
     }
     // Subscribe the user approved
     if (isset($arrayState['editwaitsave'])) {
         require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
         $field_manager = new FieldList();
         $idst_group = $_POST['idst'];
         if (isset($arrayState['waiting_user']) && is_array($arrayState['waiting_user'])) {
             while (list($idst_user, $action) = each($arrayState['waiting_user'])) {
                 if ($action == 'accept') {
                     $this->aclManager->addToGroup($idst_group, $idst_user);
                     $this->aclManager->removeFromUserWaitingOfGroup($idst_group, $idst_user);
                 } elseif ($action == 'decline') {
                     if ($field_manager->removeUserEntry($idst_user, $idst_group)) {
                         $this->aclManager->removeFromUserWaitingOfGroup($idst_group, $idst_user);
                     }
                 }
                 // end if
             }
             //end while
         }
         // end if
     }
     // end action managment
     if (isset($arrayState[$this->id])) {
         if (isset($arrayState[$this->id][$this->_getOpEditItemId()])) {
             $this->itemSelected = key($arrayState[$this->id][$this->_getOpEditItemId()]);
             $this->op = 'editgroup';
         }
         if (isset($arrayState[$this->id][$this->_getOpDeleteItemId()])) {
             $this->itemSelected = key($arrayState[$this->id][$this->_getOpDeleteItemId()]);
             $this->op = 'deletegroup';
         }
         if (isset($arrayState[$this->id][$this->_getOpAddToItemId()])) {
             $this->itemSelected = key($arrayState[$this->id][$this->_getOpAddToItemId()]);
             $this->op = 'addtogroup';
         }
         if (isset($arrayState[$this->id][$this->_getOpAssignFieldId()])) {
             $this->itemSelected = key($arrayState[$this->id][$this->_getOpAssignFieldId()]);
             $this->op = 'assignfield';
         }
         if (isset($arrayState[$this->id][$this->_getOpMembersId()])) {
             $this->itemSelected = key($arrayState[$this->id][$this->_getOpMembersId()]);
             $this->op = 'membersgroup';
         }
         if (isset($arrayState[$this->id][$this->_getOpWaitingId()])) {
             $this->itemSelected = key($arrayState[$this->id][$this->_getOpWaitingId()]);
             $this->op = 'waitinggroup';
         }
         if (isset($arrayState[$this->id]['import_groupuser'])) {
             $this->op = 'import_groupuser';
         }
     }
     if ($this->insNew) {
         $this->setInsNew(checkPerm('creategroup', true));
     }
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:79,代码来源:lib.public_user_admin.php

示例2: savesel

 function savesel()
 {
     checkPerm('view');
     require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('register', 'lms');
     $mand_sym = '<span class="mandatory">*</span>';
     $extra_field = new FieldList();
     $GLOBALS['page']->add(getTitleArea($lang->def('_MYGROUP'), 'mygroup') . '<div class="std_block">', 'content');
     $selected = array();
     if (isset($_POST['group_sel'])) {
         $selected = $_POST['group_sel'];
     } elseif (isset($_POST['group_sel_implode'])) {
         $selected = explode(',', $_POST['group_sel_implode']);
     }
     $play_field = $extra_field->playFieldsForUser(getLogUserId(), $selected, false, false, array('readonly'));
     if (isset($_POST['save_field']) || $play_field === false || $play_field == '') {
         $re_filled = $extra_field->isFilledFieldsForUser(getLogUserId(), $selected);
         if (!$re_filled) {
             $GLOBALS['page']->add(getErrorUi($lang->def('_SOME_MANDATORY_EMPTY')), 'content');
         } else {
             $acl =& Docebo::user()->getAcl();
             $acl_man =& Docebo::user()->getAclManager();
             $groups =& $acl_man->getAllGroupsId(array('free', 'moderate'));
             $groups_id = array_keys($groups);
             $user_group = $acl->getSTGroupsST(getLogUserId());
             $add_groups = array_diff($selected, $user_group);
             $del_groups = array_diff($groups_id, $selected);
             $moderate_add = false;
             if (!empty($add_groups)) {
                 while (list(, $idst) = each($add_groups)) {
                     if ($groups[$idst]['type'] == 'free') {
                         $acl_man->addToGroup($idst, getLogUserId());
                     } elseif ($groups[$idst]['type'] == 'moderate') {
                         $acl_man->addToWaitingGroup($idst, getLogUserId());
                         $moderate_add = true;
                     }
                 }
             }
             if ($moderate_add === true) {
                 require_once _base_ . '/lib/lib.eventmanager.php';
                 // message to user that is odified
                 $msg_composer = new EventMessageComposer();
                 $msg_composer->setSubjectLangText('email', '_TO_APPROVE_GROUP_USER_SBJ', false);
                 $msg_composer->setBodyLangText('email', '_TO_APPROVE_GROUP_USER_TEXT', array('[url]' => Get::sett('url')));
                 $msg_composer->setBodyLangText('sms', '_TO_APPROVE_GROUP_USER_TEXT_SMS', array('[url]' => Get::sett('url')));
                 $idst_approve = $acl->getRoleST('/framework/admin/directory/editgroup');
                 $recipients = $acl_man->getAllRoleMembers($idst_approve);
                 createNewAlert('UserGroupModerated', 'directory', 'moderate', '1', 'User group subscription to moderate', $recipients, $msg_composer);
             }
             if (!empty($del_groups)) {
                 while (list(, $idst_group) = each($del_groups)) {
                     $extra_field->removeUserEntry(getLogUserId(), $idst_group);
                     $acl_man->removeFromGroup($idst_group, getLogUserId());
                 }
             }
             // Save fields
             $extra_field->storeFieldsForUser(getLogUserId());
             Util::jump_to('index.php?modname=mygroup&amp;op=group');
         }
     }
     $GLOBALS['page']->add('<div class="reg_note">' . $lang->def('_GROUPS_FIELDS') . '<ul class="reg_instruction">' . '<li>' . str_replace('[mandatory]', $mand_sym, $lang->def('_REG_MANDATORY')) . '</li>' . '</ul>' . '</div>' . Form::openForm('group_subscription', 'index.php?modname=mygroup&amp;op=savesel') . Form::openElementSpace() . Form::getHidden('group_sel_implode', 'group_sel_implode', isset($_POST['group_sel_implode']) ? $_POST['group_sel_implode'] : implode(',', $selected)) . $play_field . Form::getBreakRow() . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save_field', 'save_field', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:63,代码来源:mygroup.php


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