32 protected \ILIAS\DI\UIServices
$ui;
43 $this->
ctrl = $DIC->ctrl();
44 $this->
ui = $DIC->ui();
45 $this->http_request = $DIC->http()->request();
46 $this->port_request = $DIC->portfolio()
52 $this->
lng->loadLanguageModule(
"prtt");
53 $this->
lng->loadLanguageModule(
"prtf");
59 $next_class = $this->
ctrl->getNextClass($this);
62 $cmd = $this->
ctrl->getCmd();
64 switch ($next_class) {
65 case "ilpropertyformgui":
67 $this->
ctrl->forwardCommand($form);
78 return ($this->
getPage()->getParentType() ===
"prtt");
93 public function edit(): void
122 $selected = $this->content_obj->getRecordIds();
126 foreach ($recs as
$r) {
127 $val = (in_array($r->getRecordId(), $selected));
128 $fields[
"rec" . $r->getRecordId()] =
129 $f->input()->field()->checkbox($r->getTitle(), $r->getDescription())
134 $section1 =
$f->input()->field()->section($fields, $this->
lng->txt(
"prtt_select_datasets"));
141 return $f->input()->container()->form()->standard($form_action, [
"sec" => $section1]);
156 if (
$request->getMethod() ===
"POST") {
157 $form = $form->withRequest(
$request);
158 $data = $form->getData();
159 if (is_null(
$data)) {
163 if (is_array(
$data[
"sec"])) {
165 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
167 $this->updated = $this->pg_obj->update();
168 if (!$this->updated) {
172 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"msg_obj_modified"),
true);
175 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
180 $data = $form->getData();
182 if (!is_null(
$data) && is_array(
$data[
"sec"])) {
185 foreach ($recs as
$r) {
186 $rec_id =
$data[
"sec"][
"rec" . $r->getRecordId()];
187 if (isset($rec_id) && $rec_id) {
188 $ids[] = $r->getRecordId();
216 if (
$request->getMethod() ===
"POST") {
217 $form = $form->withRequest(
$request);
218 $data = $form->getData();
219 if (is_null(
$data)) {
223 if (is_array(
$data[
"sec"])) {
225 $this->updated = $this->pg_obj->update();
226 if (!$this->updated) {
230 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"msg_obj_modified"),
true);
233 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
260 $page =
new ilPortfolioPage($this->port_request->getPortfolioPageId());
262 $content_obj = $page->getContentObjectForPcId($this->request->getPCId());
273 foreach ($recs as
$r) {
274 $val = (in_array($r->getRecordId(), $selected));
280 $form->setTitle(
$lng->
txt(
"prtf_edit_data"));
285 $this->
getPage()->getPortfolioId(),
290 $this->record_gui->setRecordFilter($selected);
291 $this->record_gui->setPropertyForm($form);
292 $this->record_gui->parse();
294 $form->addCommandButton(
"updateAdvancedMetaData",
$lng->
txt(
"save"));
295 $form->addCommandButton(
"cancel",
$lng->
txt(
"cancel"));
308 if (!$this->record_gui->importEditFormPostValues()) {
313 if ($this->record_gui->writeEditForm()) {
314 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
316 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
ilPageContent $content_obj
buildDom(bool $a_force=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
setContent(string $a_html)
Sets content for standard template.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
Content object of ilPageObject (see ILIAS DTD).
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)