4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"Services/Component/classes/class.ilComponent.php");
24 parent::__construct($a_parent_obj, $a_parent_cmd);
26 $this->
setId(
"repmodtbl");
28 $this->
setTitle($lng->txt(
"cmps_repository_object_types"));
30 $this->
addColumn($lng->txt(
"cmps_add_new_rank"),
"");
31 $this->
addColumn($lng->txt(
"cmps_rep_object"),
"");
32 $this->
addColumn($lng->txt(
"cmps_module"),
"");
33 $this->
addColumn($lng->txt(
"cmps_group"),
"");
34 $this->
addColumn($lng->txt(
"cmps_enable_creation"),
"");
41 $this->
setRowTemplate(
"tpl.table_row_module.html",
"Services/Repository");
47 $this->old_grp_id = 0;
58 $this->pos_group_options = array(0 => $lng->txt(
"rep_new_item_group_unassigned"));
59 $pos_group_map[0] =
"9999";
61 include_once(
"Services/Repository/classes/class.ilObjRepositorySettings.php");
67 $this->pos_group_options[$item[
"id"]] = $item[
"title"];
68 $pos_group_map[$item[
"id"]] = $item[
"pos"];
75 include_once(
"./Services/Component/classes/class.ilModule.php");
80 $objDefinition->getRepositoryObjectTypesForComponent(
IL_COMP_MODULE, $mod[
"subdir"]);
81 if(
sizeof($rep_types) > 0)
83 foreach($rep_types as $ridx => $rt)
92 unset($rep_types[$ridx]);
98 foreach($rep_types as $rt)
100 $obj_types[$rt[
"id"]] = array(
101 "object" => $rt[
"class_name"],
102 "caption" => $lng->txt(
"obj_".$rt[
"id"]),
103 "subdir" => $mod[
"subdir"],
105 "default_pos" => $rt[
"default_pos"]
112 include_once(
"./Services/Component/classes/class.ilPlugin.php");
113 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
114 foreach ($pl_names as $pl_name)
119 $obj_types[$pl_id] = array(
120 "object" => $pl_name,
122 "subdir" => $lng->txt(
"cmps_plugin"),
124 "default_pos" => 2000
131 foreach($obj_types as $obj_type => $item)
133 $org_pos = $ilSetting->get(
"obj_add_new_pos_".$obj_type);
137 $org_pos = $item[
"default_pos"];
139 if(strlen($org_pos) < 8)
142 $org_pos = $pos_group_map[0].str_pad($org_pos, 4,
"0", STR_PAD_LEFT);
145 $pos_grp_id = $ilSetting->get(
"obj_add_new_pos_grp_".$obj_type, 0);
148 if ($item[
"grp"] !=
"")
150 $group = $objDefinition->getGroup($item[
"grp"]);
151 $group = $group[
"name"];
156 "object" => $item[
"object"],
157 "caption" => $item[
"caption"],
158 "subdir" => $item[
"subdir"],
159 "pos" => (
int)substr($org_pos, 4),
160 "pos_group" => $pos_grp_id,
161 "creation" => !(
bool)$ilSetting->get(
"obj_dis_creation_".$obj_type,
false),
162 "group_id" => $item[
"grp"],
164 "sort_key" => (int)$org_pos
180 if($a_set[
"pos_group"] != $this->old_grp_id)
182 $this->tpl->setCurrentBlock(
"pos_grp_bl");
183 $this->tpl->setVariable(
"TXT_POS_GRP", $this->pos_group_options[$a_set[
"pos_group"]]);
184 $this->tpl->parseCurrentBlock();
186 $this->tpl->setCurrentBlock(
"tbl_content");
187 $this->tpl->parseCurrentBlock();
189 $this->css_row = ($this->css_row !=
"tblrow1")
192 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
194 $this->old_grp_id = $a_set[
"pos_group"];
198 if ($a_set[
"group_id"] !=
"")
200 $this->tpl->setCurrentBlock(
"group");
201 $this->tpl->setVariable(
"VAL_GROUP", $a_set[
"group"]);
202 $this->tpl->setVariable(
"VAL_GROUP_ID", $a_set[
"group_id"]);
203 $this->tpl->parseCurrentBlock();
206 $this->tpl->setCurrentBlock(
"rep_object");
208 $this->tpl->setVariable(
"TXT_REP_OBJECT", $a_set[
"caption"]);
209 $this->tpl->setVariable(
"TXT_REP_OBJECT_ID", $a_set[
"id"]);
210 $this->tpl->setVariable(
"IMG_REP_OBJECT",
215 "obj_grp[".$a_set[
"id"].
"]", $this->pos_group_options,
false,
true);
216 $this->tpl->setVariable(
"GROUP_SEL", $sel);
219 $this->tpl->setVariable(
"VAR_POS",
"obj_pos[".$a_set[
"id"].
"]");
223 $this->tpl->setVariable(
"VAR_DISABLE_CREATION",
"obj_enbl_creation[".$a_set[
"id"].
"]");
224 if ($a_set[
"creation"])
226 $this->tpl->setVariable(
"CHECKED_DISABLE_CREATION",
227 ' checked="checked" ');
230 $this->tpl->setVariable(
"TXT_MODULE_NAME", $a_set[
"subdir"]);
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setExternalSorting($a_val)
Set external sorting.
static getNewItemGroups()
__construct($a_parent_obj, $a_parent_cmd="")
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
fillRow($a_set)
Standard Version of Fill Row.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
setLimit($a_limit=0, $a_default_limit=0)
set max.
lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
Lookup id for name.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
getComponents()
Get pages for list.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setEnableHeader($a_enableheader)
Set Enable Header.
TableGUI class for module listing.
const NEW_ITEM_GROUP_TYPE_GROUP
static getAvailableCoreModules()
Get all available core modules.