4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"Services/Component/classes/class.ilComponent.php");
6 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
21 function __construct($a_parent_obj, $a_parent_cmd =
"", $a_has_write =
false)
25 parent::__construct($a_parent_obj, $a_parent_cmd);
27 $this->
setId(
"repmodtbl");
29 $this->
setTitle($lng->txt(
"cmps_repository_object_types"));
31 $this->
addColumn($lng->txt(
"cmps_add_new_rank"),
"");
32 $this->
addColumn($lng->txt(
"cmps_rep_object"),
"");
33 $this->
addColumn($lng->txt(
"cmps_module"),
"");
34 $this->
addColumn($lng->txt(
"cmps_group"),
"");
35 $this->
addColumn($lng->txt(
"cmps_enable_creation"),
"");
37 if((
bool)$a_has_write)
45 $this->
setRowTemplate(
"tpl.table_row_module.html",
"Services/Repository");
51 $this->old_grp_id = 0;
62 $this->pos_group_options =
array(0 => $lng->txt(
"rep_new_item_group_unassigned"));
63 $pos_group_map[0] =
"9999";
65 include_once(
"Services/Repository/classes/class.ilObjRepositorySettings.php");
71 $this->pos_group_options[$item[
"id"]] = $item[
"title"];
72 $pos_group_map[$item[
"id"]] = $item[
"pos"];
79 include_once(
"./Services/Component/classes/class.ilModule.php");
84 $objDefinition->getRepositoryObjectTypesForComponent(
IL_COMP_MODULE, $mod[
"subdir"]);
85 if(
sizeof($rep_types) > 0)
87 foreach($rep_types as $ridx => $rt)
96 unset($rep_types[$ridx]);
102 foreach($rep_types as $rt)
104 $obj_types[$rt[
"id"]] =
array(
105 "object" => $rt[
"class_name"],
106 "caption" => $lng->txt(
"obj_".$rt[
"id"]),
107 "subdir" => $mod[
"subdir"],
109 "default_pos" => $rt[
"default_pos"]
121 foreach($obj_types as $obj_type => $item)
123 $org_pos = $ilSetting->get(
"obj_add_new_pos_".$obj_type);
127 $org_pos = $item[
"default_pos"];
129 if(strlen($org_pos) < 8)
132 $org_pos = $pos_group_map[0].str_pad($org_pos, 4,
"0", STR_PAD_LEFT);
135 $pos_grp_id = $ilSetting->get(
"obj_add_new_pos_grp_".$obj_type, 0);
138 if ($item[
"grp"] !=
"")
140 $group = $objDefinition->getGroup($item[
"grp"]);
141 $group = $group[
"name"];
146 "object" => $item[
"object"],
147 "caption" => $item[
"caption"],
148 "subdir" => $item[
"subdir"],
149 "pos" => (
int)substr($org_pos, 4),
150 "pos_group" => $pos_grp_id,
151 "creation" => !(
bool)$ilSetting->get(
"obj_dis_creation_".$obj_type,
false),
152 "group_id" => $item[
"grp"],
154 "sort_key" => (int)$org_pos
170 if($a_set[
"pos_group"] != $this->old_grp_id)
172 $this->tpl->setCurrentBlock(
"pos_grp_bl");
173 $this->tpl->setVariable(
"TXT_POS_GRP", $this->pos_group_options[$a_set[
"pos_group"]]);
174 $this->tpl->parseCurrentBlock();
176 $this->tpl->setCurrentBlock(
"tbl_content");
177 $this->tpl->parseCurrentBlock();
179 $this->css_row = ($this->css_row !=
"tblrow1")
182 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
184 $this->old_grp_id = $a_set[
"pos_group"];
188 if ($a_set[
"group_id"] !=
"")
190 $this->tpl->setCurrentBlock(
"group");
191 $this->tpl->setVariable(
"VAL_GROUP", $a_set[
"group"]);
192 $this->tpl->setVariable(
"VAL_GROUP_ID", $a_set[
"group_id"]);
193 $this->tpl->parseCurrentBlock();
196 $this->tpl->setCurrentBlock(
"rep_object");
198 $this->tpl->setVariable(
"TXT_REP_OBJECT", $a_set[
"caption"]);
199 $this->tpl->setVariable(
"TXT_REP_OBJECT_ID", $a_set[
"id"]);
200 $this->tpl->setVariable(
"IMG_REP_OBJECT",
205 "obj_grp[".$a_set[
"id"].
"]", $this->pos_group_options,
false,
true);
206 $this->tpl->setVariable(
"GROUP_SEL", $sel);
209 $this->tpl->setVariable(
"VAR_POS",
"obj_pos[".$a_set[
"id"].
"]");
213 $this->tpl->setVariable(
"VAR_DISABLE_CREATION",
"obj_enbl_creation[".$a_set[
"id"].
"]");
214 if ($a_set[
"creation"])
216 $this->tpl->setVariable(
"CHECKED_DISABLE_CREATION",
217 ' checked="checked" ');
220 $this->tpl->setVariable(
"TXT_MODULE_NAME", $a_set[
"subdir"]);
231 global $ilPluginAdmin,
$lng;
232 include_once(
"./Services/Component/classes/class.ilPlugin.php");
233 $pl_names = $ilPluginAdmin->getActivePluginsForSlot($component, $slotName, $slotId);
234 foreach ($pl_names as $pl_name) {
237 $obj_types[$pl_id] =
array(
238 "object" => $pl_name,
240 "subdir" => $lng->txt(
"cmps_plugin"),
242 "default_pos" => 2000
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.
getPluginComponents($obj_types, $component, $slotName, $slotId)
setExternalSorting($a_val)
Set external sorting.
static lookupTxtById($plugin_id, $lang_var)
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.
static lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_plugin_name)
Lookup id for name.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
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.
Create styles array
The data for the language used.
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.