Code Duplication    Length = 34-34 lines in 2 locations

lib/midcom/helper/datamanager2/widget/downloads.php 1 location

@@ 174-207 (lines=34) @@
171
     *
172
     * @param boolean $frozen Set this to true, if you want to skip all elements which cannot be frozen.
173
     */
174
    private function _add_table_header($frozen)
175
    {
176
        if ($frozen)
177
        {
178
            $html = "<table class=\"midcom_helper_datamanager2_widget_downloads\" id=\"{$this->_namespace}{$this->name}\" >\n
179
                         <thead>\n
180
                             <tr>\n
181
                                 <th class=\"filename\">" . $this->_l10n_midcom->get('name') . "</th>\n
182
                                 <th class=\"title\">" . $this->_l10n_midcom->get('title') . "</th>\n
183
                             </tr>\n
184
                         </thead>\n
185
                         <tbody>\n";
186
        }
187
        else
188
        {
189
            $index = '';
190
            if ($this->_type->sortable)
191
            {
192
                $index = "            <th class=\"index\">" . $this->_l10n->get('index') . "</th>\n";
193
            }
194
195
            $html = "<table class=\"midcom_helper_datamanager2_widget_downloads\" id=\"{$this->_namespace}{$this->name}\" >\n
196
                         <thead>\n
197
                             <tr>\n" .
198
                    $index .
199
                    "            <th class=\"filename\">" . $this->_l10n_midcom->get('name') . "</th>\n
200
                                 <th class=\"title\">" . $this->_l10n_midcom->get('title') . "</th>\n
201
                                 <th class=\"upload\">" . $this->_l10n_midcom->get('upload') . "</th>\n
202
                             </tr>\n
203
                         </thead>\n
204
                         <tbody>\n";
205
        }
206
        $this->_elements['s_header'] = $this->_form->createElement('static', 's_header', '', $html);
207
    }
208
209
    /**
210
     * Adds the new upload row to the bottom of the table.

lib/midcom/helper/datamanager2/widget/images.php 1 location

@@ 157-190 (lines=34) @@
154
     *
155
     * @param boolean $frozen Set this to true, if you want to skip all elements which cannot be frozen.
156
     */
157
    private function _add_table_header($frozen)
158
    {
159
        if ($frozen)
160
        {
161
            $html = "<table class=\"midcom_helper_datamanager2_widget_images\" id=\"{$this->_namespace}{$this->name}\" >\n
162
                        <thead>\n
163
                            <tr>\n
164
                                <th class=\"filename\">" . $this->_l10n_midcom->get('name') . "</th>\n
165
                                <th class=\"title\">" . $this->_l10n_midcom->get('title') . "</th>\n
166
                            </tr>\n
167
                        </thead>\n
168
                        <tbody>\n";
169
        }
170
        else
171
        {
172
            $index = '';
173
            if ($this->_type->sortable)
174
            {
175
                $index = "            <th class=\"index\">" . $this->_l10n->get('index') . "</th>\n";
176
            }
177
178
            $html = "<table class=\"midcom_helper_datamanager2_widget_downloads\" id=\"{$this->_namespace}{$this->name}\" >\n
179
                        <thead>\n
180
                            <tr>\n" .
181
                    $index .
182
                    "            <th class=\"filename\">" . $this->_l10n_midcom->get('name') . "</th>\n
183
                                 <th class=\"title\">" . $this->_l10n_midcom->get('title') . "</th>\n
184
                                 <th class=\"upload\">" . $this->_l10n_midcom->get('upload') . "</th>\n
185
                             </tr>\n
186
                         </thead>\n
187
                        <tbody>\n";
188
        }
189
        $this->_elements['s_header'] = $this->_form->createElement('static', 's_header', '', $html);
190
    }
191
192
    /**
193
     * Adds the new upload row to the bottom of the table.