ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
arGUI Class Reference
+ Collaboration diagram for arGUI:

Public Member Functions

 __construct ($record_type, ilPlugin $plugin_object=null)
 
 executeCommand ()
 
 multiAction ($action_name="")
 
 customMultiAction ($action_name="", $ids=null)
 
 save (arEditGUI $edit_gui)
 
 getRecordCreatedMessage ()
 
 delete ($id)
 
 getDeleteRecordsConfirmationMessage ()
 
 getDeleteRecordConfirmationMessage ()
 
 deleteItems ()
 
 getDeleteRecordsMessage ()
 
 getDeleteRecordMessage ()
 
 setLngPrefix ($lng_prefix)
 
 getLngPrefix ()
 
 txt ($txt, $plugin_txt=true)
 

Protected Attributes

 $ctrl
 
 $tpl
 
 $access
 
 $lng
 ilLanguage More...
 
 $plugin_object = null
 
 $record_type = ""
 
 $ar
 
 $lng_prefix = ""
 

Detailed Description

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
2.0.7

Definition at line 12 of file class.arGUI.php.

Constructor & Destructor Documentation

◆ __construct()

arGUI::__construct (   $record_type,
ilPlugin  $plugin_object = null 
)
Parameters
$record_type
ilPlugin$plugin_object

Definition at line 53 of file class.arGUI.php.

References $DIC, $ilCtrl, $lng, $plugin_object, $record_type, $tpl, and setLngPrefix().

54  {
55  global $DIC;
56  $tpl = $DIC['tpl'];
57  $ilCtrl = $DIC['ilCtrl'];
58  $ilAccess = $DIC['ilAccess'];
59  $lng = $DIC['lng'];
60 
61  $this->lng = $lng;
62 
63  if ($plugin_object) {
64  $this->setLngPrefix($plugin_object->getPrefix());
65  $plugin_object->loadLanguageModule();
66  }
67 
68  $this->tpl = $tpl;
69  $this->ctrl = $ilCtrl;
70  $this->access = $ilAccess;
71  $this->plugin_object = $plugin_object;
72  $this->record_type = $record_type;
73  $this->ar = new $record_type();
74  }
loadLanguageModule()
Load language module for plugin.
global $DIC
Definition: saml.php:7
$plugin_object
Definition: class.arGUI.php:34
$record_type
Definition: class.arGUI.php:38
global $ilCtrl
Definition: ilias.php:18
getPrefix()
Get plugin prefix, used for lang vars.
$lng
ilLanguage
Definition: class.arGUI.php:30
setLngPrefix($lng_prefix)
+ Here is the call graph for this function:

Member Function Documentation

◆ customMultiAction()

arGUI::customMultiAction (   $action_name = "",
  $ids = null 
)
Parameters
string$action_name
null$ids

Definition at line 170 of file class.arGUI.php.

References $id, add(), save(), and League\Flysystem\Adapter\Polyfill\update().

Referenced by multiAction().

