4 include_once(
"./Services/Object/classes/class.ilObject.php");
25 public function __construct($a_id, $a_call_by_reference =
true)
28 parent::__construct($a_id, $a_call_by_reference);
31 public function delete()
41 $ilDB = $DIC->database();
44 $pos =
$ilDB->query(
"SELECT max(pos) mpos FROM il_new_item_grp");
45 $pos =
$ilDB->fetchAssoc($pos);
46 $pos = (int) $pos[
"mpos"];
49 $seq =
$ilDB->nextID(
"il_new_item_grp");
51 $ilDB->manipulate(
"INSERT INTO il_new_item_grp" .
52 " (id, pos, type) VALUES (" .
53 $ilDB->quote($seq,
"integer") .
54 ", " .
$ilDB->quote($pos,
"integer") .
55 ", " .
$ilDB->quote(self::NEW_ITEM_GROUP_TYPE_SEPARATOR,
"integer") .
64 $ilDB = $DIC->database();
67 $pos =
$ilDB->query(
"SELECT max(pos) mpos FROM il_new_item_grp");
68 $pos =
$ilDB->fetchAssoc($pos);
69 $pos = (int) $pos[
"mpos"];
72 $seq =
$ilDB->nextID(
"il_new_item_grp");
74 $ilDB->manipulate(
"INSERT INTO il_new_item_grp" .
75 " (id, titles, pos, type) VALUES (" .
76 $ilDB->quote($seq,
"integer") .
77 ", " .
$ilDB->quote(serialize($a_titles),
"text") .
78 ", " .
$ilDB->quote($pos,
"integer") .
79 ", " .
$ilDB->quote(self::NEW_ITEM_GROUP_TYPE_GROUP,
"integer") .
88 $ilDB = $DIC->database();
90 $ilDB->manipulate(
"UPDATE il_new_item_grp" .
91 " SET titles = " .
$ilDB->quote(serialize($a_titles),
"text") .
92 " WHERE id = " .
$ilDB->quote($a_id,
"integer"));
100 $ilDB = $DIC->database();
104 $sub_items = self::getNewItemGroupSubItems();
105 $sub_items = $sub_items[$a_id];
107 foreach ($sub_items as $obj_type) {
108 $old_pos =
$ilSetting->get(
"obj_add_new_pos_" . $obj_type);
109 if (strlen($old_pos) == 8) {
110 $new_pos =
"9999" . substr($old_pos, 4);
111 $ilSetting->set(
"obj_add_new_pos_" . $obj_type, $new_pos);
112 $ilSetting->set(
"obj_add_new_pos_grp_" . $obj_type, 0);
117 $ilDB->manipulate(
"DELETE FROM il_new_item_grp" .
118 " WHERE id = " .
$ilDB->quote($a_id,
"integer"));
126 $ilDB = $DIC->database();
127 $lng = $DIC->language();
130 $def_lng =
$lng->getDefaultLanguage();
131 $usr_lng =
$ilUser->getLanguage();
135 $set =
$ilDB->query(
"SELECT * FROM il_new_item_grp ORDER BY pos");
137 if (
$row[
"type"] == self::NEW_ITEM_GROUP_TYPE_GROUP) {
138 $row[
"titles"] = unserialize(
$row[
"titles"]);
149 $row[
"title"] =
$lng->txt(
"rep_new_item_group_separator");
162 $ilDB = $DIC->database();
166 foreach (array_keys($a_order) as
$id) {
169 $ilDB->manipulate(
"UPDATE il_new_item_grp" .
170 " SET pos = " .
$ilDB->quote($pos,
"integer") .
171 " WHERE id = " .
$ilDB->quote($id,
"integer"));
179 $ilPluginAdmin = $DIC[
"ilPluginAdmin"];
185 include_once(
"./Services/Component/classes/class.ilModule.php");
189 if (
sizeof($rep_types) > 0) {
190 foreach ($rep_types as $ridx => $rt) {
192 if ($rt[
"repository"]) {
195 unset($rep_types[$ridx]);
200 foreach ($rep_types as $rt) {
207 include_once(
"./Services/Component/classes/class.ilPlugin.php");
208 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
209 foreach ($pl_names as $pl_name) {
227 foreach (self::getAllObjTypes() as
$type) {
228 $pos_grp =
$ilSetting->get(
"obj_add_new_pos_grp_" . $type, 0);
239 $lng = $DIC->language();
244 "organisation" =>
array(
"fold",
"sess",
"cat",
"catr",
"crs",
"crsr",
"grp",
"grpr",
"itgr",
"book",
"prg"),
245 "communication" =>
array(
"frm",
"chtr"),
247 "content" =>
array(
"file",
"webr",
"feed",
"wiki",
"blog",
"lm",
"htlm",
"sahs",
"glo",
"dcl",
"bibl",
"mcst",
"mep"),
249 "assessment" =>
array(
"exc",
"tst",
"qpl",
"iass"),
250 "feedback" =>
array(
"poll",
"svy",
"spl"),
251 "templates" =>
array(
"prtt")
255 foreach ($groups as $group => $items) {
259 if (is_array($items)) {
260 $title =
$lng->txt(
"rep_add_new_def_grp_" . $group);
262 $res[
"groups"][$grp_id] =
array(
"id" => $grp_id,
265 "type" => self::NEW_ITEM_GROUP_TYPE_GROUP,
268 foreach ($items as $idx => $item) {
269 $res[
"items"][$item] = $grp_id;
270 $res[
"sort"][$item] = str_pad($pos, 4,
"0", STR_PAD_LEFT) .
271 str_pad($idx+1, 4,
"0", STR_PAD_LEFT);
276 $res[
"groups"][$grp_id] =
array(
"id" => $grp_id,
279 "type" => self::NEW_ITEM_GROUP_TYPE_SEPARATOR,
static addNewItemGroupSeparator()
__construct($a_id, $a_call_by_reference=true)
Constructor public.
static getNewItemGroups()
static getNewItemGroupSubItems()
static lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
Lookup id for name.
const NEW_ITEM_GROUP_TYPE_SEPARATOR
static deleteNewItemGroup($a_id)
foreach($_POST as $key=> $value) $res
static deleteObjectType($a_type)
static getDefaultNewItemGrouping()
Create styles array
The data for the language used.
static updateNewItemGroupOrder(array $a_order)
static addNewItemGroup(array $a_titles)
static updateNewItemGroup($a_id, array $a_titles)
const NEW_ITEM_GROUP_TYPE_GROUP
Class ilObjRepositorySettings.
static getAvailableCoreModules()
Get all available core modules.