ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilContObjectExport Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilContObjectExport:

Public Member Functions

 __construct (ilObjLearningModule $a_cont_obj, string $a_mode="xml", string $a_lang="")
 
 getInstId ()
 
 buildExportFile (string $a_mode="")
 
 buildExportFileHTML ()
 

Data Fields

ilDBInterface $db
 
ilObjLearningModule $cont_obj
 
int $inst_id
 
string $mode
 

Protected Attributes

int $inst
 
ilXmlWriter $xml
 
string $filename
 
string $subdir
 
string $export_dir
 
string $lang
 
ExportFactory $export_factory
 
ilObjUser $usr
 
DataFactory $data_factory
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Export class for content objects

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Databay AG ay@da.nosp@m.taba.nosp@m.y.de

Definition at line 29 of file class.ilContObjectExport.php.

Constructor & Destructor Documentation

◆ __construct()

ilContObjectExport::__construct ( ilObjLearningModule  $a_cont_obj,
string  $a_mode = "xml",
string  $a_lang = "" 
)

Definition at line 45 of file class.ilContObjectExport.php.

49 {
50 global $DIC;
51 $this->export_factory = new ExportFactory();
52 $this->data_factory = new DataFactory();
53
54 $ilDB = $DIC->database();
55
56 $this->cont_obj = $a_cont_obj;
57
58 $this->usr = $DIC->user();
59 $this->db = $ilDB;
60 $this->mode = $a_mode;
61 $this->lang = $a_lang;
62
63 $this->inst_id = (int) IL_INST_ID;
64
65 $date = time();
66 switch ($this->mode) {
67 case "html":
68 if ($this->lang == "") {
69 $this->export_dir = $this->cont_obj->getExportDirectory("html");
70 } else {
71 $this->export_dir = $this->cont_obj->getExportDirectory("html_" . $this->lang);
72 }
73 $this->subdir = $this->cont_obj->getType() . "_" . $this->cont_obj->getId();
74 $this->filename = $this->subdir . ".zip";
75 break;
76
77 default:
78 $this->export_dir = $this->cont_obj->getExportDirectory();
79 $this->subdir = $date . "__" . $this->inst_id . "__" .
80 $this->cont_obj->getType() . "_" . $this->cont_obj->getId();
81 $this->filename = $this->subdir . ".xml";
82 break;
83 }
84 }
const IL_INST_ID
Definition: constants.php:40
global $DIC
Definition: shib_login.php:26

References $DIC, $ilDB, IL_INST_ID, and ILIAS\Repository\int().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildExportFile()

ilContObjectExport::buildExportFile ( string  $a_mode = "")

Definition at line 91 of file class.ilContObjectExport.php.

93 : void {
94 switch ($this->mode) {
95 case "html":
96 $this->buildExportFileHTML();
97 break;
98
99 default:
100 $this->buildExportFileXML($a_mode);
101 break;
102 }
103 }

References buildExportFileHTML().

+ Here is the call graph for this function:

◆ buildExportFileHTML()

ilContObjectExport::buildExportFileHTML ( )

Definition at line 196 of file class.ilContObjectExport.php.

196 : void
197 {
198 // create directories
199 if ($this->lang == "") {
200 $this->cont_obj->createExportDirectory("html");
201 } else {
202 $this->cont_obj->createExportDirectory("html_" . $this->lang);
203 }
204
205 // get html content
206 $exp = new \ILIAS\LearningModule\Export\LMHtmlExport(
207 $this->cont_obj,
208 $this->export_dir,
209 $this->subdir,
210 "html",
211 $this->lang
212 );
213 $exp->exportHTML(true);
214 }

Referenced by buildExportFile().

+ Here is the caller graph for this function:

◆ getInstId()

ilContObjectExport::getInstId ( )

Definition at line 86 of file class.ilContObjectExport.php.

86 : int
87 {
88 return $this->inst_id;
89 }

References $inst_id.

Field Documentation

◆ $cont_obj

ilObjLearningModule ilContObjectExport::$cont_obj

Definition at line 41 of file class.ilContObjectExport.php.

◆ $data_factory

DataFactory ilContObjectExport::$data_factory
protected

Definition at line 39 of file class.ilContObjectExport.php.

◆ $db

ilDBInterface ilContObjectExport::$db

Definition at line 40 of file class.ilContObjectExport.php.

◆ $export_dir

string ilContObjectExport::$export_dir
protected

Definition at line 35 of file class.ilContObjectExport.php.

◆ $export_factory

ExportFactory ilContObjectExport::$export_factory
protected

Definition at line 37 of file class.ilContObjectExport.php.

◆ $filename

string ilContObjectExport::$filename
protected

Definition at line 33 of file class.ilContObjectExport.php.

◆ $inst

int ilContObjectExport::$inst
protected

Definition at line 31 of file class.ilContObjectExport.php.

◆ $inst_id

int ilContObjectExport::$inst_id

Definition at line 42 of file class.ilContObjectExport.php.

Referenced by getInstId().

◆ $lang

string ilContObjectExport::$lang
protected

Definition at line 36 of file class.ilContObjectExport.php.

◆ $mode

string ilContObjectExport::$mode

Definition at line 43 of file class.ilContObjectExport.php.

◆ $subdir

string ilContObjectExport::$subdir
protected

Definition at line 34 of file class.ilContObjectExport.php.

◆ $usr

ilObjUser ilContObjectExport::$usr
protected

Definition at line 38 of file class.ilContObjectExport.php.

◆ $xml

ilXmlWriter ilContObjectExport::$xml
protected

Definition at line 32 of file class.ilContObjectExport.php.


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