171  {
172  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

arGUI::delete (   $id)
Parameters
$id

Definition at line 265 of file class.arGUI.php.

References $id, getDeleteRecordConfirmationMessage(), getDeleteRecordsConfirmationMessage(), and ilUtil\sendQuestion().

266  {
267  $this->deleteMultiple(array( $id ));
268  }
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the call graph for this function:

◆ deleteItems()

arGUI::deleteItems ( )

Definition at line 308 of file class.arGUI.php.

References $_POST, $i, $id, getDeleteRecordMessage(), and getDeleteRecordsMessage().

309  {
310  $nr_ids = $_POST['nr_ids'];
311  for ($i = 0; $i < $nr_ids; $i++) {
312  $id = $_POST['delete_id_' . $i];
313  $record = $this->ar->find($id);
314  $record->delete();
315  }
316  if ($i == 1) {
317  ilUtil::sendSuccess($this->getDeleteRecordMessage(), true);
318  } else {
319  ilUtil::sendSuccess($this->getDeleteRecordsMessage(), true);
320  }
321 
322  $this->ctrl->redirect($this, "index");
323  }
if(!array_key_exists('StateId', $_REQUEST)) $id
getDeleteRecordMessage()
getDeleteRecordsMessage()
$i
Definition: disco.tpl.php:19
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

arGUI::executeCommand ( )

Definition at line 77 of file class.arGUI.php.

References $_GET, $_POST, arIndexTableGUI\domid_decode(), and multiAction().

78  {
79  $cmd = $this->ctrl->getCmd();
80  switch ($cmd) {
81  case "edit":
82  case "update":
83  case "view":
84  case "delete":
85  $this->$cmd(arIndexTableGUI::domid_decode($_GET['ar_id']));
86  break;
87  case "multiAction":
88  $action_name = $_POST["index_table_multi_action_2"];
89  $this->multiAction($action_name);
90  break;
91  default:
92  $this->$cmd();
93  break;
94  }
95  }
$_GET["client_id"]
static domid_decode($id_to_decode)
multiAction($action_name="")
$_POST["username"]
+ Here is the call graph for this function:

◆ getDeleteRecordConfirmationMessage()

arGUI::getDeleteRecordConfirmationMessage ( )
Returns
string

Definition at line 302 of file class.arGUI.php.

References txt().

Referenced by delete().

303  {
304  return $this->txt(('delete_record_confirmation'), true);
305  }
txt($txt, $plugin_txt=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeleteRecordMessage()

arGUI::getDeleteRecordMessage ( )
Returns
string

Definition at line 338 of file class.arGUI.php.

References txt().

Referenced by deleteItems().

339  {
340  return $this->txt(('record_deleted'), true);
341  }
txt($txt, $plugin_txt=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeleteRecordsConfirmationMessage()

arGUI::getDeleteRecordsConfirmationMessage ( )
Returns
string

Definition at line 293 of file class.arGUI.php.

References txt().

Referenced by delete().

294  {
295  return $this->txt(('delete_records_confirmation'), true);
296  }
txt($txt, $plugin_txt=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeleteRecordsMessage()

arGUI::getDeleteRecordsMessage ( )
Returns
string

Definition at line 329 of file class.arGUI.php.

References txt().

Referenced by deleteItems().

330  {
331  return $this->txt(('records_deleted'), true);
332  }
txt($txt, $plugin_txt=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLngPrefix()

arGUI::getLngPrefix ( )
Returns
string

Definition at line 356 of file class.arGUI.php.

References $lng_prefix.

Referenced by txt().

357  {
358  return $this->lng_prefix;
359  }
+ Here is the caller graph for this function:

◆ getRecordCreatedMessage()

arGUI::getRecordCreatedMessage ( )
Returns
string

Definition at line 242 of file class.arGUI.php.

References $id, and txt().

Referenced by save().

243  {
244  return $this->txt(('record_created'), true);
245  }
txt($txt, $plugin_txt=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ multiAction()

arGUI::multiAction (   $action_name = "")
Parameters
string$action_name

Definition at line 141 of file class.arGUI.php.

References $_POST, $id, customMultiAction(), arIndexTableGUI\domid_decode(), ilUtil\sendFailure(), and txt().

Referenced by executeCommand().

142  {
143  $ids = array();
144  if ($_POST['id']) {
145  foreach ($_POST['id'] as $id) {
146  $ids[] = arIndexTableGUI::domid_decode($id);
147  }
148  }
149 
150  if (empty($ids)) {
151  ilUtil::sendFailure($this->txt("no_checkbox", false), true);
152  $this->ctrl->redirect($this, "index");
153  }
154 
155  switch ($action_name) {
156  case "delete":
157  $this->deleteMultiple($ids);
158  break;
159  default:
160  $this->customMultiAction($action_name, $ids);
161  break;
162  }
163  }
if(!array_key_exists('StateId', $_REQUEST)) $id
static domid_decode($id_to_decode)
customMultiAction($action_name="", $ids=null)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
txt($txt, $plugin_txt=true)
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

arGUI::save ( arEditGUI  $edit_gui)
Parameters
arEditGUI$edit_gui

Definition at line 228 of file class.arGUI.php.

References ilPropertyFormGUI\getHTML(), and getRecordCreatedMessage().

Referenced by customMultiAction().

229  {
230  if ($edit_gui->saveObject()) {
231  ilUtil::sendSuccess($this->getRecordCreatedMessage());
232  $this->ctrl->redirect($this, "index");
233  } else {
234  $this->tpl->setContent($edit_gui->getHTML());
235  }
236  }
getRecordCreatedMessage()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLngPrefix()

arGUI::setLngPrefix (   $lng_prefix)
Parameters
string$lng_prefix

Definition at line 347 of file class.arGUI.php.

References $lng_prefix.

Referenced by __construct().

348  {
349  $this->lng_prefix = $lng_prefix;
350  }
+ Here is the caller graph for this function:

◆ txt()

arGUI::txt (   $txt,
  $plugin_txt = true 
)
Parameters
$txt
bool$plugin_txt
Returns
string

Definition at line 368 of file class.arGUI.php.

References $txt, and getLngPrefix().

Referenced by getDeleteRecordConfirmationMessage(), getDeleteRecordMessage(), getDeleteRecordsConfirmationMessage(), getDeleteRecordsMessage(), getRecordCreatedMessage(), and multiAction().

369  {
370  if ($this->getLngPrefix() != "" && $plugin_txt) {
371  return $this->lng->txt($this->getLngPrefix() . "_" . $txt, $this->getLngPrefix());
372  } else {
373  return $this->lng->txt($txt);
374  }
375  }
getLngPrefix()
$txt
Definition: error.php:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

arGUI::$access
protected

Definition at line 26 of file class.arGUI.php.

◆ $ar

arGUI::$ar
protected

Definition at line 42 of file class.arGUI.php.

◆ $ctrl

arGUI::$ctrl
protected

Definition at line 18 of file class.arGUI.php.

◆ $lng

arGUI::$lng
protected

ilLanguage

Definition at line 30 of file class.arGUI.php.

Referenced by __construct().

◆ $lng_prefix

arGUI::$lng_prefix = ""
protected

Definition at line 46 of file class.arGUI.php.

Referenced by getLngPrefix(), and setLngPrefix().

◆ $plugin_object

arGUI::$plugin_object = null
protected

Definition at line 34 of file class.arGUI.php.

Referenced by __construct().

◆ $record_type

arGUI::$record_type = ""
protected

Definition at line 38 of file class.arGUI.php.

Referenced by __construct().

◆ $tpl

arGUI::$tpl
protected

Definition at line 22 of file class.arGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: