} else {
     if (!isset($currentContent)) {
         $currentContent = new EfrontContentTree($currentLesson);
     }
     foreach ($treeStructure as $key => $value) {
         end($value);
         $units[implode("/", $value)] = key($value);
     }
     $offset = str_replace($currentLesson->getDirectory(), "", $file['path']);
     $offsetDir = str_replace($currentLesson->getDirectory(), "", $file['directory']);
     $parentId = $units[dirname($offset)];
     $fields = array('name' => eFront_basename($file['name'], '.' . $pathParts['extension']), 'lessons_ID' => $currentLesson->lesson['id'], 'parent_content_ID' => $parentId ? $parentId : 0);
     $pathParts['extension'] = strtolower($pathParts['extension']);
     if ($pathParts['extension'] == 'pdf') {
         $fields['data'] = '<iframe src="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '"  name="pdfaccept" width="100%" height="600"></iframe>';
         $unit = $currentContent->insertNode($fields);
     } elseif (in_array($pathParts['extension'], array_keys(FileSystemTree::getFileTypes('image')))) {
         $fields['data'] = '<img src="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" border="0" />';
         $unit = $currentContent->insertNode($fields);
     } elseif (strpos(EfrontFile::$mimeTypes[$pathParts['extension']], "x-m4v") !== false) {
         $fields['data'] = '<object height="400" width="500" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b"><param name="src" value="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" /><embed height="400" width="400" src="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" type="video/quicktime"></embed></object>';
         $unit = $currentContent->insertNode($fields);
     } elseif (strpos(EfrontFile::$mimeTypes[$pathParts['extension']], "mp4") !== false) {
         $fields['data'] = '<object height="400" width="500" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b"><param name="src" value="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" /><embed height="400" width="400" src="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" type="video/quicktime"></embed></object>';
         $unit = $currentContent->insertNode($fields);
     } elseif (strpos(EfrontFile::$mimeTypes[$pathParts['extension']], "mpeg") !== false) {
         $fields['data'] = '<object width="500" height="400" data="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" type="video/quicktime"><param name="url" value="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" /><param name="src" value="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" /></object>';
         $unit = $currentContent->insertNode($fields);
     } elseif ($pathParts['extension'] == 'class') {
         $fields['data'] = '<table width="632" height="345" rules="rows" frame="box" cellspacing="4" cellpadding="4" border="2" style="border-style: dotted; border-width: 3px;  vertical-align: top; color: rgb(51, 51, 51); background-color: rgb(204, 255, 153);"><tbody><tr><td align="center" valign="center"><applet codebase="' . $currentLesson->getDirectoryUrl() . '/' . $offsetDir . '" code="' . $currentLesson->getDirectoryUrl() . '/' . $offset . '" width="632" height="345"/></applet><img src="images/file_types/java.gif" /></td></tr></tbody></table>';
         $unit = $currentContent->insertNode($fields);