ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Blog\Export\ExportManager Class Reference
+ Collaboration diagram for ILIAS\Blog\Export\ExportManager:

Public Member Functions

 __construct (protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)
 
 isCommentsExportPossible (int $blog_id)
 
 buildHtml (int $node_id, int $owner_id, string $format, bool $is_repository, bool $a_include_comments=false, bool $print_version=false)
 Build export. More...
 
 buildExportLink (string $a_template, string $a_type, string $a_id, array $keywords)
 

Detailed Description

Definition at line 27 of file ExportManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Blog\Export\ExportManager::__construct ( protected InternalDataService  $data,
protected InternalRepoService  $repo,
protected InternalDomainService  $domain 
)

Definition at line 29 of file ExportManager.php.

33 {
34 }

Member Function Documentation

◆ buildExportLink()

ILIAS\Blog\Export\ExportManager::buildExportLink ( string  $a_template,
string  $a_type,
string  $a_id,
array  $keywords 
)

Definition at line 94 of file ExportManager.php.

99 : string {
100 switch ($a_type) {
101 case "list":
102 $a_type = "m";
103 break;
104
105 case "keyword":
106 $map = array_flip(array_keys($keywords));
107 $a_id = (string) ($map[$a_id] ?? "");
108 $a_type = "k";
109 break;
110
111 default:
112 $a_type = "p";
113 break;
114 }
115
116 return str_replace(array("{TYPE}", "{ID}"), array($a_type, $a_id), $a_template);
117 }

◆ buildHtml()

ILIAS\Blog\Export\ExportManager::buildHtml ( int  $node_id,
int  $owner_id,
string  $format,
bool  $is_repository,
bool  $a_include_comments = false,
bool  $print_version = false 
)

Build export.

Definition at line 57 of file ExportManager.php.

64 : BlogHtmlExport {
65 $format = explode("_", $format);
66 if (($format[1] ?? "") === "comments" || $a_include_comments) {
67 $a_include_comments = true;
68 }
69
70 if ($is_repository) {
71 $blog_id = \ilObject::_lookupObjId($node_id);
72 } else {
73 $blog_id = $this->domain->getObjectIdForWspId($node_id);
74 }
75
76 $subdir = "blog_" . $blog_id;
77 if ($print_version) {
78 $subdir .= "print";
79 }
80
81 $blog_export = new BlogHtmlExport(
82 $node_id,
83 $owner_id,
84 $is_repository,
85 "",
86 $subdir
87 );
88 $blog_export->setPrintVersion($print_version);
89 $blog_export->includeComments($a_include_comments);
90 $blog_export->exportHTML();
91 return $blog_export;
92 }
static _lookupObjId(int $ref_id)

◆ isCommentsExportPossible()

ILIAS\Blog\Export\ExportManager::isCommentsExportPossible ( int  $blog_id)

Definition at line 36 of file ExportManager.php.

36 : bool
37 {
38 $setting = $this->domain->settings();
39 $notes = $this->domain->notes();
41
42 if ($setting->get("disable_comments")) {
43 return false;
44 }
45 if (!$privacy->enabledCommentsExport()) {
46 return false;
47 }
48 if (!$notes->commentsActive($blog_id)) {
49 return false;
50 }
51 return true;
52 }
ilSetting $setting
Definition: class.ilias.php:68
get(string $a_keyword, ?string $a_default_value=null)
get setting

References ILIAS\$setting, ilSetting\get(), and ilPrivacySettings\getInstance().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: