Code Duplication    Length = 13-13 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 9327-9339 (lines=13) @@
9324
                        $my_item->appendChild($my_masteryscore);
9325
9326
                        // Attach this item to the organization element or its parent if there is one.
9327
                        if (!empty($item->parent) && $item->parent != 0) {
9328
                            $children = $organization->childNodes;
9329
                            for ($i = 0; $i < $children->length; $i++) {
9330
                                $item_temp = $children->item($i);
9331
                                if ($item_temp -> nodeName == 'item') {
9332
                                    if ($item_temp->getAttribute('identifier') == 'ITEM_'.$item->parent) {
9333
                                        $item_temp -> appendChild($my_item);
9334
                                    }
9335
                                }
9336
                            }
9337
                        } else {
9338
                            $organization->appendChild($my_item);
9339
                        }
9340
9341
                        $my_file_path = 'link_'.$item->get_id().'.html';
9342
                        $sql = 'SELECT url, title FROM '.Database :: get_course_table(TABLE_LINK).'
@@ 9391-9403 (lines=13) @@
9388
                        $my_item->appendChild($my_masteryscore);
9389
9390
                        // Attach this item to the organization element or hits parent if there is one.
9391
                        if (!empty($item->parent) && $item->parent != 0) {
9392
                            $children = $organization->childNodes;
9393
                            for ($i = 0; $i < $children->length; $i++) {
9394
                                $item_temp = $children->item($i);
9395
                                if ($item_temp -> nodeName == 'item') {
9396
                                    if ($item_temp->getAttribute('identifier') == 'ITEM_'.$item->parent) {
9397
                                        $item_temp -> appendChild($my_item);
9398
                                    }
9399
                                }
9400
                            }
9401
                        } else {
9402
                            $organization->appendChild($my_item);
9403
                        }
9404
9405
                        // Get the path of the file(s) from the course directory root
9406
                        //$my_file_path = $item->get_file_path('scorm/'.$this->path.'/');