4 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
20 public function __construct($a_parent_obj, $a_parent_cmd =
"")
22 parent::__construct($a_parent_obj, $a_parent_cmd);
23 $this->
setId(
'tbl_didactic_tpl_settings');
35 $ilAccess = $DIC[
'ilAccess'];
38 $lng->loadLanguageModule(
'search');
39 $lng->loadLanguageModule(
'meta');
40 $this->
addColumn($this->lng->txt(
'search_title_description'),
'title',
'30%');
41 $this->
addColumn($this->lng->txt(
'didactic_applicable_for'),
'applicable',
'20%');
42 $this->
addColumn($this->lng->txt(
'didactic_scope'),
'scope',
'20%');
43 $this->
addColumn($this->lng->txt(
'active'),
'active',
'10%');
44 $this->
addColumn($this->lng->txt(
'actions'),
'',
'20%');
46 $this->
setTitle($this->lng->txt(
'didactic_available_templates'));
48 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
49 $this->
addMultiCommand(
'activateTemplates', $this->lng->txt(
'activate'));
50 $this->
addMultiCommand(
'deactivateTemplates', $this->lng->txt(
'deactivate'));
58 $this->
setRowTemplate(
'tpl.didactic_template_overview_row.html',
'Services/DidacticTemplate');
69 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSettings.php';
71 $tpls->readInactive();
74 foreach ($tpls->getTemplates() as
$tpl) {
78 if (
$tpl->isAutoGenerated()) {
79 $data[$counter][
'title'] = $this->lng->txt(
$tpl->getTitle());
81 $data[$counter][
'title'] =
$tpl->getTitle();
83 $data[$counter][
'description'] =
$tpl->getPresentationDescription();
84 $data[$counter][
'info'] =
$tpl->getInfo();
85 $data[$counter][
'enabled'] = (int)
$tpl->isEnabled();
86 $data[$counter][
'assignments'] =
$tpl->getAssignments();
89 foreach (
$tpl->getAssignments() as $obj_type) {
90 $atxt .= ($this->lng->txt(
'objs_' . $obj_type) .
'<br/>');
92 $data[$counter][
'applicable'] = $atxt;
93 $data[$counter][
'automatic_generated'] =
$tpl->isAutoGenerated();
94 $data[$counter][
'scope'] = (array)
$tpl->getEffectiveFrom();
111 $ilAccess = $DIC[
'ilAccess'];
115 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
116 $this->tpl->setVariable(
'VAL_ID', $set[
'id']);
119 $this->tpl->setVariable(
'VAL_TITLE', $set[
'title']);
120 $this->tpl->setVariable(
'VAL_DESC', $set[
'description']);
122 foreach ((array) explode(
"\n", $set[
'info']) as
$info) {
123 $trimmed_info = trim($info);
125 $this->tpl->setCurrentBlock(
'info');
126 $this->tpl->setVariable(
'VAL_INFO', $trimmed_info);
127 $this->tpl->parseCurrentBlock();
131 if ($set[
'automatic_generated']) {
132 $this->tpl->setVariable(
"VAL_AUTOMATIC_GENERATED", $this->lng->txt(
"didactic_auto_generated"));
136 $this->tpl->setVariable(
142 $this->tpl->setVariable(
145 $this->lng->txt(
'active') :
146 $this->lng->txt(
'inactive')
151 foreach ((array) $set[
'assignments'] as $obj_type) {
152 $atxt .= ($this->lng->txt(
'objs_' . $obj_type) .
'<br/>');
154 $this->tpl->setVariable(
'VAL_APPLICABLE', $atxt);
162 if (count($set[
'scope'])) {
163 $this->tpl->setCurrentBlock(
'scope_txt');
164 $this->tpl->setVariable(
'LOCAL_OR_GLOBAL', $this->lng->txt(
'didactic_scope_list_header'));
165 $this->tpl->parseCurrentBlock();
167 foreach ($set[
'scope'] as $ref_id) {
168 $this->tpl->setCurrentBlock(
'scope_entry');
171 $this->tpl->parseCurrentBlock();
174 $this->tpl->setCurrentBlock(
'scope_txt');
175 $this->tpl->setVariable(
'LOCAL_OR_GLOBAL', $set[
'local'] ? $this->lng->txt(
'meta_local') : $this->lng->txt(
'meta_global'));
176 $this->tpl->parseCurrentBlock();
180 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
181 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
183 $actions->setId($set[
'id']);
184 $actions->setListTitle($this->lng->txt(
"actions"));
187 $this->lng->txt(
'settings'),
194 $this->lng->txt(
'copy'),
201 $this->lng->txt(
'didactic_do_export'),
205 $this->tpl->setVariable(
'ACTION_DROPDOWN', $actions->getHTML());
209 $this->tpl->setCurrentBlock(
'action_link');
210 $this->tpl->setVariable(
214 $this->tpl->setVariable(
'A_TEXT', $this->lng->txt(
'didactic_do_export'));
215 $this->tpl->parseCurrentBlock();
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
Description of ilDidacticTemplateSettingsTableGUI.
static getInstance()
Get singelton instance.
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
static _lookupTitle($a_id)
lookup object title
getParentObject()
Get parent object.
parse()
Parse didactic templates.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")