ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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->getDomDoc();
38  $xpath_temp = new DOMXPath($dom);
39 
40  // mobs
41  $nodes = $xpath_temp->query("//PageContent/MediaObject/MediaAlias");
42  foreach ($nodes as $node) {
43  $id = explode("_", $node->getAttribute("OriginId"));
44  $mob_id = array_pop($id);
45  $mob_dir = ilObjMediaObject::_getDirectory($mob_id);
46  $quota_sum += ilFileUtils::dirsize($mob_dir);
47  }
48 
49  return $quota_sum;
50  }
51 }
buildDom(bool $a_force=false)
getDomDoc()
Get dom doc (DOMDocument)
static _getDirectory(int $a_mob_id)
Get absolute directory.
static dirsize(string $directory)
get size of a directory or a file.
DOMDocument $dom
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...