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').
' '.
45 public static function lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
49 $query =
'SELECT title_update, position_update, tree_update FROM ecs_node_mapping_a '.
50 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
51 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
52 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' '.
53 'AND cs_id = '.$ilDB->quote($a_node_id,
'integer');
64 $settings[
'title_update'] =
$row->title_update;
65 $settings[
'position_update'] =
$row->position_update;
66 $settings[
'tree_update'] =
$row->tree_update;
68 return (array) $settings;
82 $query =
'SELECT cs_id FROM ecs_node_mapping_a '.
83 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
84 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
85 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' '.
89 $assignments = array();
92 $assignments[] =
$row->cs_id;
107 $query =
'SELECT cs_id FROM ecs_node_mapping_a '.
108 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
109 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
110 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' '.
111 'AND ref_id = '.$ilDB->quote($a_ref_id,
'integer').
' ';
114 $assignments = array();
117 $assignments[] =
$row->cs_id;
132 $query =
'SELECT depth FROM ecs_node_mapping_a '.
133 'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) '.
134 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
135 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
136 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' ';
140 return $row->depth == 1;
152 $query =
'SELECT title_update FROM ecs_node_mapping_a '.
153 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
154 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
155 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' '.
156 'AND cs_id = '.$ilDB->quote(0,
'integer').
' ';
160 return (
bool)
$row->title_update;
178 $query =
'SELECT cs_id FROM ecs_node_mapping_a '.
179 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer').
' '.
180 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
181 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' '.
182 'AND ref_id = '.$ilDB->quote($a_ref_id,
'integer').
' ';
188 $cs_ids[] =
$row->cs_id;
207 $query =
'DELETE FROM ecs_node_mapping_a '.
208 'WHERE server_id = '.$ilDB->quote($a_server_id).
' '.
209 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
210 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' '.
211 'AND '.$ilDB->in(
'cs_id',$cs_ids,
false,
'integer');
212 $ilDB->manipulate(
$query);
228 $query =
'DELETE FROM ecs_node_mapping_a '.
229 'WHERE server_id = '.$ilDB->quote($a_server_id).
' '.
230 'AND mid = '.$ilDB->quote($a_mid,
'integer').
' '.
231 'AND cs_root = '.$ilDB->quote($a_tree_id,
'integer').
' ';
232 $ilDB->manipulate(
$query);
246 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
247 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
250 foreach(self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id,$a_ref_id) as $assignment)
257 $toDelete[] = $assignment;
261 $toDelete[] = $assignment;
267 $toDelete[] = $assignment;
271 $toDelete[] = $assignment;