# contact-forms/1.9.2/PFBC/OptionElement.php

Contact Forms by Cimatti, version 1.9.2. 24 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/1.9.2/code/PFBC/OptionElement.php
- Raw: https://pluginprobe.com/plugins/contact-forms/1.9.2/raw/PFBC/OptionElement.php
- Modified: 2023-03-14T12:04:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/contact-forms/1.9.2/code/PFBC/OptionElement.php#L10-L20`.

```php
<?php
abstract class OptionElement extends Element {
	protected $options;

	public function __construct($label, $name, array $options, array $properties = null) {
		$this->options = $options;
		if(!empty($this->options) && array_values($this->options) === $this->options)
			$this->options = array_combine($this->options, $this->options);
		
		parent::__construct($label, $name, $properties);
	}

	protected function getOptionValue($value) {
        $position = strpos($value, ":pfbc");
        if($position !== false) {
            if($position == 0)
                $value = "";
            else
                $value = substr($value, 0, $position);
        }
        return $value;
    }
}

```
