ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilMemcacheServerFormGUI Class Reference

Class ilMemcacheServerFormGUI. More...

+ Inheritance diagram for ilMemcacheServerFormGUI:
+ Collaboration diagram for ilMemcacheServerFormGUI:

Public Member Functions

 __construct (ilMemcacheServer $object)
 
 fillForm ()
 
 fillObject ()
 
 saveObject ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 ilPropertyFormGUI ()
 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...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var)
 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)
 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
 ilFormGUI ()
 Constructor. More...
 
 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...
 

Data Fields

const F_HOST = 'host'
 
const F_PORT = 'port'
 
const F_STATUS = 'status'
 
const F_WEIGHT = 'weight'
 

Protected Member Functions

 initForm ()
 
 txt ($key)
 
 initButtons ()
 
- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 keepFileUpload ($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index=null, $a_sub_index=null)
 Import upload into temp directory. More...
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Protected Attributes

 $object
 
 $is_new = true
 
- 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

Constructor & Destructor Documentation

◆ __construct()

ilMemcacheServerFormGUI::__construct ( ilMemcacheServer  $object)
Parameters
ilMemcacheServer$object

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

References $lng, $object, and initForm().

29  {
30  global $lng;
31  $this->object = $object;
32  $this->lng = $lng;
33  $this->is_new = ($this->object->getId() == 0);
34  $this->initForm();
35  }
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilMemcacheServerFormGUI::fillForm ( )

Definition at line 60 of file class.ilMemcacheServerFormGUI.php.

References ilPropertyFormGUI\setValuesByArray(), and ilMemcacheServer\STATUS_ACTIVE.

60  {
61  $array = array(
62  self::F_STATUS => $this->object->getStatus() == ilMemcacheServer::STATUS_ACTIVE,
63  self::F_HOST => $this->object->getHost(),
64  self::F_PORT => $this->object->getPort(),
65  self::F_WEIGHT => $this->object->getWeight(),
66  );
67 
68  $this->setValuesByArray($array);
69  }
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
+ Here is the call graph for this function:

◆ fillObject()

ilMemcacheServerFormGUI::fillObject ( )
Returns
bool

Definition at line 75 of file class.ilMemcacheServerFormGUI.php.

References ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ilMemcacheServer\STATUS_ACTIVE, and ilMemcacheServer\STATUS_INACTIVE.

Referenced by saveObject().

75  {
76  if (! $this->checkInput()) {
77  return false;
78  }
79  $this->object->setStatus(($this->getInput(self::F_STATUS) == 1 ? ilMemcacheServer::STATUS_ACTIVE : ilMemcacheServer::STATUS_INACTIVE));
80  $this->object->setHost($this->getInput(self::F_HOST));
81  $this->object->setPort($this->getInput(self::F_PORT));
82  $this->object->setWeight($this->getInput(self::F_WEIGHT));
83 
84  return true;
85  }
checkInput()
Check Post Input.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initButtons()

ilMemcacheServerFormGUI::initButtons ( )
protected

Definition at line 116 of file class.ilMemcacheServerFormGUI.php.

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

Referenced by initForm().

116  {
117  switch (true) {
118  case $this->is_new:
119  $this->setTitle($this->txt('add'));
120  $this->addCommandButton('createMemcacheServer', $this->txt('add'));
121  $this->addCommandButton('cache', $this->txt('cancel'));
122  break;
123  case ! $this->is_new:
124  $this->setTitle($this->txt('update'));
125  $this->addCommandButton('updateMemcacheServer', $this->txt('update'));
126  $this->addCommandButton('cache', $this->txt('cancel'));
127  break;
128  }
129  }
setTitle($a_title)
Set Title.
addCommandButton($a_cmd, $a_text)
Add Command button.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilMemcacheServerFormGUI::initForm ( )
protected

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

References $_GET, ilPropertyFormGUI\addItem(), initButtons(), ilFormGUI\setFormAction(), ilFormGUI\setTarget(), and txt().

Referenced by __construct().

38  {
39  $this->setTarget('_top');
40  $this->setFormAction('setup.php?cmd=gateway&mcsid=' . $_GET['mcsid']);
41  $this->initButtons();
42 
43  $te = new ilCheckboxInputGUI($this->txt(self::F_STATUS), self::F_STATUS);
44  $this->addItem($te);
45 
46  $te = new ilTextInputGUI($this->txt(self::F_HOST), self::F_HOST);
47  $te->setRequired(true);
48  $this->addItem($te);
49 
50  $te = new ilTextInputGUI($this->txt(self::F_PORT), self::F_PORT);
51  $te->setRequired(true);
52  $this->addItem($te);
53 
54  $se = new ilSelectInputGUI($this->txt(self::F_WEIGHT), self::F_WEIGHT);
55  $se->setOptions(array( 10 => 10, 20 => 20, 30 => 30, 40 => 40, 50 => 50, 60 => 60, 70 => 70, 80 => 80, 90 => 90, 100 => 100 ));
56  $this->addItem($se);
57  }
This class represents a selection list property in a property form.
$_GET["client_id"]
This class represents a checkbox property in a property form.
setFormAction($a_formaction)
Set FormAction.
addItem($a_item)
Add Item (Property, SectionHeader).
setTarget($a_target)
Set Target.
This class represents a text property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilMemcacheServerFormGUI::saveObject ( )
Returns
bool|string

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

References fillObject().

101  {
102  if (! $this->fillObject()) {
103  return false;
104  }
105 
106  if ($this->object->getId()) {
107  $this->object->update();
108  } else {
109  $this->object->create();
110  }
111 
112  return $this->object->getId();
113  }
+ Here is the call graph for this function:

◆ txt()

ilMemcacheServerFormGUI::txt (   $key)
protected
Parameters
$key
Returns
string

Definition at line 93 of file class.ilMemcacheServerFormGUI.php.

Referenced by initButtons(), and initForm().

93  {
94  return $this->lng->txt('memcache_' . $key);
95  }
+ Here is the caller graph for this function:

Field Documentation

◆ $is_new

ilMemcacheServerFormGUI::$is_new = true
protected

Definition at line 23 of file class.ilMemcacheServerFormGUI.php.

◆ $object

ilMemcacheServerFormGUI::$object
protected

Definition at line 19 of file class.ilMemcacheServerFormGUI.php.

Referenced by __construct().

◆ F_HOST

const ilMemcacheServerFormGUI::F_HOST = 'host'

Definition at line 12 of file class.ilMemcacheServerFormGUI.php.

◆ F_PORT

const ilMemcacheServerFormGUI::F_PORT = 'port'

Definition at line 13 of file class.ilMemcacheServerFormGUI.php.

◆ F_STATUS

const ilMemcacheServerFormGUI::F_STATUS = 'status'

Definition at line 14 of file class.ilMemcacheServerFormGUI.php.

◆ F_WEIGHT

const ilMemcacheServerFormGUI::F_WEIGHT = 'weight'

Definition at line 15 of file class.ilMemcacheServerFormGUI.php.


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