Reads and store cms tree in database.
More...
Reads and store cms tree in database.
- Author
- Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$
Definition at line 10 of file class.ilECSTreeReader.php.
◆ __construct()
ilECSTreeReader::__construct |
( |
|
$server_id, |
|
|
|
$mid |
|
) |
| |
◆ read()
ilECSTreeReader::read |
( |
| ) |
|
Read trees from ecs.
- Exceptions
-
Definition at line 33 of file class.ilECSTreeReader.php.
References $GLOBALS, $result, array, ilECSSetting\getInstanceByServerId(), storeTree(), and ilECSCmsData\treeExists().
35 $GLOBALS[
'ilLog']->write(__METHOD__.
': Begin read');
38 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
42 $trees = $dir_reader->getDirectoryTrees();
43 $GLOBALS[
'ilLog']->write(__METHOD__.
' '.print_r($trees,
true));
46 foreach((
array) $trees->getLinkIds() as $tree_id)
48 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
49 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
53 $result = $dir_reader->getDirectoryTree($tree_id);
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
static treeExists($a_server_id, $a_mid, $a_tree_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Presentation of ecs uril (http://...campusconnect/courselinks)
Create styles array
The data for the language used.
storeTree($tree_id, $a_nodes)
◆ storeTree()
ilECSTreeReader::storeTree |
( |
|
$tree_id, |
|
|
|
$a_nodes |
|
) |
| |
|
protected |
Definition at line 65 of file class.ilECSTreeReader.php.
References $data, array, and ilECSCmsData\lookupObjId().
Referenced by read().
67 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
68 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
76 $data->setServerId($this->server_id);
77 $data->setMid($this->mid);
78 $data->setCmsId($cms_tree->rootID);
79 $data->setTreeId($tree_id);
80 $data->setTitle($node->directoryTitle);
81 $data->setTerm($node->term);
84 $tree->insertRootNode($tree_id,
$data->getObjId());
85 $tree->setRootId(
$data->getObjId());
88 foreach((
array) $cms_tree->nodes as $node)
92 $data->setServerId($this->server_id);
93 $data->setMid($this->mid);
94 $data->setCmsId($node->id);
95 $data->setTreeId($tree_id);
96 $data->setTitle($node->title);
97 $data->setTerm($node->term);
101 if($node->parent->id)
107 (
int) $node->parent->id
109 $tree->insertNode(
$data->getObjId(), $parent_id);
static lookupObjId($a_server_id, $a_mid, $a_tree_id, $cms_id)
Create styles array
The data for the language used.
◆ $mid
◆ $server_id
ilECSTreeReader::$server_id |
|
private |
The documentation for this class was generated from the following file: