aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/forms/SerialWysiwygInput.php
blob: 9ce099c659efa97a84f0ba46a5ca1efbb9df3bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

namespace Studip\Forms;

use MassMail\MassMailMarker;

class SerialWysiwygInput extends WysiwygInput
{

    public function render()
    {
        if (!isset($this->attributes['id'])) {
            $id = md5(uniqid());
            $this->attributes['id'] = $id;
        } else {
            $id = $this->attributes['id'];
        }

        $template = $GLOBALS['template_factory']->open('forms/serial_wysiwyg_input');
        $template->title = $this->title;
        $template->name = $this->name;
        $template->value = $this->value;
        $template->id = $id;
        $template->required = $this->required;
        $template->markers = $this->attributes['markers'];
        $template->attributes = $this->attributes;
        return $template->render();
    }

    public function getRequestValue()
    {
        return \Studip\Markup::markAsHtml(
            \Studip\Markup::purifyHtml(\Request::get($this->name))
        );
    }
}