|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
<?php // $Id: edit_document.php 17768 2009-01-16 04:05:43Z ivantcholakov $
|
|
|
|
|
<?php // $Id: edit_document.php 18028 2009-01-27 15:13:17Z ivantcholakov $
|
|
|
|
|
/* |
|
|
|
|
============================================================================== |
|
|
|
|
Dokeos - elearning and course management software |
|
|
|
@ -100,6 +100,12 @@ $fck_attribute['Config']['FullPage'] = true; |
|
|
|
|
Constants & Variables |
|
|
|
|
------------------------------------------------------------------------------ |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
if (api_is_in_group()) |
|
|
|
|
{ |
|
|
|
|
$group_properties = GroupManager::get_group_properties($_SESSION['_gid']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$file = $_GET['file']; |
|
|
|
|
//echo('file: '.$file.'<br>'); |
|
|
|
|
$doc=basename($file); |
|
|
|
@ -117,6 +123,11 @@ $group_document = false; |
|
|
|
|
|
|
|
|
|
$doc_tree= explode('/', $file); |
|
|
|
|
$count_dir = count($doc_tree) -2; // "2" because at the begin and end there are 2 "/" |
|
|
|
|
// Level correction for group documents. |
|
|
|
|
if (!empty($group_properties['directory'])) |
|
|
|
|
{ |
|
|
|
|
$count_dir = $count_dir > 0 ? $count_dir - 1 : 0; |
|
|
|
|
} |
|
|
|
|
$relative_url=''; |
|
|
|
|
for($i=0;$i<($count_dir);$i++) |
|
|
|
|
{ |
|
|
|
@ -124,7 +135,14 @@ for($i=0;$i<($count_dir);$i++) |
|
|
|
|
} |
|
|
|
|
$fck_attribute['Config']['InDocument'] = true; |
|
|
|
|
$fck_attribute['Config']['CreateDocumentDir'] = $relative_url; |
|
|
|
|
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/'; |
|
|
|
|
if (empty($group_properties['directory'])) |
|
|
|
|
{ |
|
|
|
|
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document/'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document'.$group_properties['directory'].'/'; |
|
|
|
|
} |
|
|
|
|
$fck_attribute['Config']['BaseHref'] = api_get_path('WEB_COURSE_PATH').$_course['path'].'/document'.$dir; |
|
|
|
|
|
|
|
|
|
$use_document_title = (get_setting('use_document_title')=='true')?true:false; |
|
|
|
|