ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 52 of file class.arGUI.php.

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

References $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 159 of file class.arGUI.php.

159 {
160 }

Referenced by multiAction().

+ Here is the caller graph for this function:

◆ delete()

arGUI::delete (   $id)
Parameters
$id

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

246 {
247 $this->deleteMultiple(array( $id ));
248 }

◆ deleteItems()

arGUI::deleteItems ( )

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

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 }
getDeleteRecordsMessage()
getDeleteRecordMessage()
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12

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

+ Here is the call graph for this function:

◆ executeCommand()

arGUI::executeCommand ( )

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

71 {
72 $cmd = $this->ctrl->getCmd();
73 switch ($cmd) {
74 case "edit":
75 case "update":
76 case "view":
77 case "delete":
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"]
multiAction($action_name="")
static domid_decode($id_to_decode)
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ getDeleteRecordConfirmationMessage()

arGUI::getDeleteRecordConfirmationMessage ( )
Returns
string

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

280 {
281 return $this->txt(('delete_record_confirmation'), true);
282 }
txt($txt, $plugin_txt=true)

References txt().

+ Here is the call graph for this function:

◆ getDeleteRecordMessage()

arGUI::getDeleteRecordMessage ( )
Returns
string

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

313 {
314 return $this->txt(('record_deleted'), true);
315 }

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 272 of file class.arGUI.php.

272 {
273 return $this->txt(('delete_records_confirmation'), true);
274 }

References txt().

+ Here is the call graph for this function:

◆ getDeleteRecordsMessage()

arGUI::getDeleteRecordsMessage ( )
Returns
string

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

305 {
306 return $this->txt(('records_deleted'), true);
307 }

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 329 of file class.arGUI.php.

329 {
330 return $this->lng_prefix;
331 }

References $lng_prefix.

Referenced by txt().

+ Here is the caller graph for this function:

◆ getRecordCreatedMessage()

arGUI::getRecordCreatedMessage ( )
Returns
string

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

225 {
226 return $this->txt(('record_created'), true);
227 }

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 131 of file class.arGUI.php.

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 }
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 212 of file class.arGUI.php.

212 {
213 if ($edit_gui->saveObject()) {
215 $this->ctrl->redirect($this, "index");
216 } else {
217 $this->tpl->setContent($edit_gui->getHTML());
218 }
219 }
getRecordCreatedMessage()

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

+ Here is the call graph for this function:

◆ setLngPrefix()

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

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

321 {
322 $this->lng_prefix = $lng_prefix;
323 }

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 340 of file class.arGUI.php.

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

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

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