Example #1
0
    function render($client = null)
    {
        global $cfg;
        ?>
<div style="margin-bottom:0.5em;margin-top:0.5em"><strong><?php 
        echo Format::htmlchars($this->field->get('label'));
        ?>
</strong>:</div>
        <textarea style="width:100%;" name="<?php 
        echo $this->field->get('name');
        ?>
"
            placeholder="<?php 
        echo Format::htmlchars($this->field->get('hint'));
        ?>
"
            <?php 
        if (!$client) {
            ?>
                data-draft-namespace="ticket.staff"
            <?php 
        } else {
            ?>
                data-draft-namespace="ticket.client"
                data-draft-object-id="<?php 
            echo substr(session_id(), -12);
            ?>
"
            <?php 
        }
        ?>
            class="richtext draft draft-delete ifhtml"
            cols="21" rows="8" style="width:80%;"><?php 
        echo Format::htmlchars($this->value);
        ?>
</textarea>
    <?php 
        $config = $this->field->getConfiguration();
        if (!$config['attachments']) {
            return;
        }
        $attachments = $this->getAttachments($config);
        print $attachments->render($client);
        foreach ($attachments->getMedia() as $type => $urls) {
            foreach ($urls as $url) {
                Form::emitMedia($url, $type);
            }
        }
    }