ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
 __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...
 
 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...
 

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)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Protected Attributes

 $object
 
 $is_new = true
 
- 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
 
- 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 $DIC, ilPropertyFormGUI\$lng, $object, and initForm().

30  {
31  global $DIC;
32  $lng = $DIC['lng'];
33  $this->object = $object;
34  $this->lng = $lng;
35  $this->is_new = ($this->object->getId() == 0);
36  $this->initForm();
37  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilMemcacheServerFormGUI::fillForm ( )

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

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

64  {
65  $array = array(
66  self::F_STATUS => $this->object->getStatus() == ilMemcacheServer::STATUS_ACTIVE,
67  self::F_HOST => $this->object->getHost(),
68  self::F_PORT => $this->object->getPort(),
69  self::F_WEIGHT => $this->object->getWeight(),
70  );
71 
72  $this->setValuesByArray($array);
73  }
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
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 79 of file class.ilMemcacheServerFormGUI.php.

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

Referenced by saveObject().

80  {
81  if (!$this->checkInput()) {
82  return false;
83  }
84  $this->object->setStatus(($this->getInput(self::F_STATUS) == 1 ? ilMemcacheServer::STATUS_ACTIVE : ilMemcacheServer::STATUS_INACTIVE));
85  $this->object->setHost($this->getInput(self::F_HOST));
86  $this->object->setPort($this->getInput(self::F_PORT));
87  $this->object->setWeight($this->getInput(self::F_WEIGHT));
88 
89  return true;
90  }
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 123 of file class.ilMemcacheServerFormGUI.php.

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

Referenced by initForm().

124  {
125  switch (true) {
126  case $this->is_new:
127  $this->setTitle($this->txt('add'));
128  $this->addCommandButton('createMemcacheServer', $this->txt('add'));
129  $this->addCommandButton('cache', $this->txt('cancel'));
130  break;
131  case !$this->is_new:
132  $this->setTitle($this->txt('update'));
133  $this->addCommandButton('updateMemcacheServer', $this->txt('update'));
134  $this->addCommandButton('cache', $this->txt('cancel'));
135  break;
136  }
137  }
setTitle($a_title)
Set Title.
addCommandButton($a_cmd, $a_text, $a_id="")
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 40 of file class.ilMemcacheServerFormGUI.php.

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

Referenced by __construct().

41  {
42  $this->setTarget('_top');
43  $this->setFormAction('setup.php?cmd=gateway&mcsid=' . $_GET['mcsid']);
44  $this->initButtons();
45 
46  $te = new ilCheckboxInputGUI($this->txt(self::F_STATUS), self::F_STATUS);
47  $this->addItem($te);
48 
49  $te = new ilTextInputGUI($this->txt(self::F_HOST), self::F_HOST);
50  $te->setRequired(true);
51  $this->addItem($te);
52 
53  $te = new ilTextInputGUI($this->txt(self::F_PORT), self::F_PORT);
54  $te->setRequired(true);
55  $this->addItem($te);
56 
57  $se = new ilSelectInputGUI($this->txt(self::F_WEIGHT), self::F_WEIGHT);
58  $se->setOptions(array( 10 => 10, 20 => 20, 30 => 30, 40 => 40, 50 => 50, 60 => 60, 70 => 70, 80 => 80, 90 => 90, 100 => 100 ));
59  $this->addItem($se);
60  }
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.
Create styles array
The data for the language used.
+ 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 107 of file class.ilMemcacheServerFormGUI.php.

References fillObject(), and object.

108  {
109  if (!$this->fillObject()) {
110  return false;
111  }
112 
113  if ($this->object->getId()) {
114  $this->object->update();
115  } else {
116  $this->object->create();
117  }
118 
119  return $this->object->getId();
120  }
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ txt()

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

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

References $key.

Referenced by initButtons(), and initForm().

99  {
100  return $this->lng->txt('memcache_' . $key);
101  }
$key
Definition: croninfo.php:18
+ 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: