24 require_once(
"./Services/COPage/classes/class.ilPCSkills.php");
25 require_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->
user = $DIC->user();
56 $this->lng = $DIC->language();
66 $next_class = $this->ctrl->getNextClass($this);
69 $cmd = $this->ctrl->getCmd();
71 switch ($next_class) {
94 if (!$exp->handleCommand()) {
95 $tpl->setContent($exp->getHTML());
103 $tpl->setContent($a_form->getHTML());
119 if ($this->
getPageConfig()->getEnablePCType(
"PlaceHolder")) {
121 if (!$exp->handleCommand()) {
122 $tpl->setContent($exp->getHTML());
130 $tpl->setContent($a_form->getHTML());
146 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
148 $form->setFormAction($ilCtrl->getFormAction($this));
150 $form->setTitle($this->lng->txt(
"cont_insert_skills"));
152 $form->setTitle($this->lng->txt(
"cont_update_skills"));
159 foreach ($skills as $skill) {
160 $options[$skill[
"skill_node_id"]] = $skill[
"title"];
167 $obj->setRequired(
true);
168 $obj->setOptions($options);
169 $form->addItem($obj);
172 $form->addCommandButton(
"create_skill", $this->lng->txt(
"select"));
173 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
175 $obj->setValue($this->content_obj->getSkillId());
176 $form->addCommandButton(
"update", $this->lng->txt(
"select"));
177 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
191 if ($this->
getPageConfig()->getEnablePCType(
"PlaceHolder")) {
198 if ($form->checkInput()) {
199 $data = $form->getInput(
"skill_id");
206 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
207 $this->content_obj->setData(
$data);
208 $this->updated = $this->pg_obj->update();
209 if ($this->updated ===
true) {
210 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
214 $form->setValuesByPost();
215 return $this->
insert($form);
224 if ($this->
getPageConfig()->getEnablePCType(
"PlaceHolder")) {
231 if ($form->checkInput()) {
232 $data = $form->getInput(
"skill_id");
238 $this->content_obj->setData(
$data);
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();
246 $form->setValuesByPost();
247 return $this->
edit($form);
edit(ilPropertyFormGUI $a_form=null)
Edit skills form.
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.
executeCommand()
execute command
Explorer for selecting a personal skill.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
getPageConfig()
Get Page Config.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
create()
Create new skill.
displayValidationError()
display validation errors
insert(ilPropertyFormGUI $a_form=null)
Insert skills form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct(Container $dic, ilPlugin $plugin)
initForm($a_insert=false)
Init skills form.