ILIAS  release_8 Revision v8.24
class.ilPortfolioTemplatePage.php
Go to the documentation of this file.
1<?php
2
24{
25 public const TYPE_BLOG_TEMPLATE = 3;
26
27 public function getParentType(): string
28 {
29 return "prtt";
30 }
31
32 public function getPageDiskSize(): int
33 {
34 $quota_sum = 0;
35
36 $this->buildDom();
37 $dom = $this->getDom();
38 if ($dom instanceof php4DOMDocument) {
39 $dom = $dom->myDOMDocument;
40 }
41 $xpath_temp = new DOMXPath($dom);
42
43 // mobs
44 $nodes = $xpath_temp->query("//PageContent/MediaObject/MediaAlias");
45 foreach ($nodes as $node) {
46 $id = explode("_", $node->getAttribute("OriginId"));
47 $mob_id = array_pop($id);
48 $mob_dir = ilObjMediaObject::_getDirectory($mob_id);
49 $quota_sum += ilFileUtils::dirsize($mob_dir);
50 }
51
52 return $quota_sum;
53 }
54}
static dirsize(string $directory)
get size of a directory or a file.
static _getDirectory(int $a_mob_id)
Get absolute directory.
php4DOMElement $node
php4DOMDocument $dom
getDom()
@depracated
buildDom(bool $a_force=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...