ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCopyrightInputGUI Class Reference

This class represents a copyright property in a property form. More...

+ Inheritance diagram for ilCopyrightInputGUI:
+ Collaboration diagram for ilCopyrightInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setCols ($a_cols)
 Set Cols. More...
 
 getCols ()
 Get Cols. More...
 
 setRows ($a_rows)
 Set Rows. More...
 
 getRows ()
 Get Rows. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($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...
 

Protected Attributes

 $value
 
 $cols
 
 $rows
 
 $settings
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

This class represents a copyright property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 16 of file class.ilCopyrightInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCopyrightInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

30 {
31 global $DIC;
32
33 $lng = $DIC['lng'];
34
35 $this->lng = $lng;
36 $this->lng->loadLanguageModule("meta");
37
38 parent::__construct($a_title, $a_postvar);
39 $this->setType("copyright");
41 }
setType($a_type)
Set Type.
static _getInstance()
get instance
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2

References $DIC, ilFormPropertyGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilMDSettings\_getInstance(), settings(), and ilFormPropertyGUI\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilCopyrightInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 118 of file class.ilCopyrightInputGUI.php.

119 {
120 global $DIC;
121
122 $lng = $DIC['lng'];
123
124 if ($this->usePurifier() && $this->getPurifier()) {
125 $_POST[$this->getPostVar()]["ta"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["ta"]);
126 }
127
128 // todo: implement setRequired, if needed
129
130 return true;
131 }
$_POST["username"]
getPostVar()
Get Post Variable.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $DIC, ilFormPropertyGUI\$lng, ilFormPropertyGUI\getPostVar(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getCols()

ilCopyrightInputGUI::getCols ( )

Get Cols.

Returns
int Cols

Definition at line 78 of file class.ilCopyrightInputGUI.php.

References $cols.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getRows()

ilCopyrightInputGUI::getRows ( )

Get Rows.

Returns
int Rows

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

References $rows.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getValue()

ilCopyrightInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilCopyrightInputGUI::insert ( $a_tpl)

Insert property html.

Definition at line 136 of file class.ilCopyrightInputGUI.php.

137 {
138 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
139
140 $ttpl = new ilTemplate("tpl.prop_copyright.html", true, true, "Services/MetaData");
142 $use_selection = ($this->settings->isCopyrightSelectionActive() && count($entries));
143 $val = $this->getValue();
144
145 if ($use_selection) {
146 $default_id = ilMDCopyrightSelectionEntry::_extractEntryId($val["ta"]);
147
148 include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
149 $found = false;
150 foreach ($entries as $entry) {
151 $ttpl->setCurrentBlock('copyright_selection');
152
153 if ($entry->getEntryId() == $default_id) {
154 $found = true;
155 $ttpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"');
156 }
157 $ttpl->setVariable('COPYRIGHT_ID', $entry->getEntryId());
158 $ttpl->setVariable('COPYRIGHT_TITLE', $entry->getTitle());
159 $ttpl->setVariable('COPYRIGHT_DESCRIPTION', $entry->getDescription());
160 $ttpl->setVariable('SPOST_VAR', $this->getPostVar());
161 $ttpl->parseCurrentBlock();
162 }
163
164 $ttpl->setCurrentBlock('copyright_selection');
165 if (!$found) {
166 $ttpl->setVariable('COPYRIGHT_CHECKED', 'checked="checked"');
167 }
168 $ttpl->setVariable('COPYRIGHT_ID', 0);
169 $ttpl->setVariable('COPYRIGHT_TITLE', $this->lng->txt('meta_cp_own'));
170 $ttpl->setVariable('SPOST_VAR', $this->getPostVar());
171
172 $ttpl->parseCurrentBlock();
173 }
174
175
176 if ($this->getCols() > 5) {
177 $ttpl->setCurrentBlock("prop_ta_c");
178 $ttpl->setVariable("COLS", $this->getCols());
179 $ttpl->parseCurrentBlock();
180 } else {
181 $ttpl->touchBlock("prop_ta_w");
182 }
183
184 $ttpl->setCurrentBlock("prop_copyright");
185 $ttpl->setVariable("ROWS", $this->getRows());
186 if (!$this->getDisabled()) {
187 $ttpl->setVariable(
188 "POST_VAR",
189 $this->getPostVar()
190 );
191 }
192 $ttpl->setVariable("ID", $this->getFieldId());
193 if ($this->getDisabled()) {
194 $ttpl->setVariable('DISABLED', 'disabled="disabled" ');
195 }
196
197 if ($this->getDisabled()) {
198 $ttpl->setVariable(
199 "HIDDEN_INPUT",
200 $this->getHiddenTag($this->getPostVar(), $this->getValue())
201 );
202 }
203
204 if (!$use_selection || !$found) {
205 $ttpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($val["ta"]));
206 }
207 $ttpl->parseCurrentBlock();
208
209
210 $a_tpl->setCurrentBlock("prop_generic");
211 $a_tpl->setVariable("PROP_GENERIC", $ttpl->get());
212 $a_tpl->parseCurrentBlock();
213 }
getHiddenTag($a_post_var, $a_value)
Get hidden tag (used for disabled properties)
getFieldId()
Get Post Variable.
static _extractEntryId($a_cp_string)
extract entry id
special template class to simplify handling of ITX/PEAR
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References ilMDCopyrightSelectionEntry\_extractEntryId(), ilMDCopyrightSelectionEntry\_getEntries(), getCols(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getHiddenTag(), ilFormPropertyGUI\getPostVar(), getRows(), getValue(), ilUtil\prepareFormOutput(), and settings().

+ Here is the call graph for this function:

◆ setCols()

ilCopyrightInputGUI::setCols (   $a_cols)

Set Cols.

Parameters
int$a_colsCols

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

69 {
70 $this->cols = $a_cols;
71 }

◆ setRows()

ilCopyrightInputGUI::setRows (   $a_rows)

Set Rows.

Parameters
int$a_rowsRows

Definition at line 88 of file class.ilCopyrightInputGUI.php.

89 {
90 $this->rows = $a_rows;
91 }

◆ setValue()

ilCopyrightInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 48 of file class.ilCopyrightInputGUI.php.

49 {
50 $this->value = $a_value;
51 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilCopyrightInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 108 of file class.ilCopyrightInputGUI.php.

109 {
110 $this->setValue($a_values[$this->getPostVar()]);
111 }
setValue($a_value)
Set Value.

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

+ Here is the call graph for this function:

Field Documentation

◆ $cols

ilCopyrightInputGUI::$cols
protected

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

Referenced by getCols().

◆ $rows

ilCopyrightInputGUI::$rows
protected

Definition at line 20 of file class.ilCopyrightInputGUI.php.

Referenced by getRows().

◆ $settings

ilCopyrightInputGUI::$settings
protected

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

◆ $value

ilCopyrightInputGUI::$value
protected

Definition at line 18 of file class.ilCopyrightInputGUI.php.

Referenced by getValue().


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