Code Duplication    Length = 22-22 lines in 2 locations

manager/includes/functions/processors.php 2 locations

@@ 156-177 (lines=22) @@
153
    }
154
}
155
156
if(!function_exists('duplicateTVs')) {
157
    /**
158
     * Duplicate Document TVs
159
     *
160
     * @param int $oldid
161
     * @param int $newid
162
     */
163
    function duplicateTVs($oldid, $newid)
164
    {
165
        $modx = evolutionCMS();
166
167
        $tbltvc = $modx->getDatabase()->getFullTableName('site_tmplvar_contentvalues');
168
169
        $newid = (int)$newid;
170
        $oldid = (int)$oldid;
171
172
        $modx->getDatabase()->insert(
173
            array('contentid' => '', 'tmplvarid' => '', 'value' => ''), $tbltvc, // Insert into
174
            "{$newid}, tmplvarid, value", $tbltvc, "contentid='{$oldid}'" // Copy from
175
        );
176
    }
177
}
178
179
if(!function_exists('duplicateAccess')) {
180
    /**
@@ 179-200 (lines=22) @@
176
    }
177
}
178
179
if(!function_exists('duplicateAccess')) {
180
    /**
181
     * Duplicate Document Access Permissions
182
     *
183
     * @param int $oldid
184
     * @param int $newid
185
     */
186
    function duplicateAccess($oldid, $newid)
187
    {
188
        $modx = evolutionCMS();
189
190
        $tbldg = $modx->getDatabase()->getFullTableName('document_groups');
191
192
        $newid = (int)$newid;
193
        $oldid = (int)$oldid;
194
195
        $modx->getDatabase()->insert(
196
            array('document' => '', 'document_group' => ''), $tbldg, // Insert into
197
            "{$newid}, document_group", $tbldg, "document='{$oldid}'" // Copy from
198
        );
199
    }
200
}
201
202
if(!function_exists('evalModule')) {
203
    /**