ILIAS  release_8 Revision v8.23
ilBiblLibraryFormGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilBiblLibraryFormGUI:
+ Collaboration diagram for ilBiblLibraryFormGUI:

Public Member Functions

 __construct (ilBiblLibraryInterface $library)
 ilBiblLibraryFormGUI constructor. More...
 
 saveObject ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 
 executeCommand ()
 
 setTableWidth (string $a_width)
 
 getTableWidth ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setTitleIcon (string $a_titleicon)
 
 getTitleIcon ()
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setShowTopButtons (bool $a_val)
 
 getShowTopButtons ()
 
 setForceTopButtons (bool $a_val)
 
 getForceTopButtons ()
 
 addItem ($a_item)
 
 removeItemByPostVar (string $a_post_var, bool $a_remove_unused_headers=false)
 
 getItemByPostVar (string $a_post_var)
 
 setItems (array $a_items)
 
 getItems ()
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage (bool $a_val)
 
 getDisableStandardMessage ()
 
 getHideLabels ()
 
 setHideLabels (bool $a_value=true)
 
 setValuesByArray (array $a_values, bool $a_restrict_to_value_keys=false)
 
 setValuesByPost ()
 
 checkInput ()
 
 getInput (string $a_post_var, bool $ensureValidation=true)
 Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-POST variable, identified by the passed postvar. More...
 
 addCommandButton (string $a_cmd, string $a_text, string $a_id="")
 
 getCommandButtons ()
 
 clearCommandButtons ()
 
 getContent ()
 
 insertItem ( $item, bool $a_sub_item=false)
 
 addAsyncOnloadCode (string $code)
 
 getHTML ()
 
 getHTMLAsync ()
 
 getFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 
 moveFileUpload (string $a_target_directory, string $a_field, ?string $a_target_name=null, ?string $a_index=null, ?string $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

Protected Attributes

ilBiblLibraryInterface $object
 
- Protected Attributes inherited from ilPropertyFormGUI
bool $required_text = false
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTemplate $tpl
 
ilObjUser $user = null
 
ilSetting $settings = null
 
string $mode = "std"
 
bool $check_input_called = false
 
bool $disable_standard_message = false
 
string $top_anchor = "il_form_top"
 
string $title = ''
 
string $titleicon = ""
 
string $description = ""
 
string $tbl_width = ""
 
bool $show_top_buttons = true
 
bool $hide_labels = false
 
bool $force_top_buttons = false
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
ilGlobalTemplateInterface $global_tpl = null
 
 $onload_code = []
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $prevent_double_submission = false
 

Private Member Functions

 initForm ()
 Init settings property form. More...
 
 fillForm ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Bibliographic Libraries Form.

Author
Theodor Truffer
Martin Studer ms@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Constructor & Destructor Documentation

◆ __construct()

ilBiblLibraryFormGUI::__construct ( ilBiblLibraryInterface  $library)

ilBiblLibraryFormGUI constructor.

Definition at line 35 of file class.ilBiblLibraryFormGUI.php.

References ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilBiblLibraryGUI\F_LIB_ID, fillForm(), initForm(), and ILIAS\Repository\object().

36  {
37  $this->object = $library;
38  $this->ctrl()->saveParameterByClass(ilBiblLibraryGUI::class, ilBiblLibraryGUI::F_LIB_ID);
39  $this->initForm();
40 
41  if ($this->object->getId()) {
42  $this->fillForm();
43  }
45  }
initForm()
Init settings property form.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilBiblLibraryFormGUI::fillForm ( )
private

Definition at line 83 of file class.ilBiblLibraryFormGUI.php.

References ILIAS\Repository\object(), and ilPropertyFormGUI\setValuesByArray().

Referenced by __construct(), and initForm().

83  : void
84  {
85  $this->setValuesByArray(array(
86  'name' => $this->object->getName(),
87  'url' => $this->object->getUrl(),
88  'img' => $this->object->getImg(),
89  'show_in_list' => $this->object->isShownInList(),
90  ));
91  }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilBiblLibraryFormGUI::initForm ( )
private

Init settings property form.

private

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

References $img, ilFormGUI\$name, $url, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), fillForm(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilFormGUI\setFormAction(), and ilPropertyFormGUI\setTitle().

Referenced by __construct().

53  : void
54  {
55  $this->setFormAction($this->ctrl()->getFormActionByClass(ilBiblLibraryGUI::class));
56  $name = new ilTextInputGUI($this->lng()->txt("bibl_library_name"), 'name');
57  $name->setRequired(true);
58  $name->setValue('');
59  $this->addItem($name);
60  $url = new ilTextInputGUI($this->lng()->txt("bibl_library_url"), 'url');
61  $url->setRequired(true);
62  $url->setValue('');
63  $this->addItem($url);
64  $img = new ilTextInputGUI($this->lng()->txt("bibl_library_img"), 'img');
65  $img->setValue('');
66  $this->addItem($img);
67  $show_in_list = new ilCheckboxInputGUI($this->lng()
68  ->txt("bibl_library_show_in_list"), 'show_in_list');
69  $show_in_list->setValue('1');
70  $this->addItem($show_in_list);
71  if ($this->object->getId()) {
72  $this->addCommandButton('update', $this->lng()->txt('save'));
73  $this->fillForm();
74  $this->setTitle($this->lng()->txt("bibl_settings_edit"));
75  } else {
76  $this->setTitle($this->lng()->txt("bibl_settings_new"));
77  $this->addCommandButton('create', $this->lng()->txt('save'));
78  }
79  $this->addCommandButton('cancel', $this->lng()->txt("cancel"));
80  }
This class represents a checkbox property in a property form.
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
$img
Definition: imgupload.php:83
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilBiblLibraryFormGUI::saveObject ( )

Definition at line 94 of file class.ilBiblLibraryFormGUI.php.

References ilPropertyFormGUI\checkInput(), and ilPropertyFormGUI\getInput().

94  : bool
95  {
96  if (!$this->checkInput()) {
97  return false;
98  }
99  $this->object->setName($this->getInput("name"));
100  $this->object->setUrl($this->getInput("url"));
101  $this->object->setImg($this->getInput("img"));
102  $this->object->setShowInList((bool) $this->getInput("show_in_list"));
103  $this->object->store();
104 
105  return true;
106  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

Field Documentation

◆ $object

ilBiblLibraryInterface ilBiblLibraryFormGUI::$object
protected

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


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