4 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
24 $query =
'SELECT ref_id FROM ecs_node_mapping_a ' .
25 'WHERE server_id = ' . $ilDB->quote($a_server_id,
'integer') .
' ' .
26 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
27 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ' .
44 public static function lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
48 $query =
'SELECT title_update, position_update, tree_update FROM ecs_node_mapping_a ' .
49 'WHERE server_id = ' . $ilDB->quote($a_server_id,
'integer') .
' ' .
50 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
51 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ' .
52 'AND cs_id = ' . $ilDB->quote($a_node_id,
'integer');
55 if (!
$res->numRows()) {
61 $settings[
'title_update'] =
$row->title_update;
62 $settings[
'position_update'] =
$row->position_update;
63 $settings[
'tree_update'] =
$row->tree_update;
65 return (
array) $settings;
79 $query =
'SELECT cs_id FROM ecs_node_mapping_a ' .
80 'WHERE server_id = ' . $ilDB->quote($a_server_id,
'integer') .
' ' .
81 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
82 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ' .
86 $assignments =
array();
88 $assignments[] =
$row->cs_id;
103 $query =
'SELECT cs_id FROM ecs_node_mapping_a ' .
104 'WHERE server_id = ' . $ilDB->quote($a_server_id,
'integer') .
' ' .
105 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
106 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ' .
107 'AND ref_id = ' . $ilDB->quote($a_ref_id,
'integer') .
' ';
110 $assignments =
array();
112 $assignments[] =
$row->cs_id;
127 $query =
'SELECT depth FROM ecs_node_mapping_a ' .
128 'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) ' .
129 'WHERE server_id = ' . $ilDB->quote($a_server_id,
'integer') .
' ' .
130 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
131 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ';
134 return $row->depth == 1;
146 $query =
'SELECT title_update FROM ecs_node_mapping_a ' .
147 'WHERE server_id = ' . $ilDB->quote($a_server_id,
'integer') .
' ' .
148 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
149 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ' .
150 'AND cs_id = ' . $ilDB->quote(0,
'integer') .
' ';
153 return (
bool)
$row->title_update;
171 $query =
'SELECT cs_id FROM ecs_node_mapping_a ' .
172 'WHERE server_id = ' . $ilDB->quote($a_server_id,
'integer') .
' ' .
173 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
174 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ' .
175 'AND ref_id = ' . $ilDB->quote($a_ref_id,
'integer') .
' ';
180 $cs_ids[] =
$row->cs_id;
199 $query =
'DELETE FROM ecs_node_mapping_a ' .
200 'WHERE server_id = ' . $ilDB->quote($a_server_id) .
' ' .
201 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
202 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ' .
203 'AND ' . $ilDB->in(
'cs_id', $cs_ids,
false,
'integer');
204 $ilDB->manipulate(
$query);
220 $query =
'DELETE FROM ecs_node_mapping_a ' .
221 'WHERE server_id = ' . $ilDB->quote($a_server_id) .
' ' .
222 'AND mid = ' . $ilDB->quote($a_mid,
'integer') .
' ' .
223 'AND cs_root = ' . $ilDB->quote($a_tree_id,
'integer') .
' ';
224 $ilDB->manipulate(
$query);
238 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
239 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
242 foreach (self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id) as $assignment) {
247 $toDelete[] = $assignment;
251 $toDelete[] = $assignment;
257 $toDelete[] = $assignment;
261 $toDelete[] = $assignment;
265 self::deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $toDelete);
const MAPPING_PENDING_DISCONNECTABLE
static lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $cms_id)
Lookup status.
static deleteMappings($a_server_id, $a_mid, $a_tree_id)
Delete mappings $ilDB $ilDB.
static lookupDefaultTitleUpdate($a_server_id, $a_mid, $a_tree_id)
Lookup default title update setting.
static isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)
Check if whole tree is mapped.
foreach($_POST as $key=> $value) $res
static deleteDisconnectableMappings($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
delete disconnectable mappings
static deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $cs_ids)
Delete mappings $ilDB.
static hasAssignments($a_server_id, $a_mid, $a_tree_id)
Check if there is any assignment for a cms tree.
static lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Lookup assignments.
Create styles array
The data for the language used.
static lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id)
Lookup assignments $ilDB.
static lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
Lookup Settings.
static lookupMappedItemsForRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Get cs ids for ref_id <type> $ilDB.
const MAPPING_PENDING_NOT_DISCONNECTABLE