ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilForumImporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Export/classes/class.ilXmlImporter.php");
5 
14 {
21  public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
22  {
23  include_once 'Modules/Forum/classes/class.ilObjForum.php';
24 
25  // case i container
26  if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_id))
27  {
28  $newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
29  }
30  else // case ii, non container
31  {
32  $newObj = new ilObjForum();
33  $newObj->setType('frm');
34  $newObj->create(true);
35  }
36 
37  include_once 'Modules/Forum/classes/class.ilForumXMLParser.php';
38  $parser = new ilForumXMLParser($newObj, $a_xml);
39  $parser->setImportDirectory($this->getImportDirectory());
40  $parser->setImportInstallId($this->getInstallId());
41  $parser->startParsing();
42 
43  $a_mapping->addMapping("Modules/Forum", "frm", $a_id, $newObj->getId());
44  }
45 }
46 ?>