ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeTypeCustomIconsFormGUI Class Reference

Class ilStudyProgrammeTypeFormGUI. More...

+ Inheritance diagram for ilStudyProgrammeTypeCustomIconsFormGUI:
+ Collaboration diagram for ilStudyProgrammeTypeCustomIconsFormGUI:

Public Member Functions

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

Protected Attributes

 $type_repo
 
 $tpl
 
 $lng
 
 $ctrl
 
 $parent_gui
 
- Protected Attributes inherited from ilPropertyFormGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $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
 
 $hide_labels = false
 
 $force_top_buttons = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeTypeCustomIconsFormGUI::__construct (   $parent_gui,
ilStudyProgrammeTypeRepository  $type_repo 
)
Parameters
$parent_gui
ilStudyProgrammeType$type

Definition at line 40 of file class.ilStudyProgrammeTypeCustomIconsFormGUI.php.

References $DIC, $lng, $parent_gui, $tpl, $type_repo, initForm(), and user().

41  {
42  global $DIC;
43  $tpl = $DIC['tpl'];
44  $ilCtrl = $DIC['ilCtrl'];
45  $lng = $DIC['lng'];
46  $this->webdir = $DIC->filesystem()->web();
47  $this->parent_gui = $parent_gui;
48  $this->user = $DIC['ilUser'];
49  $this->type_repo = $type_repo;
50  $this->tpl = $tpl;
51  $this->ctrl = $ilCtrl;
52  $this->lng = $lng;
53 
54  $this->lng->loadLanguageModule('meta');
55  $this->initForm();
56  }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilStudyProgrammeTypeCustomIconsFormGUI::fillForm ( ilStudyProgrammeType  $type)

Add all fields to the form.

Definition at line 95 of file class.ilStudyProgrammeTypeCustomIconsFormGUI.php.

References Vendor\Package\$e, $type, ilPropertyFormGUI\checkInput(), ilStudyProgrammeType\getIcon(), ilStudyProgrammeType\getIconPath(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilUtil\getWebspaceDir(), ilStudyProgrammeType\processAndStoreIconFile(), ilStudyProgrammeType\removeIconFile(), ilUtil\sendFailure(), ilStudyProgrammeType\setIcon(), and ilPropertyFormGUI\setValuesByPost().

96  {
97  $item = $this->getItemByPostVar('icon');
98  if ($type->getIcon() != '' && $this->webdir->has($type->getIconPath(true))) {
99  // TODO: that´s horrible, try to avoid ilUtil in future
100  $item->setImage(ilUtil::getWebspaceDir() . '/' . $type->getIconPath(true));
101  }
102  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
static getWebspaceDir($mode="filesystem")
get webspace directory
getIconPath(bool $append_filename=false)
Return the path to the icon.
+ Here is the call graph for this function:

◆ initForm()

ilStudyProgrammeTypeCustomIconsFormGUI::initForm ( )

Definition at line 81 of file class.ilStudyProgrammeTypeCustomIconsFormGUI.php.

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilFormGUI\setFormAction(), ilFileInputGUI\setSuffixes(), and ilPropertyFormGUI\setTitle().

Referenced by __construct().

82  {
83  $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
84  $this->setTitle($this->lng->txt('prg_type_custom_icon'));
85  $item = new ilImageFileInputGUI($this->lng->txt('icon'), 'icon');
86  $item->setSuffixes(array( 'svg' ));
87  $item->setInfo($this->lng->txt('prg_type_custom_icon_info'));
88  $this->addItem($item);
89  $this->addCommandButton('updateCustomIcons', $this->lng->txt('save'));
90  }
setFormAction($a_formaction)
Set FormAction.
addItem($a_item)
Add Item (Property, SectionHeader).
setTitle($a_title)
Set Title.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
This class represents an image file property in a property form.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilStudyProgrammeTypeCustomIconsFormGUI::saveObject ( ilStudyProgrammeType  $type)

Save object (create or update)

Returns
bool

Definition at line 64 of file class.ilStudyProgrammeTypeCustomIconsFormGUI.php.

References Vendor\Package\$e, ilUtil\sendFailure(), and ilStudyProgrammeType\updateAssignedStudyProgrammesIcons().

65  {
66  $type = $this->fillObject($type);
67  if (!$type) {
68  return false;
69  }
70  try {
71  $this->type_repo->updateType($type);
73  return true;
74  } catch (ilException $e) {
75  ilUtil::sendFailure($e->getMessage());
76 
77  return false;
78  }
79  }
updateAssignedStudyProgrammesIcons()
Update the Icons of assigned objects.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilStudyProgrammeTypeCustomIconsFormGUI::$ctrl
protected

◆ $lng

ilStudyProgrammeTypeCustomIconsFormGUI::$lng
protected

Definition at line 25 of file class.ilStudyProgrammeTypeCustomIconsFormGUI.php.

Referenced by __construct().

◆ $parent_gui

ilStudyProgrammeTypeCustomIconsFormGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $tpl

ilStudyProgrammeTypeCustomIconsFormGUI::$tpl
protected

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

Referenced by __construct().

◆ $type_repo

ilStudyProgrammeTypeCustomIconsFormGUI::$type_repo
protected

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

Referenced by __construct().


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