HEX
Server: Apache/2.4.65 (Debian)
System: Linux web6 5.10.0-36-amd64 #1 SMP Debian 5.10.244-1 (2025-09-29) x86_64
User: innocamp (1028)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/gdtrain/public_html/wp-content/plugins/backup-wd/includes/buwd-form-radio.php
<?php

class Buwd_Form_Radio extends Buwd_Form_Multiple
{

    public function get_type()
    {
        return self::TYPE_RADIO;
    }

    public function overload(array $data)
    {

        parent::overload($data);
    }

    public function render()
    {
        $label_options = array();
        $options = array(
            'name'  => $this->get_name(),
            'class' => $this->get_classes(),
            'type'  => $this->get_type(),
        );

        $unique_attr = array();
        $unique_label_attr = array();
        foreach ($this->get_attr() as $attr_k => $attr_v) {
            if (is_array($attr_v)) {
                foreach ($attr_v as $a_k => $a_v) {
                    if ($attr_k != 'title') {
                        $unique_attr[$a_k][$attr_k] = $a_v;
                    } else {
                        $unique_label_attr[$a_k]['title'] = $a_v;
                    }
                }
            } else {
                $options += [$attr_k => $attr_v];
            }
        }
        $choices = $this->get_choices();

        $hidden_elements = array();
        $column = $this->get_column();
        $c = array();
        if (count($choices)) {
            foreach ($choices as $key => $choice) {
                $options['id'] = $this->get_id() . '-' . $choice['value'];
                $options['value'] = $choice['value'];
                $options['checked'] = false;
                if ($choice['value'] == $this->get_value()) {
                    $options['checked'] = 'checked';
                }

                if (!empty($unique_attr) && isset($unique_attr[$choice['value']])) {
                    $element = new Buwd_Helper_Html("input", $options + $unique_attr[$choice['value']]);

                    if (isset($unique_attr[$choice['value']]['visibility'])) {
                        $hidden_elements[] = $key;
                    }

                } else {
                    $element = new Buwd_Helper_Html("input", $options);
                }

                $label_options['for'] = $options['id'];

                if (!empty($unique_label_attr) && isset($unique_label_attr[$choice['value']])) {
                    $label = new Buwd_Helper_Html("label", $label_options + $unique_label_attr[$choice['value']], $choice['label']);
                } else {
                    $label = new Buwd_Helper_Html("label", $label_options, $choice['label']);
                }

                $html = $element->render() . ' ' . $label->render();
                $div = new Buwd_Helper_Html("div", array(), $html);

                $c[] = $div->render();
            }

            if ($column) {
                $col = array();
                $hide_class = '';
                foreach ($c as $_key => $_c) {
                    if (in_array($_key, $hidden_elements)) {
                        $hide_class = 'buwd-hide';
                    }
                    $column_div = new Buwd_Helper_Html("div", array('class' => 'buwd-column buwd-column-' . $column . ' ' . $hide_class), $_c);

                    $col[] = $column_div->render();
                }

                $columns_div = new Buwd_Helper_Html("div", array('class' => 'buwd-columns'), implode('', $col));

                return $columns_div->render();
            }

            return implode('', $c);
        }
    }
}