ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
 @ar 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.

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 }
$plugin_object
Definition: class.arGUI.php:34
$lng
@ar ilLanguage
Definition: class.arGUI.php:30
$record_type
Definition: class.arGUI.php:38
setLngPrefix($lng_prefix)
getPrefix()
Get plugin prefix, used for lang vars.
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

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

+ 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.

171 {
172 }

Referenced by multiAction().

+ Here is the caller graph for this function:

◆ delete()

arGUI::delete (   $id)
Parameters
$id

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

266 {
267 $this->deleteMultiple(array( $id ));
268 }

◆ deleteItems()

arGUI::deleteItems ( )

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

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 }
$_POST["username"]
getDeleteRecordsMessage()
getDeleteRecordMessage()
$i
Definition: metadata.php:24

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

+ Here is the call graph for this function:

◆ executeCommand()

arGUI::executeCommand ( )

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

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"]
multiAction($action_name="")
static domid_decode($id_to_decode)

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

+ Here is the call graph for this function:

◆ getDeleteRecordConfirmationMessage()

arGUI::getDeleteRecordConfirmationMessage ( )
Returns
string

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

303 {
304 return $this->txt(('delete_record_confirmation'), true);
305 }
txt($txt, $plugin_txt=true)

References txt().

+ Here is the call graph for this function:

◆ getDeleteRecordMessage()

arGUI::getDeleteRecordMessage ( )
Returns
string

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

339 {
340 return $this->txt(('record_deleted'), true);
341 }

References txt().

Referenced by deleteItems().

+ 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.

294 {
295 return $this->txt(('delete_records_confirmation'), true);
296 }

References txt().

+ Here is the call graph for this function:

◆ getDeleteRecordsMessage()

arGUI::getDeleteRecordsMessage ( )
Returns
string

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

330 {
331 return $this->txt(('records_deleted'), true);
332 }

References txt().

Referenced by deleteItems().

+ 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.

357 {
358 return $this->lng_prefix;
359 }

References $lng_prefix.

Referenced by txt().

+ Here is the caller graph for this function:

◆ getRecordCreatedMessage()

arGUI::getRecordCreatedMessage ( )
Returns
string

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

243 {
244 return $this->txt(('record_created'), true);
245 }

References txt().

Referenced by save().

+ 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.

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 }
customMultiAction($action_name="", $ids=null)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

Referenced by executeCommand().

+ 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.

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()

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

+ Here is the call graph for this function:

◆ setLngPrefix()

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

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

348 {
349 $this->lng_prefix = $lng_prefix;
350 }

References $lng_prefix.

Referenced by __construct().

+ 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.

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:13

References $txt, and getLngPrefix().

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

+ 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

@ar 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: