19 declare(strict_types=1);
31 public function __construct(
int $a_id = 0,
bool $a_call_by_reference =
true)
38 $this->lom_services = $DIC->learningObjectMetadata();
43 if (isset($this->repo)) {
51 $new_id = parent::create();
59 return parent::update();
64 if ($a_element !==
'General') {
68 $paths = $this->lom_services->paths();
69 $reader = $this->lom_services->read(
73 $paths->custom()->withNextStep(
'general')->get()
76 $title = $reader->firstData($paths->title())->value();
77 $description = $reader->firstData($paths->firstDescription())->value();
83 $item = $this->
getWebLinkRepo()->getAllItemsAsContainer()->getFirstItem();
90 $item->getParameters()
104 public function delete():
bool 107 if (!parent::delete()) {
126 bool $omit_tree =
false 128 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
132 $items = $this->
getWebLinkRepo()->getAllItemsAsContainer()->getItems();
135 foreach ($items as $item) {
139 $item->getDescription(),
142 $item->getParameters()
152 if ($new_web_link_repo->doesOnlyOneItemExist(
true)) {
156 $new_obj->getTitle(),
157 $new_obj->getDescription(),
160 $item->getParameters()
162 $new_web_link_repo->updateItem($item, $draft);
168 $new_obj->getTitle(),
169 $new_obj->getDescription()
171 $new_web_link_repo->createList($draft_list);
179 $attribs = array(
"obj_id" =>
"il_" .
IL_INST_ID .
"_webr_" . $this->
getId(
190 array(
'type' =>
'Manual')
198 array(
'type' =>
'Title')
216 foreach ($items as $item) {
218 $item->toXML($writer, $position);
createAllItemsInDraftContainer(ilWebLinkDraftItemsContainer $container)
toXML(ilXmlWriter $writer)
xmlEndTag(string $tag)
Writes an endtag.
static _lookupSortMode(int $a_obj_id)
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
cloneMetaData(ilObject $target_obj)
Copy meta data.
doMDUpdateListener(string $a_element)
Container class for drafted Web Link items.
LOMServices $lom_services
Draft class for creating or updating a Web Link list.
__construct(Container $dic, ilPlugin $plugin)
Draft class for creating and updating a Web Link item.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
ilWebLinkDatabaseRepository $repo
static _getFirstLink(int $a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one...
__construct(int $a_id=0, bool $a_call_by_reference=true)