ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilScheduleDaysInputGUI Class Reference
+ Inheritance diagram for ilScheduleDaysInputGUI:
+ Collaboration diagram for ilScheduleDaysInputGUI:

Public Member Functions

 setValue (array $a_value)
 
 getValue ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getPostData ()
 
 setValueByArray (array $a_values)
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Data Fields

const DAY_KEYS = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
 

Protected Member Functions

 render ()
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Protected Attributes

array $value = []
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 

Detailed Description

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

Member Function Documentation

◆ checkInput()

ilScheduleDaysInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilFormPropertyGUI.

Definition at line 37 of file class.ilScheduleDaysInputGUI.php.

37 : bool
38 {
39 $data = $this->getPostData();
40
41 if ($data === []) {
42 $this->setAlert($this->lng->txt('msg_input_is_required'));
43 return false;
44 }
45
46 foreach ($data as $day) {
47 if (in_array($day, self::DAY_KEYS, true)) {
48 continue;
49 }
50
51 $this->setAlert($this->lng->txt('msg_input_does_not_match_regexp'));
52 return false;
53 }
54
55 return true;
56 }
$data
Definition: storeScorm.php:45

References $data, getPostData(), ILIAS\Repository\lng(), and ilFormPropertyGUI\setAlert().

+ Here is the call graph for this function:

◆ getPostData()

ilScheduleDaysInputGUI::getPostData ( )

Definition at line 58 of file class.ilScheduleDaysInputGUI.php.

58 : array
59 {
60 return $this->strArray($this->getPostVar());
61 }

References ilFormPropertyGUI\getPostVar(), and ilFormPropertyGUI\strArray().

Referenced by checkInput(), and setValueByArray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValue()

ilScheduleDaysInputGUI::getValue ( )

Definition at line 32 of file class.ilScheduleDaysInputGUI.php.

32 : array
33 {
34 return $this->value;
35 }

References $value.

Referenced by render().

+ Here is the caller graph for this function:

◆ insert()

ilScheduleDaysInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 85 of file class.ilScheduleDaysInputGUI.php.

85 : void
86 {
87 $a_tpl->setCurrentBlock('prop_generic');
88 $a_tpl->setVariable('PROP_GENERIC', $this->render());
89 $a_tpl->parseCurrentBlock();
90 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)

References ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ render()

ilScheduleDaysInputGUI::render ( )
protected

Definition at line 68 of file class.ilScheduleDaysInputGUI.php.

68 : string
69 {
70 $tpl = new ilTemplate('tpl.schedule_days_input.html', true, true, 'components/ILIAS/BookingManager');
71
72 foreach (self::DAY_KEYS as $offset => $day_value) {
73 $tpl->setCurrentBlock('day');
74 $tpl->setVariable('ID', $this->getFieldId());
75 $tpl->setVariable('POST_VAR', $this->getPostVar());
76 $tpl->setVariable('DAY', $day_value);
77 $tpl->setVariable('TXT_DAY', ilCalendarUtil::_numericDayToString(($offset + 1) % 7, false, $this->lng));
78 $tpl->setVariable('DAY_STATUS', in_array($day_value, $this->getValue(), true) ? ' checked="checked"' : '');
80 }
81
82 return $tpl->get();
83 }
static _numericDayToString(int $a_day, bool $a_long=true, ?ilLanguage $lng=null)
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
readonly ilGlobalTemplateInterface $tpl

References ILIAS\News\Common\Table\$tpl, ilCalendarUtil\_numericDayToString(), ILIAS\UICore\GlobalTemplate\get(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getPostVar(), getValue(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), and ILIAS\UICore\GlobalTemplate\setVariable().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValue()

ilScheduleDaysInputGUI::setValue ( array  $a_value)

Definition at line 27 of file class.ilScheduleDaysInputGUI.php.

27 : void
28 {
29 $this->value = $a_value;
30 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilScheduleDaysInputGUI::setValueByArray ( array  $a_values)

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

63 : void
64 {
65 $this->setValue($this->getPostData());
66 }

References getPostData(), and setValue().

+ Here is the call graph for this function:

Field Documentation

◆ $value

array ilScheduleDaysInputGUI::$value = []
protected

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

Referenced by getValue().

◆ DAY_KEYS

const ilScheduleDaysInputGUI::DAY_KEYS = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']

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


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