4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"Services/Component/classes/class.ilComponent.php");
20 function __construct($a_parent_obj, $a_parent_cmd =
"", $a_has_write =
false)
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"),
"");
36 if((
bool)$a_has_write)
44 $this->
setRowTemplate(
"tpl.table_row_module.html",
"Services/Repository");
50 $this->old_grp_id = 0;
61 $this->pos_group_options = array(0 => $lng->txt(
"rep_new_item_group_unassigned"));
62 $pos_group_map[0] =
"9999";
64 include_once(
"Services/Repository/classes/class.ilObjRepositorySettings.php");
70 $this->pos_group_options[$item[
"id"]] = $item[
"title"];
71 $pos_group_map[$item[
"id"]] = $item[
"pos"];
78 include_once(
"./Services/Component/classes/class.ilModule.php");
83 $objDefinition->getRepositoryObjectTypesForComponent(
IL_COMP_MODULE, $mod[
"subdir"]);
84 if(
sizeof($rep_types) > 0)
86 foreach($rep_types as $ridx => $rt)
95 unset($rep_types[$ridx]);
101 foreach($rep_types as $rt)
103 $obj_types[$rt[
"id"]] = array(
104 "object" => $rt[
"class_name"],
105 "caption" => $lng->txt(
"obj_".$rt[
"id"]),
106 "subdir" => $mod[
"subdir"],
108 "default_pos" => $rt[
"default_pos"]
115 include_once(
"./Services/Component/classes/class.ilPlugin.php");
116 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
117 foreach ($pl_names as $pl_name)
122 $obj_types[$pl_id] = array(
123 "object" => $pl_name,
125 "subdir" => $lng->txt(
"cmps_plugin"),
127 "default_pos" => 2000
134 foreach($obj_types as $obj_type => $item)
136 $org_pos = $ilSetting->get(
"obj_add_new_pos_".$obj_type);
140 $org_pos = $item[
"default_pos"];
142 if(strlen($org_pos) < 8)
145 $org_pos = $pos_group_map[0].str_pad($org_pos, 4,
"0", STR_PAD_LEFT);
148 $pos_grp_id = $ilSetting->get(
"obj_add_new_pos_grp_".$obj_type, 0);
151 if ($item[
"grp"] !=
"")
153 $group = $objDefinition->getGroup($item[
"grp"]);
154 $group = $group[
"name"];
159 "object" => $item[
"object"],
160 "caption" => $item[
"caption"],
161 "subdir" => $item[
"subdir"],
162 "pos" => (
int)substr($org_pos, 4),
163 "pos_group" => $pos_grp_id,
164 "creation" => !(
bool)$ilSetting->get(
"obj_dis_creation_".$obj_type,
false),
165 "group_id" => $item[
"grp"],
167 "sort_key" => (int)$org_pos
183 if($a_set[
"pos_group"] != $this->old_grp_id)
185 $this->tpl->setCurrentBlock(
"pos_grp_bl");
186 $this->tpl->setVariable(
"TXT_POS_GRP", $this->pos_group_options[$a_set[
"pos_group"]]);
187 $this->tpl->parseCurrentBlock();
189 $this->tpl->setCurrentBlock(
"tbl_content");
190 $this->tpl->parseCurrentBlock();
192 $this->css_row = ($this->css_row !=
"tblrow1")
195 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
197 $this->old_grp_id = $a_set[
"pos_group"];
201 if ($a_set[
"group_id"] !=
"")
203 $this->tpl->setCurrentBlock(
"group");
204 $this->tpl->setVariable(
"VAL_GROUP", $a_set[
"group"]);
205 $this->tpl->setVariable(
"VAL_GROUP_ID", $a_set[
"group_id"]);
206 $this->tpl->parseCurrentBlock();
209 $this->tpl->setCurrentBlock(
"rep_object");
211 $this->tpl->setVariable(
"TXT_REP_OBJECT", $a_set[
"caption"]);
212 $this->tpl->setVariable(
"TXT_REP_OBJECT_ID", $a_set[
"id"]);
213 $this->tpl->setVariable(
"IMG_REP_OBJECT",
218 "obj_grp[".$a_set[
"id"].
"]", $this->pos_group_options,
false,
true);
219 $this->tpl->setVariable(
"GROUP_SEL", $sel);
222 $this->tpl->setVariable(
"VAR_POS",
"obj_pos[".$a_set[
"id"].
"]");
226 $this->tpl->setVariable(
"VAR_DISABLE_CREATION",
"obj_enbl_creation[".$a_set[
"id"].
"]");
227 if ($a_set[
"creation"])
229 $this->tpl->setVariable(
"CHECKED_DISABLE_CREATION",
230 ' checked="checked" ');
233 $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()
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
__construct($a_parent_obj, $a_parent_cmd="", $a_has_write=false)
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.
lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
Lookup id for name.
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
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setLimit($a_limit=0, $a_default_limit=0)
static getAvailableCoreModules()
Get all available core modules.