aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/DataFieldTextmarkupEntry.class.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+github@gmail.com>2021-07-22 16:07:19 +0200
committerJan-Hendrik Willms <tleilax+github@gmail.com>2021-07-22 16:19:12 +0200
commita3da1483a9e689846179159355badfec8073dbec (patch)
tree770dcca6bdf5f6f2a11b0e7fcbbeda6919a3fc52 /lib/classes/DataFieldTextmarkupEntry.class.php
current code from svn, revision 62608
Diffstat (limited to 'lib/classes/DataFieldTextmarkupEntry.class.php')
-rw-r--r--lib/classes/DataFieldTextmarkupEntry.class.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/classes/DataFieldTextmarkupEntry.class.php b/lib/classes/DataFieldTextmarkupEntry.class.php
new file mode 100644
index 0000000..50115b9
--- /dev/null
+++ b/lib/classes/DataFieldTextmarkupEntry.class.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @author Elmar Ludwig <elmar.ludwig@uos.de>
+ * @license GPL2 or any later version
+ */
+class DataFieldTextmarkupEntry extends DataFieldTextareaEntry
+{
+ protected $template = 'textmarkup.php';
+
+ /**
+ * Sets the value from a post request
+ *
+ * @param mixed $submitted_value The value from request
+ */
+ public function setValueFromSubmit($submitted_value)
+ {
+ $this->setValue(Studip\Markup::purifyHtml($submitted_value));
+ }
+
+ /**
+ * Returns the display/rendered value of this datafield
+ *
+ * @param bool $entities Should html entities be encoded (defaults to true)
+ * @return String containg the rendered value
+ */
+ public function getDisplayValue($entities = true)
+ {
+ if ($entities) {
+ return formatReady($this->getValue());
+ }
+
+ return $this->getValue();
+ }
+}