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

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

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

References ilFormPropertyGUI\$lng, ilMDSettings\_getInstance(), settings(), and ilFormPropertyGUI\setType().

30  {
31  global $lng;
32 
33  $this->lng = $lng;
34  $this->lng->loadLanguageModule("meta");
35 
36  parent::__construct($a_title, $a_postvar);
37  $this->setType("copyright");
39  }
setType($a_type)
Set Type.
static _getInstance()
get instance
settings()
Definition: settings.php:2
+ 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

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

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

117  {
118  global $lng;
119 
120  if ($this->usePurifier() && $this->getPurifier()) {
121  $_POST[$this->getPostVar()]["ta"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["ta"]);
122  }
123 
124  // todo: implement setRequired, if needed
125 
126  return true;
127  }
getPostVar()
Get Post Variable.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ getCols()

ilCopyrightInputGUI::getCols ( )

Get Cols.

Returns
int Cols

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

References $cols.

Referenced by insert().

77  {
78  return $this->cols;
79  }
+ Here is the caller graph for this function:

◆ getRows()

ilCopyrightInputGUI::getRows ( )

Get Rows.

Returns
int Rows

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

References $rows.

Referenced by insert().

97  {
98  return $this->rows;
99  }
+ Here is the caller graph for this function:

◆ getValue()

ilCopyrightInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by insert().

57  {
58  return $this->value;
59  }
+ Here is the caller graph for this function:

◆ insert()

ilCopyrightInputGUI::insert ( $a_tpl)

Insert property html.

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

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

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

◆ setCols()

ilCopyrightInputGUI::setCols (   $a_cols)

Set Cols.

Parameters
int$a_colsCols

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

Referenced by ilMDEditorGUI\initQuickEditForm().

67  {
68  $this->cols = $a_cols;
69  }
+ Here is the caller graph for this function:

◆ setRows()

ilCopyrightInputGUI::setRows (   $a_rows)

Set Rows.

Parameters
int$a_rowsRows

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

References rows.

87  {
88  $this->rows = $a_rows;
89  }
Remove unnecessary rows

◆ setValue()

ilCopyrightInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

Referenced by setValueByArray().

47  {
48  $this->value = $a_value;
49  }
+ 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 106 of file class.ilCopyrightInputGUI.php.

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

107  {
108  $this->setValue($a_values[$this->getPostVar()]);
109  }
getPostVar()
Get Post Variable.
setValue($a_value)
Set Value.
+ 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: