ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
All Data Structures Namespaces Files Functions Variables Typedefs Modules Pages
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)
 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
 $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, $lng, $object, and initForm().

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

Member Function Documentation

◆ fillForm()

ilMemcacheServerFormGUI::fillForm ( )

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

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

61  {
62  $array = array(
63  self::F_STATUS => $this->object->getStatus() == ilMemcacheServer::STATUS_ACTIVE,
64  self::F_HOST => $this->object->getHost(),
65  self::F_PORT => $this->object->getPort(),
66  self::F_WEIGHT => $this->object->getWeight(),
67  );
68 
69  $this->setValuesByArray($array);
70  }
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 76 of file class.ilMemcacheServerFormGUI.php.

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

Referenced by saveObject().

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

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

Referenced by initForm().

117  {
118  switch (true) {
119  case $this->is_new:
120  $this->setTitle($this->txt('add'));
121  $this->addCommandButton('createMemcacheServer', $this->txt('add'));
122  $this->addCommandButton('cache', $this->txt('cancel'));
123  break;
124  case !$this->is_new:
125  $this->setTitle($this->txt('update'));
126  $this->addCommandButton('updateMemcacheServer', $this->txt('update'));
127  $this->addCommandButton('cache', $this->txt('cancel'));
128  break;
129  }
130  }
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 39 of file class.ilMemcacheServerFormGUI.php.

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

Referenced by __construct().

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

References fillObject(), and object.

102  {
103  if (!$this->fillObject()) {
104  return false;
105  }
106 
107  if ($this->object->getId()) {
108  $this->object->update();
109  } else {
110  $this->object->create();
111  }
112 
113  return $this->object->getId();
114  }
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 94 of file class.ilMemcacheServerFormGUI.php.

Referenced by initButtons(), and initForm().

94  {
95  return $this->lng->txt('memcache_' . $key);
96  }
+ 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: