} else { $tmp = explode("_", Request::quoted('mark_list_aktion')); $item_ids[0] = $tmp[1]; if ($item_ids[0] == "all") { $item_ids = array(); foreach ($_possible_open_items as $key => $value) { if ($key != 'root') { $item_ids[] = $key; } } } for ($i = 0; $i < count($item_ids); ++$i) { $count_ins = 0; for ($j = 0; $j < count($sem_mark_list); ++$j) { if ($sem_mark_list[$j]) { $count_ins += StudipSemTree::InsertSemEntry($item_ids[$i], $sem_mark_list[$j]); } } $_msg .= sprintf(_("%s Veranstaltung(en) in <b>" . htmlReady($the_tree->tree->tree_data[$item_ids[$i]]['name']) . "</b> eingetragen.<br>"), $count_ins); } if ($_msg) { $_msg = "msg§" . $_msg; } $the_tree->tree->init(); } } } if ($the_tree->mode == "MoveItem" || $the_tree->mode == "CopyItem") { if ($_msg) { $_msg .= "§"; }
/** * Sets the study areas of this course. * * @param array an array of IDs * * @return void */ public function setStudyAreas($selected) { $old = $this->getStudyAreas(); $removed = array_diff($old, $selected); $added = array_diff($selected, $old); $count_removed = 0; $count_added = 0; foreach($removed as $one){ $count_removed += StudipSemTree::DeleteSemEntries($one, $this->getId()); } foreach($added as $one){ $count_added += StudipSemTree::InsertSemEntry($one, $this->getId()); } if ($count_added || $count_removed) { NotificationCenter::postNotification("CourseDidChangeStudyArea", $this); } return count($old) + $count_added - $count_removed; }