30 $ilToolbar = $DIC[
'ilToolbar'];
36 $this->toolbar = $ilToolbar;
38 $this->parent_ref_id = $a_parent_ref_id;
39 $this->lng->loadLanguageModule(
"administration");
48 if ($cmd ==
"roleStartingPointform" || !$cmd) {
49 $cmd =
"initRoleStartingPointForm";
62 include_once
"Services/User/classes/class.ilUserRoleStartingPointTableGUI.php";
64 require_once
"./Services/AccessControl/classes/class.ilStartingPoint.php";
67 if (!empty($roles_without_point)) {
68 $this->toolbar->addButton(
69 $this->lng->txt(
'create_starting_point'),
70 $this->ctrl->getLinkTarget($this,
"roleStartingPointform")
79 $this->tpl->setContent($tbl->getHTML());
87 $this->tpl->setContent(
$form->getHTML());
95 $this->tpl->setContent(
$form->getHTML());
104 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
105 require_once
"Services/User/classes/class.ilUserUtil.php";
110 $startp =
new ilCheckboxInputGUI($this->lng->txt(
"user_chooses_starting_page"),
"usr_start_pers");
111 $startp->
setInfo($this->lng->txt(
"adm_user_starting_point_personal_info"));
114 $form->addItem($startp);
116 $form->addCommandButton(
"saveUserStartingPoint", $this->lng->txt(
"save"));
130 $rbacsystem = $DIC[
'rbacsystem'];
133 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
137 require_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
138 require_once
"./Services/AccessControl/classes/class.ilObjRole.php";
139 require_once
"./Services/AccessControl/classes/class.ilStartingPoint.php";
140 include_once
"Services/User/classes/class.ilUserUtil.php";
143 $ilCtrl->saveParameter($this, array(
"spid"));
145 $spoint_id = $_REQUEST[
'spid'];
148 if ($spoint_id > 0 && $spoint_id !=
'default') {
153 $rolid = (int) $_REQUEST[
'rolid'];
155 $options[$rolid] = $role->getTitle();
156 $starting_point = $st_point->getStartingPoint();
157 $si_roles =
new ilSelectInputGUI($this->lng->txt(
"editing_this_role"),
'role_disabled');
159 $si_roles->setDisabled(
true);
160 $form->addItem($si_roles);
163 $hi->setValue($rolid);
167 $hidde_sp_id->setValue($spoint_id);
168 $form->addItem($hidde_sp_id);
173 elseif (!$spoint_id || $spoint_id !=
'default') {
178 foreach ($roles as $role) {
179 $options[$role[
'id']] = $role[
'title'];
181 $si_roles =
new ilSelectInputGUI($this->lng->txt(
"roles_without_starting_point"),
'role');
183 $form->addItem($si_roles);
192 $si->setRequired(
true);
193 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
197 $si->addOption($opt);
199 if (!in_array($value,
$valid)) {
200 $opt->setInfo($this->lng->txt(
"adm_user_starting_point_invalid_info"));
203 $si->setValue($starting_point);
208 $repobj_id =
new ilTextInputGUI($this->lng->txt(
"adm_user_starting_point_ref_id"),
"start_object");
209 $repobj_id->setRequired(
true);
210 $repobj_id->setSize(5);
214 $start_ref_id = $st_point->getStartingObject();
219 $repobj_id->
setValue($start_ref_id);
228 $repobj->addSubItem($repobj_id);
229 $si->addOption($repobj);
232 $form->addCommandButton(
"saveStartingPoint", $this->lng->txt(
"save"));
233 $form->addCommandButton(
"startingPoints", $this->lng->txt(
"cancel"));
235 $form->setTitle($this->lng->txt(
"starting_point_settings"));
246 $rbacsystem = $DIC[
'rbacsystem'];
249 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
250 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),
$ilErr->FATAL);
253 include_once
"Services/User/classes/class.ilUserUtil.php";
257 if (
$form->checkInput()) {
259 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
260 $ilCtrl->redirect($this,
"startingPoints");
263 $ilCtrl->redirect($this,
"startingPoints");
274 $tree = $DIC[
'tree'];
275 $rbacsystem = $DIC[
'rbacsystem'];
279 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
280 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),
$ilErr->FATAL);
283 if ((
int)
$_POST[
'start_point_id'] > 0) {
284 $start_point_id = (int)
$_POST[
'start_point_id'];
289 if (
$form->checkInput()) {
291 if (
$form->getInput(
'role')) {
294 if ($start_point_id) {
300 $starting_point->setStartingPoint(
$form->getInput(
"start_point"));
301 $rules = array(
"role_id" =>
$form->getInput(
'role'));
302 $starting_point->setRuleOptions(serialize($rules));
304 $obj_id =
$form->getInput(
'start_object');
307 $starting_point->setStartingObject($obj_id);
308 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
313 $starting_point->setStartingObject(0);
316 if ($start_point_id) {
317 $starting_point->update();
319 $starting_point->save();
323 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
326 $ilCtrl->redirect($this,
"startingPoints");
338 $rbacsystem = $DIC[
'rbacsystem'];
341 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
346 require_once
"./Services/AccessControl/classes/class.ilStartingPoint.php";
349 $sp->saveOrder(
$_POST[
'position']);
352 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
353 $ilCtrl->redirect($this,
"startingPoints");
366 $ilTabs = $DIC[
'ilTabs'];
368 $ilTabs->clearTargets();
369 $ilTabs->setBackTarget(
$lng->txt(
'back_to_starting_points_list'),
$ilCtrl->getLinkTarget($this,
'startingPoints'));
371 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
373 $conf->setFormAction(
$ilCtrl->getFormAction($this));
374 $conf->setHeaderText(
$lng->txt(
'confirm_delete_starting_point'));
377 if ($_REQUEST[
'rolid'] && $_REQUEST[
'spid']) {
378 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
380 $rolid = (int) $_REQUEST[
'rolid'];
381 $spid = (int) $_REQUEST[
'spid'];
385 $conf->addItem(
'rolid', $rolid, $role->getTitle());
386 $conf->addItem(
'spid', $spid,
"");
389 $conf->setConfirm(
$lng->txt(
'delete'),
'deleteStartingPoint');
390 $conf->setCancel(
$lng->txt(
'cancel'),
'startingPoints');
392 $tpl->setContent($conf->getHTML());
403 $rbacsystem = $DIC[
'rbacsystem'];
406 if (!$rbacsystem->checkAccess(
"write", $this->parent_ref_id)) {
410 require_once
"./Services/AccessControl/classes/class.ilObjRole.php";
412 if ($rolid = $_REQUEST[
'rolid'] && $spid = $_REQUEST[
'spid']) {
413 include_once(
"./Services/AccessControl/classes/class.ilStartingPoint.php");
416 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
420 $ilCtrl->redirect($this,
"startingPoints");
This class represents an option in a radio group.
saveStartingPoint()
store starting point from the form
TableGUI class for LTI consumer listing.
getUserStartingPointForm()
static _lookupTitle($a_id)
lookup object title
static getGlobalRolesWithoutStartingPoint()
Get id and title of the roles without starting points.
static getStartingPoint()
Get current starting point setting.
setInfo($a_info)
Set Info.
static hasPersonalStartingPoint()
Can starting point be personalized?
initRoleStartingPointForm(ilPropertyFormGUI $form=null)
static getPossibleStartingPoints($a_force_all=false)
Get all valid starting points.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
startingPoints()
table form to set up starting points depends of user roles
setValue($a_value)
Set Value.
confirmDeleteStartingPoint()
Confirm delete starting point.
if(isset($_POST['submit'])) $form
initUserStartingPointForm(ilPropertyFormGUI $form=null)
Class ilUserStartingPointGUI.
static _lookupObjId($a_id)
static getStartingObject()
Get ref id of starting object.
This class represents a text property in a property form.
getRoleStartingPointForm()
deleteStartingPoint()
Set to 0 the starting point values.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const START_REPOSITORY_OBJ
static getLogger($a_component_id)
Get component logger.
__construct($a_parent_ref_id)
Constructor public.
static setStartingPoint($a_value, $a_ref_id=null)
Set starting point setting.
static togglePersonalStartingPoint($a_value)
Toggle personal starting point setting.
Confirmation screen class.