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');
41 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_has_write =
false)
45 $this->ctrl = $DIC->ctrl();
46 $this->lng = $DIC->language();
47 $this->obj_definition = $DIC[
"objDefinition"];
49 $this->plugin_admin = $DIC[
"ilPluginAdmin"];
51 $lng = $DIC->language();
53 parent::__construct($a_parent_obj, $a_parent_cmd);
55 $this->
setId(
"repmodtbl");
57 $this->
setTitle(
$lng->txt(
"cmps_repository_object_types"));
65 if ((
bool) $a_has_write) {
72 $this->
setRowTemplate(
"tpl.table_row_module.html",
"Services/Repository");
78 $this->old_grp_id = 0;
92 $this->pos_group_options = array(0 =>
$lng->txt(
"rep_new_item_group_unassigned"));
93 $pos_group_map[0] =
"9999";
95 include_once(
"Services/Repository/classes/class.ilObjRepositorySettings.php");
99 $this->pos_group_options[$item[
"id"]] = $item[
"title"];
100 $pos_group_map[$item[
"id"]] = $item[
"pos"];
104 $obj_types = array();
107 include_once(
"./Services/Component/classes/class.ilModule.php");
111 $objDefinition->getRepositoryObjectTypesForComponent(
IL_COMP_MODULE, $mod[
"subdir"]);
112 if (
sizeof($rep_types) > 0) {
113 foreach ($rep_types as $ridx => $rt) {
115 if ($rt[
"repository"]) {
118 unset($rep_types[$ridx]);
123 foreach ($rep_types as $rt) {
124 $obj_types[$rt[
"id"]] = array(
125 "object" => $rt[
"class_name"],
126 "caption" =>
$lng->txt(
"obj_" . $rt[
"id"]),
127 "subdir" => $mod[
"subdir"],
129 "default_pos" => $rt[
"default_pos"]
141 foreach ($obj_types as $obj_type => $item) {
142 $org_pos =
$ilSetting->get(
"obj_add_new_pos_" . $obj_type);
143 if (!(
int) $org_pos) {
145 $org_pos = $item[
"default_pos"];
147 if (strlen($org_pos) < 8) {
149 $org_pos = $pos_group_map[0] . str_pad($org_pos, 4,
"0", STR_PAD_LEFT);
152 $pos_grp_id =
$ilSetting->get(
"obj_add_new_pos_grp_" . $obj_type, 0);
155 if ($item[
"grp"] !=
"") {
156 $group = $objDefinition->getGroup($item[
"grp"]);
157 $group = $group[
"name"];
162 "object" => $item[
"object"],
163 "caption" => $item[
"caption"],
164 "subdir" => $item[
"subdir"],
165 "pos" => (
int) substr($org_pos, 4),
166 "pos_group" => $pos_grp_id,
167 "creation" => !(
bool)
$ilSetting->get(
"obj_dis_creation_" . $obj_type,
false),
168 "group_id" => $item[
"grp"],
170 "sort_key" => (int) $org_pos
185 if ($a_set[
"pos_group"] != $this->old_grp_id) {
186 $this->tpl->setCurrentBlock(
"pos_grp_bl");
187 $this->tpl->setVariable(
"TXT_POS_GRP", $this->pos_group_options[$a_set[
"pos_group"]]);
188 $this->tpl->parseCurrentBlock();
190 $this->tpl->setCurrentBlock(
"tbl_content");
191 $this->tpl->parseCurrentBlock();
193 $this->css_row = ($this->css_row !=
"tblrow1")
196 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
198 $this->old_grp_id = $a_set[
"pos_group"];
202 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(
215 ilObject::_getIcon(
"",
"tiny", $a_set[
"id"])
221 "obj_grp[" . $a_set[
"id"] .
"]",
222 $this->pos_group_options,
226 $this->tpl->setVariable(
"GROUP_SEL", $sel);
229 $this->tpl->setVariable(
"VAR_POS",
"obj_pos[" . $a_set[
"id"] .
"]");
233 $this->tpl->setVariable(
"VAR_DISABLE_CREATION",
"obj_enbl_creation[" . $a_set[
"id"] .
"]");
234 if ($a_set[
"creation"]) {
235 $this->tpl->setVariable(
236 "CHECKED_DISABLE_CREATION",
237 ' checked="checked" ' 241 $this->tpl->setVariable(
"TXT_MODULE_NAME", $a_set[
"subdir"]);
255 include_once(
"./Services/Component/classes/class.ilPlugin.php");
256 $pl_names = $ilPluginAdmin->getActivePluginsForSlot($component, $slotName, $slotId);
257 foreach ($pl_names as $pl_name) {
260 $obj_types[$pl_id] = array(
261 "object" => $pl_name,
263 "subdir" =>
$lng->txt(
"cmps_plugin"),
265 "default_pos" => 2000
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getPluginComponents($obj_types, $component, $slotName, $slotId)
setExternalSorting($a_val)
Set external sorting.
static lookupTxtById($plugin_id, $lang_var)
static getNewItemGroups()
__construct($a_parent_obj, $a_parent_cmd="", $a_has_write=false)
fillRow($a_set)
Standard Version of Fill Row.
static lookupIdForName(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_name)
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
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.
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.
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.
setEnableHeader($a_enableheader)
Set Enable Header.
TableGUI class for module listing.
const NEW_ITEM_GROUP_TYPE_GROUP
setLimit($a_limit=0, $a_default_limit=0)
static getAvailableCoreModules()
Get all available core modules.