ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 52 of file class.arGUI.php.

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

52  {
53  global $tpl, $ilCtrl, $ilAccess, $lng;
54 
55  $this->lng = $lng;
56 
57  if ($plugin_object) {
58  $this->setLngPrefix($plugin_object->getPrefix());
59  $plugin_object->loadLanguageModule();
60  }
61 
62  $this->tpl = $tpl;
63  $this->ctrl = $ilCtrl;
64  $this->access = $ilAccess;
65  $this->plugin_object = $plugin_object;
66  $this->record_type = $record_type;
67  $this->ar = new $record_type();
68  }
loadLanguageModule()
Load language module for plugin.
$plugin_object
Definition: class.arGUI.php:33
$record_type
Definition: class.arGUI.php:37
global $ilCtrl
Definition: ilias.php:18
getPrefix()
Get plugin prefix, used for lang vars.
$lng
ilLanguage
Definition: class.arGUI.php:29
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 159 of file class.arGUI.php.

References add(), and save().

Referenced by multiAction().

159  {
160  }
+ 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 246 of file class.arGUI.php.

References array, getDeleteRecordConfirmationMessage(), getDeleteRecordsConfirmationMessage(), and ilUtil\sendQuestion().

246  {
247  $this->deleteMultiple(array( $id ));
248  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ deleteItems()

arGUI::deleteItems ( )

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

References $_POST, getDeleteRecordMessage(), getDeleteRecordsMessage(), and ilUtil\sendSuccess().

285  {
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);
290  $record->delete();
291  }
292  if ($i == 1) {
294  } else {
296  }
297 
298  $this->ctrl->redirect($this, "index");
299  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getDeleteRecordMessage()
getDeleteRecordsMessage()
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

arGUI::executeCommand ( )

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

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

71  {
72  $cmd = $this->ctrl->getCmd();
73  switch ($cmd) {
74  case "edit":
75  case "update":
76  case "view":
77  case "delete":
78  $this->$cmd(arIndexTableGUI::domid_decode($_GET['ar_id']));
79  break;
80  case "multiAction":
81  $action_name = $_POST["index_table_multi_action_2"];
82  $this->multiAction($action_name);
83  break;
84  default:
85  $this->$cmd();
86  break;
87  }
88  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
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 280 of file class.arGUI.php.

References txt().

Referenced by delete().

280  {
281  return $this->txt(('delete_record_confirmation'), true);
282  }
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 313 of file class.arGUI.php.

References txt().

Referenced by deleteItems().

313  {
314  return $this->txt(('record_deleted'), true);
315  }
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 272 of file class.arGUI.php.

References txt().

Referenced by delete().

272  {
273  return $this->txt(('delete_records_confirmation'), true);
274  }
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 305 of file class.arGUI.php.

References txt().

Referenced by deleteItems().

305  {
306  return $this->txt(('records_deleted'), true);
307  }
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 329 of file class.arGUI.php.

References $lng_prefix.

Referenced by txt().

329  {
330  return $this->lng_prefix;
331  }
+ Here is the caller graph for this function:

◆ getRecordCreatedMessage()

arGUI::getRecordCreatedMessage ( )
Returns
string

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

References txt().

Referenced by save().

225  {
226  return $this->txt(('record_created'), true);
227  }
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 131 of file class.arGUI.php.

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

Referenced by executeCommand().

131  {
132  $ids = array();
133  if ($_POST['id']) {
134  foreach ($_POST['id'] as $id) {
135  $ids[] = arIndexTableGUI::domid_decode($id);
136  }
137  }
138 
139  if (empty($ids)) {
140  ilUtil::sendFailure($this->txt("no_checkbox", false), true);
141  $this->ctrl->redirect($this, "index");
142  }
143 
144  switch ($action_name) {
145  case "delete":
146  $this->deleteMultiple($ids);
147  break;
148  default:
149  $this->customMultiAction($action_name, $ids);
150  break;
151  }
152  }
static domid_decode($id_to_decode)
customMultiAction($action_name="", $ids=NULL)
Create styles array
The data for the language used.
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 212 of file class.arGUI.php.

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

Referenced by customMultiAction().

212  {
213  if ($edit_gui->saveObject()) {
215  $this->ctrl->redirect($this, "index");
216  } else {
217  $this->tpl->setContent($edit_gui->getHTML());
218  }
219  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 321 of file class.arGUI.php.

References $lng_prefix.

Referenced by __construct().

321  {
322  $this->lng_prefix = $lng_prefix;
323  }
+ 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 340 of file class.arGUI.php.

References $txt, and getLngPrefix().

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

340  {
341  if ($this->getLngPrefix() != "" && $plugin_txt) {
342  return $this->lng->txt($this->getLngPrefix() . "_" . $txt, $this->getLngPrefix());
343  } else {
344  return $this->lng->txt($txt);
345  }
346  }
getLngPrefix()
$txt
Definition: error.php:12
+ 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 25 of file class.arGUI.php.

◆ $ar

arGUI::$ar
protected

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

◆ $ctrl

arGUI::$ctrl
protected

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

◆ $lng

arGUI::$lng
protected

ilLanguage

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

Referenced by __construct().

◆ $lng_prefix

arGUI::$lng_prefix = ""
protected

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

Referenced by getLngPrefix(), and setLngPrefix().

◆ $plugin_object

arGUI::$plugin_object = NULL
protected

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

Referenced by __construct().

◆ $record_type

arGUI::$record_type = ""
protected

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

Referenced by __construct().

◆ $tpl

arGUI::$tpl
protected

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

Referenced by __construct().


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