19 declare(strict_types=1);
43 $this->mode = self::MODE_CREATE;
44 $this->parent_id = $a_parent_id;
71 parent::startParsing();
73 if ($this->mode !== self::MODE_CREATE) {
84 public function handlerBeginTag($a_xml_parser,
string $a_name, array $a_attribs): void
96 $this->current_translation = [];
97 $this->current_translation[
'default'] = $a_attribs[
'default'] ? 1 : 0;
98 $this->current_translation[
'lang'] = $a_attribs[
'language'];
106 case 'ContainerSetting':
107 $this->current_container_setting = $a_attribs[
'id'];
126 $this->current_translation[
'title'] = trim($this->cdata);
128 if ($this->current_translation[
'default']) {
129 $this->
getCategory()->setTitle(trim($this->cdata));
135 $this->current_translation[
'description'] = trim($this->cdata);
137 if ($this->current_translation[
'default']) {
138 $this->
getCategory()->setDescription(trim($this->cdata));
146 (
string) $this->current_translation[
'title'],
147 (
string) $this->current_translation[
'description'],
148 (
string) $this->current_translation[
'lang'],
149 (
string) ((
int) $this->current_translation[
'default'])
153 case 'ContainerSetting':
154 if ($this->current_container_setting) {
155 $this->cat_log->debug(
"Write container Setting, ID: " . $this->
getCategory()->
getId() .
", setting: " .
156 $this->current_container_setting .
", data: " . $this->cdata);
159 $this->current_container_setting,
165 case 'ContainerSettings':
166 $this->cat->readContainerSettings();
179 if (!empty($a_data)) {
180 $this->cdata .= $a_data;
184 protected function save(): bool
189 if ($this->mode === self::MODE_CREATE) {
handlerEndTag($a_xml_parser, string $a_name)
handlerCharacterData($a_xml_parser, string $a_data)
static getLogger(string $a_component_id)
Get component logger.
static _importContainerSortingSettings(array $attibs, int $obj_id)
sorting import for all container objects
string $current_container_setting
setCategory(ilObjCategory $cat)
array $current_translation
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
setHandlers($a_xml_parser)
__construct(string $a_xml, int $a_parent_id)
__construct(Container $dic, ilPlugin $plugin)
trimAndStripAttribs(array $attribs)
setXMLContent(string $a_xml_content)
trimAndStrip(string $input)