HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/application/extensions/GeneralOptionWidget/GeneralOptionWidget.php
<?php

class GeneralOptionWidget extends CWidget
{
    /** @var GeneralOption */
    public $generalOption;

    const SINGLEINPUTTYPE = array(
        'questiongroup',
        'questiontheme',
        'text',
        'textarea'
    );

    /**
     * @todo Classes instead of switch.
     */
    public function run()
    {
        // If the formElement has extra attributes defined, make sure they don't override the basic attributes
        if (!empty($this->generalOption->formElement->options['attributes'])) {
            unset($this->generalOption->formElement->options['attributes']['id']);
            unset($this->generalOption->formElement->options['attributes']['name']);
            unset($this->generalOption->formElement->options['attributes']['value']);
            unset($this->generalOption->formElement->options['attributes']['class']);
        } else {
            $this->generalOption->formElement->options['attributes'] = [];
        }

        $content = $this->render($this->generalOption->inputType, null, true);
        $this->render('layout', ['content' => $content]);
    }
}