24require_once(
"./Services/COPage/classes/class.ilPCProfile.php");
 
   25require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
 
   49    public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id = 
"")
 
   53        $this->tpl = 
$DIC[
"tpl"];
 
   54        $this->ctrl = 
$DIC->ctrl();
 
   55        $this->toolbar = 
$DIC->toolbar();
 
   56        parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
 
   65        $next_class = $this->ctrl->getNextClass($this);
 
   68        $cmd = $this->ctrl->getCmd();
 
   70        switch ($next_class) {
 
   93        $tpl->setContent($a_form->getHTML());
 
  110        $tpl->setContent($a_form->getHTML());
 
  124        $is_template = ($this->
getPageConfig()->getEnablePCType(
"PlaceHolder"));
 
  127            $ilToolbar->addButton(
 
  128                $this->lng->txt(
"cont_edit_personal_data"),
 
  129                $ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui", 
"jumptoprofile"),
 
  135            $lng_suffix = 
"_template";
 
  138        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  142            $form->setTitle($this->lng->txt(
"cont_insert_profile"));
 
  144            $form->setTitle($this->lng->txt(
"cont_update_profile"));
 
  148        $form->addItem($mode);
 
  150        $mode_inherit = 
new ilRadioOption($this->lng->txt(
"cont_profile_mode_inherit"), 
"inherit");
 
  151        $mode_inherit->setInfo($this->lng->txt(
"cont_profile_mode" . $lng_suffix . 
"_inherit_info"));
 
  152        $mode->addOption($mode_inherit);
 
  154        $mode_manual = 
new ilRadioOption($this->lng->txt(
"cont_profile_mode_manual"), 
"manual");
 
  155        $mode_manual->setInfo($this->lng->txt(
"cont_profile_mode_manual_info"));
 
  156        $mode->addOption($mode_manual);
 
  160            $mode->setValue(
"inherit");
 
  162            $mode_value = $this->content_obj->getMode();
 
  163            $mode->setValue($mode_value);
 
  166            if ($mode_value == 
"manual") {
 
  167                foreach ($this->content_obj->getFields() as 
$name) {
 
  168                    $prefs[
"public_" . 
$name] = 
"y";
 
  173        include_once 
"Services/User/classes/class.ilPersonalProfileGUI.php";
 
  175        $profile->showPublicProfileFields(
$form, $prefs, $mode_manual, $is_template);
 
  178            $form->addCommandButton(
"create_profile", $this->lng->txt(
"save"));
 
  179            $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
 
  181            $form->addCommandButton(
"update", $this->lng->txt(
"save"));
 
  182            $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
 
  197            if (substr(
$name, 0, 4) == 
"chk_") {
 
  199                    $fields[] = substr(
$name, 4);
 
  212        if (
$form->checkInput()) {
 
  214            $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
 
  215            $this->content_obj->setFields(
 
  216                $form->getInput(
"mode"),
 
  217                $this->getFieldsValues()
 
  219            $this->updated = $this->pg_obj->update();
 
  220            if ($this->updated === 
true) {
 
  221                $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  234        if (
$form->checkInput()) {
 
  235            $this->content_obj->setFields(
 
  236                $form->getInput(
"mode"),
 
  237                $this->getFieldsValues()
 
  239            $this->updated = $this->pg_obj->update();
 
  240            if ($this->updated === 
true) {
 
  241                $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  245        $this->pg_obj->addHierIDs();
 
An exception for terminatinating execution or to throw for unit testing.
create()
Create new personal data.
edit(ilPropertyFormGUI $a_form=null)
Edit personal data form.
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
initForm($a_insert=false)
Init profile form.
getFieldsValues()
Gather field values.
executeCommand()
execute command
insert(ilPropertyFormGUI $a_form=null)
Insert new personal data form.
update()
Update personal data.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getPageConfig()
Get Page Config.
displayValidationError()
display validation errors
GUI class for personal profile.
This class represents an option in a radio group.
if(isset($_POST['submit'])) $form