Пример #1
0
 /**
  * Show participants
  */
 protected function participants()
 {
     global $ilTabs, $rbacreview, $ilUser;
     $ilTabs->activateTab('participants');
     $this->addSearchToolbar();
     $tpl = ilViteroPlugin::getInstance()->getTemplate('tpl.edit_participants.html');
     $this->setShowHidePrefs();
     if ($rbacreview->assignedUsers((int) $this->object->getDefaultAdminRole())) {
         if ($ilUser->getPref('xvit_admin_hide')) {
             $table_gui = new ilViteroParticipantsTableGUI($this, ilObjVitero::ADMIN, false);
             $table_gui->setVGroupId($this->object->getVGroupId());
             $this->ctrl->setParameter($this, 'admin_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'participants'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilViteroParticipantsTableGUI($this, ilObjVitero::ADMIN, true);
             $table_gui->setVGroupId($this->object->getVGroupId());
             $this->ctrl->setParameter($this, 'admin_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'participants'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle(ilViteroPlugin::getInstance()->txt('admins'), 'icon_usr.svg', $this->lng->txt('grp_admins'));
         $table_gui->parse($rbacreview->assignedUsers((int) $this->object->getDefaultAdminRole()));
         $tpl->setVariable('ADMINS', $table_gui->getHTML());
     }
     if ($rbacreview->assignedUsers((int) $this->object->getDefaultMemberRole())) {
         if ($ilUser->getPref('xvit_member_hide')) {
             $table_gui = new ilViteroParticipantsTableGUI($this, ilObjVitero::MEMBER, false);
             $table_gui->setVGroupId($this->object->getVGroupId());
             $this->ctrl->setParameter($this, 'member_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'participants'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilViteroParticipantsTableGUI($this, ilObjVitero::MEMBER, true);
             $table_gui->setVGroupId($this->object->getVGroupId());
             $this->ctrl->setParameter($this, 'member_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'participants'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle(ilViteroPlugin::getInstance()->txt('participants'), 'icon_usr.svg', $this->lng->txt('grp_members'));
         $table_gui->parse($rbacreview->assignedUsers((int) $this->object->getDefaultMemberRole()));
         $tpl->setVariable('MEMBERS', $table_gui->getHTML());
     }
     $remove = ilSubmitButton::getInstance();
     $remove->setCommand("confirmDeleteParticipants");
     $remove->setCaption("remove", true);
     $tpl->setVariable('BTN_REMOVE', $remove->render());
     if (ilViteroLockedUser::hasLockedAccounts($this->object->getVGroupId())) {
         $unlock = ilSubmitButton::getInstance();
         $unlock->setCommand("unlockUsers");
         $unlock->setCaption(ilViteroPlugin::getInstance()->txt('btn_unlock'), false);
         $tpl->setVariable('BTN_UNLOCK', $unlock->render());
     }
     $lock = ilSubmitButton::getInstance();
     $lock->setCommand("lockUsers");
     $lock->setCaption(ilViteroPlugin::getInstance()->txt('btn_lock'), false);
     $tpl->setVariable('BTN_LOCK', $lock->render());
     $mail = ilSubmitButton::getInstance();
     $mail->setCommand("sendMailToSelectedUsers");
     $mail->setCaption("grp_mem_send_mail", true);
     $tpl->setVariable('BTN_MAIL', $mail->render());
     $tpl->setVariable('ARROW_DOWN', ilUtil::getImagePath('arrow_downright.svg'));
     $tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
     $GLOBALS['tpl']->setContent($tpl->get());
 }