Public Member Functions | |
ilRegisterGUI () | |
Constructor public. | |
& | executeCommand () |
execute command | |
showRegistrationForm () | |
cancel () | |
subscribe () | |
apply () | |
getReturnRefId () | |
Data Fields | |
$lng | |
$ilias | |
$tpl | |
$tree | |
$objDefinition | |
$ctrl | |
$cmd | |
$ilErr | |
$object |
Definition at line 32 of file class.ilRegisterGUI.php.
ilRegisterGUI::apply | ( | ) |
Definition at line 184 of file class.ilRegisterGUI.php.
References $_POST, $q, $res, getReturnRefId(), and sendInfo().
{ switch ($this->object->getRegistrationFlag()) { // registration case 1: $q = "SELECT * FROM grp_registration WHERE grp_id=".$this->object->getId()." AND user_id=".$this->ilias->account->getId(); $res = $this->ilias->db->query($q); if ($res->numRows() > 0) { $this->ilErr->raiseError($this->lng->txt("grp_already_applied"),$this->ilErr->MESSAGE); } $q = "INSERT INTO grp_registration VALUES (".$this->object->getId().",".$this->ilias->account->getId().",'".$_POST["subject"]."','".date("Y-m-d H:i:s")."')"; $this->ilias->db->query($q); sendInfo($this->lng->txt("application_completed"),true); $this->ctrl->setParameterByClass("ilRepositoryGUI","ref_id",$this->getReturnRefId()); $this->ctrl->redirectByClass("ilRepositoryGUI","ShowList"); break; // passwort case 2: if (strcmp($this->object->getPassword(),$_POST["subject"]) != 0 && $this->object->registrationPossible() == true) { $this->ilErr->raiseError($this->lng->txt("err_wrong_password"),$this->ilErr->MESSAGE); } if (strcmp($this->object->getPassword(),$_POST["subject"]) == 0 && $this->object->registrationPossible() == true) { $this->object->addMember($this->ilias->account->getId(),$this->object->getDefaultMemberRole()); sendInfo($this->lng->txt("grp_registration_completed"),true); $this->ctrl->returnToParent($this); } $this->ilErr->raiseError($this->lng->txt("registration_not_possible"),$this->ilErr->MESSAGE); break; default: $this->ilErr->raiseError($this->lng->txt("err_unknown_error"),$this->ilErr->MESSAGE); break; } }
ilRegisterGUI::cancel | ( | ) |
Definition at line 166 of file class.ilRegisterGUI.php.
References getReturnRefId(), and sendInfo().
{ sendInfo($this->lng->txt("action_aborted"),true); $this->ctrl->setParameterByClass("ilRepositoryGUI","ref_id",$this->getReturnRefId()); $this->ctrl->redirectByClass("ilRepositoryGUI","ShowList"); }
& ilRegisterGUI::executeCommand | ( | ) |
ilRegisterGUI::getReturnRefId | ( | ) |
Definition at line 229 of file class.ilRegisterGUI.php.
References $_SESSION.
Referenced by apply(), and cancel().
{ if ($_SESSION["il_rep_ref_id"] == $this->object->getRefId()) { return $this->tree->getParentId($this->object->getRefId()); } else { return $_SESSION["il_rep_ref_id"]; } }
ilRegisterGUI::ilRegisterGUI | ( | ) |
Constructor public.
Definition at line 48 of file class.ilRegisterGUI.php.
References $_GET, $ilCtrl, $ilErr, $ilias, $lng, $objDefinition, $tpl, and $tree.
{ global $lng, $ilias, $tpl, $tree, $objDefinition, $ilCtrl, $ilErr; $this->lng =& $lng; $this->ilias =& $ilias; $this->tpl =& $tpl; $this->tree =& $tree; $this->objDefinition =& $objDefinition; $this->ilErr =& $ilErr; $this->ctrl =& $ilCtrl; $this->ctrl->saveParameter($this,array("ref_id")); $this->ctrl->setParameter($this,"user_id",$this->ilias->account->getId()); // get object of current ref id $this->object =& $this->ilias->obj_factory->getInstanceByRefId($_GET["ref_id"]); }
ilRegisterGUI::showRegistrationForm | ( | ) |
Definition at line 83 of file class.ilRegisterGUI.php.
References $_GET, $ilias, $lng, $rbacsystem, and sendInfo().
{ global $rbacsystem, $ilias, $lng; $owner = new ilObjUser($this->object->getOwner()); switch ($this->object->getRegistrationFlag()) { case 0: $stat = $this->lng->txt("group_no_registration"); $msg = $this->lng->txt("group_no_registration_msg"); $readonly ="readonly"; $subject =""; $cmd_submit = "subscribe"; $txt_submit = $this->lng->txt("grp_register"); break; case 1: $stat = $this->lng->txt("group_req_registration"); $msg = $this->lng->txt("group_req_registration_msg"); $cmd_submit = "apply"; $txt_submit = $this->lng->txt("grp_register"); $txt_subject =$this->lng->txt("subject").":"; $textfield = "<textarea name=\"subject\" value=\"{SUBJECT}\" cols=\"50\" rows=\"5\" size=\"255\"></textarea>"; break; case 2: if ($this->object->registrationPossible() == true) { $stat = $this->lng->txt("group_req_password");//"Registrierungpasswort erforderlich"; $msg = $this->lng->txt("group_password_registration_msg"); $txt_subject =$this->lng->txt("password").":"; $txt_submit = $this->lng->txt("grp_register"); $textfield = "<input name=\"subject\" value=\"{SUBJECT}\" type=\"password\" size=\"40\" maxlength=\"70\" style=\"width:300px;\"/>"; $cmd_submit = "apply"; } else { $no_cancel = true; $msg = $this->lng->txt("group_password_registration_expired_msg"); $msg_send = "mail_new.php?mobj_id=3&type=new&rcp_to=root"; $cmd_submit = "cancel"; $txt_submit = $this->lng->txt("grp_back"); $readonly = "readonly"; $stat = $this->lng->txt("group_registration_expired"); sendInfo($this->lng->txt("registration_expired")); } break; } if ($no_cancel !== true) { $this->tpl->setCurrentBlock("btn_cancel"); $this->tpl->setVariable("CMD_CANCEL","cancel"); $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt("cancel")); $this->tpl->parseCurrentBlock(); } if (!$rbacsystem->checkAccess("join", $_GET["ref_id"])) { $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->MESSAGE); return; } $this->tpl->addBlockFile("ADM_CONTENT", "tbldesc", "tpl.grp_accessdenied.html"); $this->tpl->setVariable("TXT_HEADER",$this->lng->txt("group_access_denied")); $this->tpl->setVariable("TXT_MESSAGE",$msg); $this->tpl->setVariable("TXT_GRP_NAME", $this->lng->txt("group_name").":"); $this->tpl->setVariable("GRP_NAME",$this->object->getTitle()); $this->tpl->setVariable("TXT_GRP_DESC",$this->lng->txt("group_desc").":"); $this->tpl->setVariable("GRP_DESC",$this->object->getDescription()); $this->tpl->setVariable("TXT_GRP_OWNER",$this->lng->txt("owner").":"); $this->tpl->setVariable("GRP_OWNER",$owner->getLogin()); $this->tpl->setVariable("TXT_GRP_STATUS",$this->lng->txt("group_status").":"); $this->tpl->setVariable("GRP_STATUS", $stat); $this->tpl->setVariable("TXT_SUBJECT",$txt_subject); $this->tpl->setVariable("SUBJECT",$textfield); $this->tpl->setVariable("TXT_SUBMIT",$txt_submit); $this->tpl->setVariable("CMD_SUBMIT",$cmd_submit); $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this)); $this->tpl->parseCurrentBlock(); }
ilRegisterGUI::subscribe | ( | ) |
Definition at line 173 of file class.ilRegisterGUI.php.
References sendInfo().
{ if (!$this->object->addMember($this->ilias->account->getId(), $this->object->getDefaultMemberRole())) { $this->ilErr->raiseError($this->lng->txt("err_unknown_error"),$this->ilErr->MESSAGE); } sendInfo($this->lng->txt("grp_registration_completed"),true); $this->ctrl->returnToParent($this); }
ilRegisterGUI::$cmd |
Definition at line 40 of file class.ilRegisterGUI.php.
Referenced by executeCommand().
ilRegisterGUI::$ctrl |
Definition at line 39 of file class.ilRegisterGUI.php.
ilRegisterGUI::$ilErr |
Definition at line 41 of file class.ilRegisterGUI.php.
Referenced by ilRegisterGUI().
ilRegisterGUI::$ilias |
Definition at line 35 of file class.ilRegisterGUI.php.
Referenced by ilRegisterGUI(), and showRegistrationForm().
ilRegisterGUI::$lng |
Definition at line 34 of file class.ilRegisterGUI.php.
Referenced by ilRegisterGUI(), and showRegistrationForm().
ilRegisterGUI::$objDefinition |
Definition at line 38 of file class.ilRegisterGUI.php.
Referenced by ilRegisterGUI().
ilRegisterGUI::$object |
Definition at line 42 of file class.ilRegisterGUI.php.
ilRegisterGUI::$tpl |
Definition at line 36 of file class.ilRegisterGUI.php.
Referenced by ilRegisterGUI().
ilRegisterGUI::$tree |
Definition at line 37 of file class.ilRegisterGUI.php.
Referenced by ilRegisterGUI().