Code Duplication    Length = 9-12 lines in 2 locations

main/work/work.lib.php 1 location

@@ 3584-3592 (lines=9) @@
3581
 * @param $workId
3582
 * @return mixed
3583
 */
3584
function checkExistingWorkFileName($filename, $workId)
3585
{
3586
    $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
3587
    $filename = Database::escape_string($filename);
3588
    $sql = "SELECT title FROM $work_table
3589
                        WHERE parent_id = $workId AND title = '$filename' AND active = 1";
3590
    $result = Database::query($sql);
3591
    return Database::fetch_assoc($result);
3592
}
3593
3594
/**
3595
 * @param array $workInfo

main/inc/lib/course_home.lib.php 1 location

@@ 1343-1354 (lines=12) @@
1340
     * @param int $editIcon
1341
     * @return array
1342
     */
1343
    public static function getTool($editIcon)
1344
    {
1345
        $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
1346
        $editIcon = intval($editIcon);
1347
1348
        $sql = "SELECT * FROM $course_tool_table
1349
                WHERE iid = $editIcon";
1350
        $result = Database::query($sql);
1351
        $tool = Database::fetch_assoc($result, 'ASSOC');
1352
1353
        return $tool;
1354
    }
1355
1356
    /**
1357
     * @return string