24 require_once(
"./classes/class.ilSaxParser.php");
50 $this->parent_cnt = 0;
51 $this->parent[$this->parent_cnt] = $a_parent;
65 xml_set_object($a_xml_parser,$this);
66 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
67 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
96 while (list($k,$v) = each($attr))
97 $tag.=
" ".$k.
"=\"$v\"";
112 global $rbacadmin, $rbacreview, $rbacsystem;
117 $cur_parent = $this->parent[$this->parent_cnt - 1];
118 require_once(
"Modules/Category/classes/class.ilObjCategory.php");
120 $this->category->
setImportId($a_attribs[
"Id"].
" (#".$cur_parent.
")");
121 $this->default_language = $a_attribs[
"DefaultLanguage"];
122 $this->category->setTitle($a_attribs[
"Id"]);
123 $this->category->create();
124 $this->category->createReference();
125 $this->category->putInTree($cur_parent);
126 $this->parent[$this->parent_cnt++] = $this->category->getRefId();
129 if ($this->withrol) {
132 if (!$rbacsystem->checkAccess(
'create',$this->category->getRefId(),
'rolf')) {
133 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_create_rolf"),$this->ilias->error_obj->WARNING);
136 include_once (
"classes/class.ilObject.php");
137 include_once (
"./Services/AccessControl/classes/class.ilObjRole.php");
140 $rolfObj = $this->category->createRoleFolder(
"Local roles",
"Role Folder of category obj_no. ".$this->category->getRefId());
141 $parentRoles = $rbacreview->getParentRoleIds($rolfObj->getRefId(),
true);
144 foreach(
$_POST[
"adopt"] as $postadopt) {
146 $desc = $a_attribs[
"Id"].
" ".$parentRoles[$postadopt][
"title"];
147 $roleObj = $rolfObj->createRole(
$desc,
"Local rol for category ".
$desc);
149 $rbacadmin->copyRoleTemplatePermissions($postadopt,$parentRoles[$postadopt][
"parent"],$rolfObj->getRefId(),$roleObj->getId());
161 $this->cur_spec_lang = $a_attribs[
"Language"];
174 global
$ilias, $rbacadmin;
179 unset($this->category);
180 unset($this->parent[$this->parent_cnt - 1]);
186 if ($this->cur_spec_lang == $this->default_language)
188 $this->category->setTitle($this->cur_title);
189 $this->category->setDescription($this->cur_description);
190 $this->category->update();
193 $this->category->addTranslation($this->cur_title,
194 $this->cur_description, $this->cur_spec_lang, $is_def);
198 $this->cur_title = $this->cdata;
202 $this->cur_description = $this->cdata;
218 $a_data = str_replace(
"<",
"<",$a_data);
219 $a_data = str_replace(
">",
">",$a_data);
222 $a_data = preg_replace(
"/\n/",
"",$a_data);
223 $a_data = preg_replace(
"/\t+/",
"",$a_data);
226 $this->cdata .= $a_data;