26     public function init(): void
    45         $new_item = $this->dom_doc->createElement(
"FileItem");
    46         $new_item = $this->
getChildNode()->appendChild($new_item);
    49         $id_node = $this->dom_doc->createElement(
"Identifier");
    50         $id_node = $new_item->appendChild($id_node);
    51         $id_node->setAttribute(
"Catalog", 
"ILIAS");
    52         $id_node->setAttribute(
"Entry", 
"il__file_" . $a_id);
    55         $loc_node = $this->dom_doc->createElement(
"Location");
    56         $loc_node = $new_item->appendChild($loc_node);
    57         $loc_node->setAttribute(
"Type", 
"LocalFile");
    58         $this->dom_util->setContent($loc_node, $a_location);
    61         $form_node = $this->dom_doc->createElement(
"Format");
    62         $form_node = $new_item->appendChild($form_node);
    63         $this->dom_util->setContent($form_node, $a_format);
    70         $this->dom_util->setFirstOptionalElement(
    75             array(
"Language" => $a_language)
    82             if ($c->nodeName === 
"Title") {
    92             if ($c->nodeName === 
"Title") {
    93                 return $c->getAttribute(
"Language");
   108             if ($c->nodeName === 
"FileItem") {
   110                 $pc_id = $c->getAttribute(
"PCID");
   111                 $hier_id = $c->getAttribute(
"HierId");
   112                 $class = $c->getAttribute(
"Class");
   115                 $id_node = $c->firstChild;
   116                 if ($id_node->nodeName === 
"Identifier") {
   117                     $entry = $id_node->getAttribute(
"Entry");
   118                     if (substr($entry, 0, 9) == 
"il__file_") {
   119                         $id = substr($entry, 9);
   122                 $files[] = array(
"entry" => $entry, 
"id" => 
$id,
   123                     "pc_id" => $pc_id, 
"hier_id" => 
$hier_id,
   138             if ($c->nodeName === 
"FileItem") {
   140                 $pc_id = $c->getAttribute(
"PCID");
   141                 $hier_id = $c->getAttribute(
"HierId");
   143                 if (in_array(
$hier_id . 
":" . $pc_id, $a_ids)) {
   144                     $c->parentNode->removeChild($c);
   160             if ($c->nodeName === 
"FileItem") {
   161                 $pc_id = $c->getAttribute(
"PCID");
   162                 $hier_id = $c->getAttribute(
"HierId");
   166         $this->dom_util->deleteAllChildsByName($this->
getChildNode(), [
"FileItem"]);
   167         foreach ($a_pos as $k => $v) {
   168             if (is_object($nodes[$k])) {
   169                 $nodes[$k] = $this->
getChildNode()->appendChild($nodes[$k]);
   183             if ($c->nodeName === 
"FileItem") {
   184                 $classes[$c->getAttribute(
"HierId") . 
":" .
   185                     $c->getAttribute(
"PCID")] = $c->getAttribute(
"Class");
   199             if ($c->nodeName == 
"FileItem") {
   202                     $a_class[$c->getAttribute(
"HierId") . 
":" .
   203                     $c->getAttribute(
"PCID")]
   215         return array(
"ed_edit_files", 
"ed_insert_filelist", 
"pc_flist");
   229             $file_ids = ilObjFile::_getFilesOfObject(
   235             self::saveFileUsage($a_page, $a_domdoc);
   237             foreach ($file_ids as $file) {      
   240                     $usages = $file_obj->getUsages();
   241                     if (count($usages) == 0) {  
   242                         if ($file_obj->getMode() == 
"filelist") {               
   257         $files = self::collectFileItems($a_page, $a_page->
getDomDoc());
   260         ilObjFile::_deleteAllUsages(
   267         foreach ($files as $file_id) {
   269                 $file_obj = 
new ilObjFile($file_id, 
false);
   284         self::saveFileUsage($a_page, $a_old_domdoc, $a_old_nr);
   295         $file_ids = self::collectFileItems($a_page, $a_domdoc);
   297         foreach ($file_ids as $file_id) {
   298             ilObjFile::_saveUsage(
   316         $nodes = $xpath->query(
'//FileItem/Identifier');
   318         foreach ($nodes as $node) {
   319             $id_arr = explode(
"_", $node->getAttribute(
"Entry"));
   320             $file_id = $id_arr[count($id_arr) - 1];
   321             if ($file_id > 0 && ($id_arr[1] == 
"" || $id_arr[1] == 
IL_INST_ID || $id_arr[1] == 0)) {
   322                 $file_ids[$file_id] = $file_id;
   327         $nodes = $xpath->query(
"//IntLink[@Type='File']");
   328         foreach ($nodes as $node) {
   329             $t = $node->getAttribute(
"Target");
   330             if (substr($t, 0, 9) == 
"il__dfile") {
   331                 $id_arr = explode(
"_", $t);
   332                 $file_id = $id_arr[count($id_arr) - 1];
   333                 $file_ids[$file_id] = $file_id;
   343         int $delete_lower_than_nr
   345         $file_ids = self::_deleteHistoryUsagesLowerEqualThan(
   348             $delete_lower_than_nr,
   352         foreach ($file_ids as $file_id) {
   355                 $usages = $file->getUsages();
   356                 if (count($usages) == 0) {
   366         int $a_usage_hist_nr,
   371         $hist_repo = $DIC->copage()->internal()->repo()->history();
   374         foreach ($hist_repo->getHistoryNumbersOlderEqualThanNr(
   380             foreach (ilObjFile::_getFilesOfObject($parent_type . 
":pg", $a_id, $old_nr, $a_lang) as $file_id) {
   381                 $file_ids[$file_id] = $file_id;
   383             ilObjFile::_deleteAllUsages($parent_type . 
":pg", $a_id, $old_nr, $a_lang);
 setType(string $a_type)
Set Type. 
 
getAllClasses()
Get all style classes. 
 
static getLangVars()
Get lang vars needed for editing. 
 
appendItem(int $a_id, string $a_location, string $a_format)
 
static _deleteHistoryUsagesLowerEqualThan(string $parent_type, int $a_id, int $a_usage_hist_nr, string $a_lang="-")
 
static afterPageHistoryEntry(ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
After page history entry has been created. 
 
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 
getFileList()
Get list of files. 
 
getDomDoc()
Get dom doc (DOMDocument) 
 
Content object of ilPageObject (see ILIAS DTD). 
 
static deleteHistoryLowerEqualThan(string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 
saveStyleClasses(array $a_class)
Save style classes of file items. 
 
static collectFileItems(ilPageObject $a_page, DOMDocument $a_domdoc)
Get all file items that are used within the page. 
 
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data 
 
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD) 
 
deleteFileItems(array $a_ids)
Delete file items. 
 
static saveFileUsage(ilPageObject $a_page, DOMDocument $a_domdoc, int $a_old_nr=0)
Save file usages. 
 
setListTitle(string $a_title, string $a_language)
 
savePositions(array $a_pos)
Save positions of file items. 
 
static beforePageDelete(ilPageObject $a_page)
Before page is being deleted. 
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static afterPageUpdate(ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
After page has been updated (or created) 
 
static _lookupType(int $id, bool $reference=false)
 
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])