aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/DataFieldTextmarkupEntry.php
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /lib/classes/DataFieldTextmarkupEntry.php
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/classes/DataFieldTextmarkupEntry.php')
-rw-r--r--lib/classes/DataFieldTextmarkupEntry.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/classes/DataFieldTextmarkupEntry.php b/lib/classes/DataFieldTextmarkupEntry.php
new file mode 100644
index 0000000..50115b9
--- /dev/null
+++ b/lib/classes/DataFieldTextmarkupEntry.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();
+ }
+}