2 include_once(
"./Services/Component/classes/class.ilPluginConfigGUI.php");
3 include_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/class.ActiveRecordList.php');
4 include_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/Views/Index/class.arIndexTableGUI.php');
5 include_once(
'./Services/UICore/classes/class.ilTemplate.php');
64 $this->access = $ilAccess;
72 $cmd = $this->ctrl->getCmd();
81 $action_name =
$_POST[
"index_table_multi_action_2"];
96 $index_table_gui_class = $this->record_type .
"IndexTableGUI";
100 $table_gui =
new $index_table_gui_class($this,
"index",
new ActiveRecordList($this->ar));
102 $this->tpl->setContent($table_gui->getHTML());
106 function applyFilter() {
107 $index_table_gui_class = $this->record_type .
"IndexTableGUI";
111 $table_gui =
new $index_table_gui_class($this,
"index",
new ActiveRecordList($this->ar));
112 $table_gui->applyFilter();
117 function resetFilter() {
118 $index_table_gui_class = $this->record_type .
"IndexTableGUI";
122 $table_gui =
new $index_table_gui_class($this,
"index",
new ActiveRecordList($this->ar));
123 $table_gui->resetFilter();
134 foreach (
$_POST[
'id'] as $id) {
141 $this->ctrl->redirect($this,
"index");
144 switch ($action_name) {
146 $this->deleteMultiple($ids);
167 $edit_gui_class = $this->record_type .
"EditGUI";
171 $edit_gui =
new $edit_gui_class($this, $this->ar->find($id));
172 $this->tpl->setContent($edit_gui->getHTML());
177 $edit_gui_class = $this->record_type .
"EditGUI";
181 $edit_gui =
new $edit_gui_class($this, $this->ar);
182 $this->tpl->setContent($edit_gui->getHTML());
186 public function create() {
187 $edit_gui_class = $this->record_type .
"EditGUI";
191 $edit_gui =
new $edit_gui_class($this, $this->ar);
192 $this->
save($edit_gui);
199 public function update($id) {
200 $edit_gui_class = $this->record_type .
"EditGUI";
204 $edit_gui =
new $edit_gui_class($this, $this->ar->find($id));
205 $this->
save($edit_gui);
213 if ($edit_gui->saveObject()) {
215 $this->ctrl->redirect($this,
"index");
217 $this->tpl->setContent($edit_gui->
getHTML());
226 return $this->
txt((
'record_created'),
true);
234 $display_gui_class = $this->record_type .
"DisplayGUI";
238 $display_gui =
new $display_gui_class($this, $this->ar->find($id));
239 $this->tpl->setContent($display_gui->getHtml());
246 function delete($id) {
247 $this->deleteMultiple(array( $id ));
254 function deleteMultiple($ids = NULL) {
255 $delete_gui_class = $this->record_type .
"DeleteGUI";
259 $delete_gui =
new $delete_gui_class($this,
"delete",
new ActiveRecordList($this->ar),
"delete", $ids);
260 if (count($ids) == 1) {
265 $this->tpl->setContent($delete_gui->getHTML());
273 return $this->
txt((
'delete_records_confirmation'),
true);
281 return $this->
txt((
'delete_record_confirmation'),
true);
286 $nr_ids =
$_POST[
'nr_ids'];
287 for ($i = 0; $i < $nr_ids; $i ++) {
288 $id =
$_POST[
'delete_id_' . $i];
289 $record = $this->ar->find($id);
298 $this->ctrl->redirect($this,
"index");
306 return $this->
txt((
'records_deleted'),
true);
314 return $this->
txt((
'record_deleted'),
true);
340 public function txt(
$txt, $plugin_txt =
true) {
344 return $this->lng->txt(
$txt);