ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
arEditGUI Class Reference

GUI-Class arEditGUI. More...

+ Inheritance diagram for arEditGUI:
+ Collaboration diagram for arEditGUI:

Public Member Functions

 __construct (arGUI $parent_gui, ActiveRecord $ar)
 setArFieldsAfterSubmit ()
 setFields (arEditFields $fields)
 Setters and Getters *********************.
 getFields ()
 getFieldsAsArray ()
 getField ($field_name)
 addEditField (arEditField $field)
 setFormName ($form_name)
 getFormName ()
 setFormPrefix ($form_prefix)
 getFormPrefix ()
- Public Member Functions inherited from ilPropertyFormGUI
 ilPropertyFormGUI ()
 Constructor.
executeCommand ()
 Execute command.
 setTableWidth ($a_width)
 Set table width.
 getTableWidth ()
 get table width
 setMode ($a_mode)
 Set Mode ('std', 'subform').
 getMode ()
 Get Mode ('std', 'subform').
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setTitleIcon ($a_titleicon)
 Set TitleIcon.
 getTitleIcon ()
 Get TitleIcon.
 setDescription ($a_val)
 Set description.
 getDescription ()
 Get description.
 setTopAnchor ($a_val)
 Set top anchor.
 getTopAnchor ()
 Get top anchor.
 setShowTopButtons ($a_val)
 Get show top buttons.
 getShowTopButtons ()
 Set show top buttons.
 addItem ($a_item)
 Add Item (Property, SectionHeader).
 removeItemByPostVar ($a_post_var)
 Remove Item.
 getItemByPostVar ($a_post_var)
 Get Item by POST variable.
 setItems ($a_items)
 Set Items.
 getItems ()
 Get Items.
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively
 setDisableStandardMessage ($a_val)
 Set disable standard message.
 getDisableStandardMessage ()
 Get disable standard message.
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not.
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not.
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array.
 setValuesByPost ()
 Set form values from POST values.
 checkInput ()
 Check Post Input.
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id.
 addCustomProperty ($a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property.
 addCommandButton ($a_cmd, $a_text)
 Add Command button.
 clearCommandButtons ()
 Remove all command buttons.
 getContent ()
 Get Content.
 insertItem ($item, $a_sub_item=false)
 getHTML ()
 Get HTML.
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data.
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded?
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory.
- Public Member Functions inherited from ilFormGUI
 ilFormGUI ()
 Constructor.
 setFormAction ($a_formaction)
 Set FormAction.
 getFormAction ()
 Get FormAction.
 setTarget ($a_target)
 Set Target.
 getTarget ()
 Get Target.
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false.
 getMultipart ()
 Get Enctype Multipart/Formdata true/false.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setName ($a_name)
 Set Name.
 getName ()
 Get Name.
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open.
 getKeepOpen ()
 Get Keep Form Tag Open.
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag.
 getOpenTag ()
 Get Open Form Tag Enabled.
 setCloseTag ($a_val)
 Set close tag.
 getCloseTag ()
 Get close tag.
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission.
 getPreventDoubleSubmission ()
 Get prevent double submission.

Protected Member Functions

 init ()
 Form Initialization **********************.
 initFields ()
 customizeFields ()
 initForm ()
 beforeInitForm ()
 initFormAction ()
 initFormTitle ()
 addFormField (arEditField $field)
 addBooleanInputField (arEditField $field)
 addTextInputField (arEditField $field)
 addNumbericInputField (arEditField $field)
 addDateTimeInputField (arEditField $field)
 addClobInputField (arEditField $field)
 initCommandButtons ()
 afterInitForm ()
 beforeFillForm ()
 afterFillForm ()
 fillCustomFormField (arEditField $field)
 beforeSave ()
 afterSave ()
 afterValidation ()
 setNumericRecordField (arEditField $field)
 setTextRecordField (arEditField $field)
 setDateTimeRecordField (arEditField $field)
 setCustomRecordField (arEditField $field)
 handleEmptyPostValue (arEditField $field)
 txt ($txt, $plugin_txt=true)
- Protected Member Functions inherited from ilPropertyFormGUI
 keepFileUpload ($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index=null, $a_sub_index=null)
 Import upload into temp directory.
 rebuildUploadedFiles ()
 try to rebuild files

Protected Attributes

 $ar
 $parent_gui
 $ctrl
 $form_name = ""
 $form_prefix = ""
 $fields
- Protected Attributes inherited from ilPropertyFormGUI
 $mode = "std"
 $check_input_called = false
 $disable_standard_message = false
 $top_anchor = "il_form_top"
 $titleicon = false
 $description = ""
 $tbl_width = false
 $show_top_buttons = true
 $reloaded_files
 $hide_labels = false
- Protected Attributes inherited from ilFormGUI
 $formaction
 $multipart = false
 $keepopen = false
 $opentag = true
 $id
 $name
 $prevent_double_submission = false

Detailed Description

GUI-Class arEditGUI.

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 13 of file class.arEditGUI.php.

Constructor & Destructor Documentation

arEditGUI::__construct ( arGUI  $parent_gui,
ActiveRecord  $ar 
)
Parameters
arGUI$parent_gui
ActiveRecord$ar

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

References $ar, $ilCtrl, $parent_gui, init(), and setFormName().

{
global $ilCtrl;
$this->ar = $ar;
$this->parent_gui = $parent_gui;
$this->ctrl = $ilCtrl;
$this->ctrl->saveParameter($parent_gui, 'ar_id');
$this->setFormName(get_class($ar));
$this->init();
}

+ Here is the call graph for this function:

Member Function Documentation

arEditGUI::addBooleanInputField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
ilTextInputGUI

Definition at line 167 of file class.arEditGUI.php.

References arField\getName(), arViewField\getTxt(), and txt().

{
return new ilCheckboxInputGUI($this->txt($field->getTxt()), $field->getName());
}

+ Here is the call graph for this function:

arEditGUI::addClobInputField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
ilTextAreaInputGUI

Definition at line 211 of file class.arEditGUI.php.

References arField\getName(), arViewField\getTxt(), and txt().

Referenced by addFormField().

{
return new ilTextAreaInputGUI($this->txt($field->getTxt()), $field->getName());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::addDateTimeInputField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
ilDateTimeInputGUI

Definition at line 197 of file class.arEditGUI.php.

References arField\getName(), arViewField\getTxt(), IL_CAL_DATE, ilDateTimeInputGUI\setDate(), and txt().

Referenced by addFormField().

{
$date_input = new ilDateTimeInputGUI($this->txt($field->getTxt()), $field->getName());
$date_input->setDate(new ilDate(date('Y-m-d H:i:s'), IL_CAL_DATE));
$date_input->setShowTime(true);
return $date_input;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::addEditField ( arEditField  $field)
Parameters
arEditField

Definition at line 533 of file class.arEditGUI.php.

References getFields().

{
$this->getFields()->addField($field);
}

+ Here is the call graph for this function:

arEditGUI::addFormField ( arEditField  $field)
protected
Parameters
arEditField$field

Definition at line 127 of file class.arEditGUI.php.

References addClobInputField(), addDateTimeInputField(), ilPropertyFormGUI\addItem(), addNumbericInputField(), addTextInputField(), arField\getFieldType(), arEditField\getFormElement(), arField\getNotNull(), arEditField\getSubelementOf(), and arEditField\setFormElement().

{
$field_element = NULL;
if (!$field->getFormElement()) {
switch ($field->getFieldType()) {
case 'integer':
case 'float':
$field->setFormElement($this->addNumbericInputField($field));
break;
break;
case 'date':
case 'time':
case 'timestamp':
$field->setFormElement($this->addDateTimeInputField($field));
break;
case 'clob':
$field->setFormElement($this->addClobInputField($field));
break;
default:
$field->setFormElement($this->addTextInputField($field));
}
if ($field->getNotNull()) {
$field->getFormElement()->setRequired(true);
}
}
if ($field->getFormElement()) {
if ($field->getSubelementOf()) {
$field->getSubelementOf()->addSubItem($field->getFormElement());
} else {
$this->addItem($field->getFormElement());
}
}
}

+ Here is the call graph for this function:

arEditGUI::addNumbericInputField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
ilNumberInputGUI

Definition at line 187 of file class.arEditGUI.php.

References arField\getName(), arViewField\getTxt(), and txt().

Referenced by addFormField().

{
return new ilNumberInputGUI($this->txt($field->getTxt()), $field->getName());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::addTextInputField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
ilTextInputGUI

Definition at line 177 of file class.arEditGUI.php.

References arField\getName(), arViewField\getTxt(), and txt().

Referenced by addFormField().

{
return new ilTextInputGUI($this->txt($field->getTxt()), $field->getName());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::afterFillForm ( )
protected

Definition at line 255 of file class.arEditGUI.php.

{
}
arEditGUI::afterInitForm ( )
protected

Definition at line 226 of file class.arEditGUI.php.

Referenced by initForm().

{
}

+ Here is the caller graph for this function:

arEditGUI::afterSave ( )
protected
Returns
bool

Definition at line 358 of file class.arEditGUI.php.

{
return true;
}
arEditGUI::afterValidation ( )
protected

Definition at line 384 of file class.arEditGUI.php.

Referenced by setArFieldsAfterSubmit().

{
return true;
}

+ Here is the caller graph for this function:

arEditGUI::beforeFillForm ( )
protected

Definition at line 251 of file class.arEditGUI.php.

{
}
arEditGUI::beforeInitForm ( )
protected

Definition at line 92 of file class.arEditGUI.php.

{
}
arEditGUI::beforeSave ( )
protected

Definition at line 350 of file class.arEditGUI.php.

{
return true;
}
arEditGUI::customizeFields ( )
protected

Definition at line 78 of file class.arEditGUI.php.

Referenced by initFields().

{
}

+ Here is the caller graph for this function:

arEditGUI::fillCustomFormField ( arEditField  $field)
protected
Parameters
arEditField$field

Definition at line 294 of file class.arEditGUI.php.

{
}
arEditGUI::getField (   $field_name)
Parameters
$field_name
Returns
arEditField

Definition at line 525 of file class.arEditGUI.php.

References getFields().

{
return $this->getFields()->getField($field_name);
}

+ Here is the call graph for this function:

arEditGUI::getFields ( )
Returns
arEditFields

Definition at line 507 of file class.arEditGUI.php.

References $fields.

Referenced by addEditField(), getField(), and getFieldsAsArray().

{
return $this->fields;
}

+ Here is the caller graph for this function:

arEditGUI::getFieldsAsArray ( )
Returns
arEditField []

Definition at line 515 of file class.arEditGUI.php.

References getFields().

{
return $this->getFields()->getFields();
}

+ Here is the call graph for this function:

arEditGUI::getFormName ( )
Returns
string

Definition at line 560 of file class.arEditGUI.php.

References $form_name.

Referenced by initFormTitle().

{
}

+ Here is the caller graph for this function:

arEditGUI::getFormPrefix ( )
Returns
string

Definition at line 576 of file class.arEditGUI.php.

References $form_prefix.

Referenced by initFormTitle().

{
}

+ Here is the caller graph for this function:

arEditGUI::handleEmptyPostValue ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
bool

Definition at line 487 of file class.arEditGUI.php.

{
return true;
}
arEditGUI::init ( )
protected

Form Initialization **********************.

Definition at line 62 of file class.arEditGUI.php.

References initFields(), and initForm().

Referenced by __construct().

{
$this->initFields();
$this->initForm();
if ($this->ar->getPrimaryFieldValue() != 0) {
$this->fillForm();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::initCommandButtons ( )
protected

Definition at line 216 of file class.arEditGUI.php.

References ilPropertyFormGUI\addCommandButton(), and txt().

Referenced by initForm().

{
if ($this->ar->getPrimaryFieldValue() == 0) {
$this->addCommandButton('create', $this->txt('create', false));
} else {
$this->addCommandButton('update', $this->txt('save', false));
}
$this->addCommandButton('index', $this->txt('cancel', false));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::initFields ( )
protected

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

References customizeFields(), and fields.

Referenced by init().

{
$this->fields = new arEditFields($this->ar);
$this->customizeFields();
$this->fields->sortFields();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::initForm ( )
protected

Definition at line 82 of file class.arEditGUI.php.

References afterInitForm(), initCommandButtons(), initFormAction(), and initFormTitle().

Referenced by init().

{
$this->BeforeInitForm();
$this->initFormAction();
$this->initFormTitle();
$this->generateFormFields();
$this->afterInitForm();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::initFormAction ( )
protected

Definition at line 96 of file class.arEditGUI.php.

References ilFormGUI\setFormAction().

Referenced by initForm().

{
$this->setFormAction($this->ctrl->getFormAction($this->parent_gui, "index"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::initFormTitle ( )
protected

Definition at line 101 of file class.arEditGUI.php.

References getFormName(), getFormPrefix(), setFormPrefix(), ilPropertyFormGUI\setTitle(), and txt().

Referenced by initForm().

{
$this->setFormPrefix("");
if ($this->ar->getPrimaryFieldValue() == 0) {
$this->setTitle($this->txt($this->getFormPrefix() . 'create_' . $this->getFormName()));
} else {
$this->setTitle($this->txt($this->getFormPrefix() . 'edit_' . $this->getFormName()));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

arEditGUI::setArFieldsAfterSubmit ( )
Returns
bool

Definition at line 366 of file class.arEditGUI.php.

References afterValidation(), ilPropertyFormGUI\checkInput(), and fields.

{
if (!$this->checkInput()) {
return false;
}
if (!$this->afterValidation()) {
return false;
}
foreach ($this->fields->getFields() as $field) {
if (!$this->setArFieldAfterSubmit($field)) {
return false;
}
}
return true;
}

+ Here is the call graph for this function:

arEditGUI::setCustomRecordField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
bool

Definition at line 477 of file class.arEditGUI.php.

{
return true;
}
arEditGUI::setDateTimeRecordField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
bool

Definition at line 458 of file class.arEditGUI.php.

References ilPropertyFormGUI\getInput(), arField\getName(), arViewField\getSetFunctionName(), and IL_CAL_DATETIME.

{
$set_function = $field->getSetFunctionName();
$value = $this->getInput($field->getName());
if ($value['time']) {
$datetime = new ilDateTime($value['date'] . " " . $value['time'], IL_CAL_DATETIME);
} else {
$datetime = new ilDateTime($value['date'], IL_CAL_DATETIME);
}
$this->ar->$set_function($datetime);
return true;
}

+ Here is the call graph for this function:

arEditGUI::setFields ( arEditFields  $fields)

Setters and Getters *********************.

Parameters
arEditFields$fields

Definition at line 499 of file class.arEditGUI.php.

References $fields, and fields.

{
$this->fields = $fields;
}
arEditGUI::setFormName (   $form_name)
Parameters
string$form_name

Definition at line 552 of file class.arEditGUI.php.

References $form_name.

Referenced by __construct().

{
$this->form_name = $form_name;
}

+ Here is the caller graph for this function:

arEditGUI::setFormPrefix (   $form_prefix)
Parameters
string$form_prefix

Definition at line 568 of file class.arEditGUI.php.

References $form_prefix.

Referenced by initFormTitle().

{
$this->form_prefix = $form_prefix;
}

+ Here is the caller graph for this function:

arEditGUI::setNumericRecordField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
bool

Definition at line 432 of file class.arEditGUI.php.

References ilPropertyFormGUI\getInput(), arField\getName(), and arViewField\getSetFunctionName().

{
$set_function = $field->getSetFunctionName();
$this->ar->$set_function($this->getInput($field->getName()));
return true;
}

+ Here is the call graph for this function:

arEditGUI::setTextRecordField ( arEditField  $field)
protected
Parameters
arEditField$field
Returns
bool

Definition at line 445 of file class.arEditGUI.php.

References ilPropertyFormGUI\getInput(), arField\getName(), and arViewField\getSetFunctionName().

{
$set_function = $field->getSetFunctionName();
$this->ar->$set_function($this->getInput($field->getName()));
return true;
}

+ Here is the call graph for this function:

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

Definition at line 544 of file class.arEditGUI.php.

References $txt.

Referenced by addBooleanInputField(), addClobInputField(), addDateTimeInputField(), addNumbericInputField(), addTextInputField(), initCommandButtons(), and initFormTitle().

{
return $this->parent_gui->txt($txt, $plugin_txt);
}

+ Here is the caller graph for this function:

Field Documentation

arEditGUI::$ar
protected

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

Referenced by __construct().

arEditGUI::$ctrl
protected

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

arEditGUI::$fields
protected

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

Referenced by getFields(), and setFields().

arEditGUI::$form_name = ""
protected

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

Referenced by getFormName(), and setFormName().

arEditGUI::$form_prefix = ""
protected

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

Referenced by getFormPrefix(), and setFormPrefix().

arEditGUI::$parent_gui
protected

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

Referenced by __construct().


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