ILIAS  release_4-4 Revision
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...
 

Protected Attributes

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

Additional Inherited Members

- 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 $lng, ilMDSettings\_getInstance(), 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");
38  $this->settings = ilMDSettings::_getInstance();
39  }
setType($a_type)
Set Type.
static _getInstance()
get instance
global $lng
Definition: privfeed.php:40
+ 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, $lng, ilFormPropertyGUI\getPostVar(), and ilUtil\stripSlashes().

117  {
118  global $lng;
119 
120  if($this->usePurifier() && $this->getPurifier())
121  {
122  $_POST[$this->getPostVar()]["ta"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["ta"]);
123  }
124 
125  // todo: implement setRequired, if needed
126 
127  return true;
128  }
$_POST['username']
Definition: cron.php:12
getPostVar()
Get Post Variable.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $lng
Definition: privfeed.php:40
+ 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 133 of file class.ilCopyrightInputGUI.php.

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

134  {
135  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
136 
137  $ttpl = new ilTemplate("tpl.prop_copyright.html", true, true, "Services/MetaData");
139  $use_selection = ($this->settings->isCopyrightSelectionActive() && count($entries));
140  $val = $this->getValue();
141 
142  if ($use_selection)
143  {
144  $default_id = ilMDCopyrightSelectionEntry::_extractEntryId($val["ta"]);
145 
146  include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
147  $found = false;
148  foreach($entries as $entry)
149  {
150  $ttpl->setCurrentBlock('copyright_selection');
151 
152  if($entry->getEntryId() == $default_id)
153  {
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  {
167  $ttpl->setVariable('COPYRIGHT_CHECKED','checked="checked"');
168  }
169  $ttpl->setVariable('COPYRIGHT_ID',0);
170  $ttpl->setVariable('COPYRIGHT_TITLE',$this->lng->txt('meta_cp_own'));
171  $ttpl->setVariable('SPOST_VAR', $this->getPostVar());
172 
173  $ttpl->parseCurrentBlock();
174  }
175 
176 
177  if ($this->getCols() > 5)
178  {
179  $ttpl->setCurrentBlock("prop_ta_c");
180  $ttpl->setVariable("COLS", $this->getCols());
181  $ttpl->parseCurrentBlock();
182  }
183  else
184  {
185  $ttpl->touchBlock("prop_ta_w");
186  }
187 
188  $ttpl->setCurrentBlock("prop_copyright");
189  $ttpl->setVariable("ROWS", $this->getRows());
190  if (!$this->getDisabled())
191  {
192  $ttpl->setVariable("POST_VAR",
193  $this->getPostVar());
194  }
195  $ttpl->setVariable("ID", $this->getFieldId());
196  if ($this->getDisabled())
197  {
198  $ttpl->setVariable('DISABLED','disabled="disabled" ');
199  }
200 
201  if ($this->getDisabled())
202  {
203  $ttpl->setVariable("HIDDEN_INPUT",
204  $this->getHiddenTag($this->getPostVar(), $this->getValue()));
205  }
206 
207  if (!$use_selection || !$found)
208  {
209  $ttpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($val["ta"]));
210  }
211  $ttpl->parseCurrentBlock();
212 
213 
214  $a_tpl->setCurrentBlock("prop_generic");
215  $a_tpl->setVariable("PROP_GENERIC", $ttpl->get());
216  $a_tpl->parseCurrentBlock();
217  }
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
+ 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.

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

◆ 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: