Code Duplication    Length = 18-18 lines in 2 locations

class/class_lists.php 1 location

@@ 115-132 (lines=18) @@
112
     *
113
     * @return string
114
     */
115
    public function &showSelection()
116
    {
117
        $ret = "<select size='" . $this->size() . "' name='$this->value()'>";
118
        if ($this->emptySelect) {
119
            $ret .= "<option value='" . $this->value() . "'>----------------------</option>";
120
        }
121
        foreach ($this->filelist as $content) {
122
            $optSelected = '';
123
124
            if ($content[0] == $this->isSelected()) {
125
                $optSelected = "selected='selected'";
126
            }
127
            $ret .= "<option value='" . $content . "' $optSelected>" . $content . '</option>';
128
        }
129
        $ret .= '</select>';
130
131
        return $ret;
132
    }
133
134
    /**
135
     * SpotList::getListTypeAsArray()

class/xoopstube_lists.php 1 location

@@ 64-81 (lines=18) @@
61
     *
62
     * @return string
63
     */
64
    public function &getarray($this_array)
65
    {
66
        $ret = "<select size='" . $this->size() . "' name='$this->value()'>";
67
        if ($this->emptyselect) {
68
            $ret .= "<option value='" . $this->value() . "'>----------------------</option>";
69
        }
70
        foreach ($this_array as $content) {
71
            $opt_selected = '';
72
73
            if ($content[0] == $this->isSelected()) {
74
                $opt_selected = "selected='selected'";
75
            }
76
            $ret .= "<option value='" . $content . "' $opt_selected>" . $content . '</option>';
77
        }
78
        $ret .= '</select>';
79
80
        return $ret;
81
    }
82
83
    /**
84
     * Private to be called by other parts of the class