Code Duplication    Length = 12-12 lines in 3 locations

htdocs/class/xoopsform/formcheckbox.php 1 location

@@ 152-163 (lines=12) @@
149
     * @param  bool|int $encode To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name
150
     * @return array    Associative array of value->name pairs
151
     */
152
    public function getOptions($encode = false)
153
    {
154
        if (!$encode) {
155
            return $this->_options;
156
        }
157
        $value = array();
158
        foreach ($this->_options as $val => $name) {
159
            $value[$encode ? htmlspecialchars($val, ENT_QUOTES) : $val] = ($encode > 1) ? htmlspecialchars($name, ENT_QUOTES) : $name;
160
        }
161
162
        return $value;
163
    }
164
165
    /**
166
     * Get the delimiter of this group

htdocs/class/xoopsform/formradio.php 1 location

@@ 132-143 (lines=12) @@
129
     *
130
     * @return array Associative array of value->name pairs
131
     */
132
    public function getOptions($encode = false)
133
    {
134
        if (!$encode) {
135
            return $this->_options;
136
        }
137
        $value = array();
138
        foreach ($this->_options as $val => $name) {
139
            $value[$encode ? htmlspecialchars($val, ENT_QUOTES) : $val] = ($encode > 1) ? htmlspecialchars($name, ENT_QUOTES) : $name;
140
        }
141
142
        return $value;
143
    }
144
145
    /**
146
     * Get the delimiter of this group

htdocs/class/xoopsform/formselect.php 1 location

@@ 182-193 (lines=12) @@
179
     *
180
     * @return array Associative array of value->name pairs
181
     */
182
    public function getOptions($encode = false)
183
    {
184
        if (!$encode) {
185
            return $this->_options;
186
        }
187
        $value = array();
188
        foreach ($this->_options as $val => $name) {
189
            $value[$encode ? htmlspecialchars($val, ENT_QUOTES) : $val] = ($encode > 1) ? htmlspecialchars($name, ENT_QUOTES) : $name;
190
        }
191
192
        return $value;
193
    }
194
195
    /**
196
     * Prepare HTML for output