[svn r21993] a better directory for global templates

skala
Juan Carlos Raña 17 years ago
parent 6acf665ec6
commit 6c3e389b6d
  1. 0
      home/default_platform_document/template_thumb/audiocomment.gif
  2. 0
      home/default_platform_document/template_thumb/checklist.gif
  3. 0
      home/default_platform_document/template_thumb/compare.gif
  4. 0
      home/default_platform_document/template_thumb/courseobjectives.gif
  5. 0
      home/default_platform_document/template_thumb/coursetitle.gif
  6. 0
      home/default_platform_document/template_thumb/cyclechart.gif
  7. 0
      home/default_platform_document/template_thumb/description.gif
  8. 0
      home/default_platform_document/template_thumb/diagram.gif
  9. 0
      home/default_platform_document/template_thumb/empty.gif
  10. 0
      home/default_platform_document/template_thumb/flash.gif
  11. 8
      home/default_platform_document/template_thumb/index.html
  12. 0
      home/default_platform_document/template_thumb/learnerwonder.gif
  13. 0
      home/default_platform_document/template_thumb/leftlist.gif
  14. 0
      home/default_platform_document/template_thumb/leftrightlist.gif
  15. 0
      home/default_platform_document/template_thumb/noimage.gif
  16. 0
      home/default_platform_document/template_thumb/phasetimeline.gif
  17. 0
      home/default_platform_document/template_thumb/rightlist.gif
  18. 0
      home/default_platform_document/template_thumb/stopthink.gif
  19. 0
      home/default_platform_document/template_thumb/table.gif
  20. 0
      home/default_platform_document/template_thumb/video.gif
  21. 0
      home/default_platform_document/template_thumb/yourinstructor.gif
  22. 16
      main/admin/settings.php
  23. 8
      main/inc/lib/fckeditor/fcktemplates.xml.php
  24. 67
      main/install/update-files-1.8.6-1.8.6.1.inc.php

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<br />
</body>
</html>

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -1,4 +1,4 @@
<?php // $Id: settings.php 21487 2009-06-18 09:52:42Z ivantcholakov $
<?php // $Id: settings.php 21993 2009-07-11 21:26:40Z herodoto $
/*
==============================================================================
Dokeos - elearning and course management software
@ -992,11 +992,11 @@ function image_filter($image)
{
if (!empty($image))
{
return '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/'.$image.'" alt="'.get_lang('TemplatePreview').'"/>';
return '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/'.$image.'" alt="'.get_lang('TemplatePreview').'"/>';
}
else
{
return '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>';
return '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>';
}
}
@ -1051,14 +1051,14 @@ function add_edit_template()
// adding an extra field: a hidden field with the id of the template we are editing
$form->addElement('hidden','template_id');
// adding an extrra field: a preview of the image that is currently used
// adding an extra field: a preview of the image that is currently used
if (!empty($row['image']))
{
$form->addElement('static','template_image_preview', '', '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/'.$row['image'].'" alt="'.get_lang('TemplatePreview').'"/>');
$form->addElement('static','template_image_preview', '', '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/'.$row['image'].'" alt="'.get_lang('TemplatePreview').'"/>');
}
else
{
$form->addElement('static','template_image_preview', '', '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>');
$form->addElement('static','template_image_preview', '', '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>');
}
// setting the information of the template that we are editing
@ -1089,7 +1089,7 @@ function add_edit_template()
$new_file_name = add_ext_on_mime(stripslashes($_FILES['template_image']['name']), $_FILES['template_image']['type']);
// upload dir
$upload_dir = api_get_path(SYS_PATH).'home/default_platform_document/';
$upload_dir = api_get_path(SYS_PATH).'home/default_platform_document/template_thumb/';
// create dir if not exists
if (!is_dir($upload_dir)) {
@ -1179,7 +1179,7 @@ function delete_template($id)
$row = Database::fetch_array($result);
if (!empty($row['image']))
{
unlink(api_get_path(SYS_PATH).'home/default_platform_document/'.$row['image']);
unlink(api_get_path(SYS_PATH).'home/default_platform_document/template_thumb/'.$row['image']);
}
// now we remove it from the database

@ -93,9 +93,9 @@ function load_platform_templates() {
$result = api_sql_query($sql, __FILE__, __LINE__);
while ($row = Database::fetch_array($result)) {
if (!empty($row['image'])) {
$image = api_get_path(WEB_PATH).'home/default_platform_document/'.$row['image'];
$image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/'.$row['image'];
} else {
$image = api_get_path(WEB_PATH).'home/default_platform_document/empty.gif';
$image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/empty.gif';
}
$row['content'] = str_replace('{CSS}',$css, $row['content']);
$row['content'] = str_replace('{IMG_DIR}',$img_dir, $row['content']);
@ -159,7 +159,7 @@ function load_personal_templates($user_id=0) {
{
$image = api_get_path(WEB_CODE_PATH).'upload/template_thumbnails/'.$row['image'];
} else {
$image = api_get_path(WEB_PATH).'home/default_platform_document/noimage.gif';
$image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/noimage.gif';
}
@ -178,7 +178,7 @@ function load_empty_template()
{
global $css;
?>
<Template title="<?php echo s2('Empty'); ?>" image="<?php echo api_get_path(WEB_PATH).'home/default_platform_document/empty.gif'; ?>">
<Template title="<?php echo s2('Empty'); ?>" image="<?php echo api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/empty.gif'; ?>">
<Description></Description>
<Html>
<![CDATA[

@ -2,11 +2,11 @@
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
* Updates the Dokeos files from version 1.8.5 to version 1.8.6
* Updates the Dokeos files from version 1.8.6 to version 1.8.6.1
* This script operates only in the case of an update, and only to change the
* active version number (and other things that might need a change) in the
* current configuration file.
* As of 1.8.5, the Dokeos version has been added to configuration.php to
* As of 1.8.6, the Dokeos version has been added to configuration.php to
* allow for edition (inc/conf is one of the directories that needs write
* permissions on upgrade).
* Being in configuration.php, it benefits from the configuration.dist.php
@ -64,72 +64,17 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
fwrite($fh,'?>');
fclose($fh);
$sys_course_path = $pathForm.'courses/';
//$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
//linking
$link = mysql_connect($dbHostForm, $dbUsernameForm, $dbPassForm);
mysql_select_db($dbNameForm,$link);
$db_name = $dbNameForm;
$sql = "SELECT * FROM $db_name.course";
error_log('Getting courses for files updates: '.$sql,0);
$result=mysql_query($sql);
$perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770');
$old_umask = umask(0);
while($courses_directories=mysql_fetch_array($result))
{
$currentCourseRepositorySys = $sys_course_path.$courses_directories['directory'].'/';
$db_name = $courses_directories['db_name'];
$origCRS = $updatePath.'courses/'.$courses_directories['directory'];
if(!is_dir($origCRS)){
error_log('Directory '.$origCRS.' does not exist. Skipping.',0);
continue;
////create a specific directory for global thumbails
//home > default_platform_document > template_thumb
if(!is_dir($pathForm.'home/default_platform_document/template_thumb')){
mkdir($pathForm.'home/default_platform_document/template_thumb',$perm);
}
//move everything to the new hierarchy (from old path to new path)
error_log('Renaming '.$origCRS.' to '.$sys_course_path.$courses_directories['directory'],0);
rename($origCRS,$sys_course_path.$courses_directories['directory']);
error_log('Creating dirs in '.$currentCourseRepositorySys,0);
//DOCUMENT FOLDER
//document > shared_folder
if(!is_dir($currentCourseRepositorySys."document/shared_folder")){
mkdir($currentCourseRepositorySys."document/shared_folder",$perm);
}
//UPLOAD FOLDER
//upload > forum > images
if(!is_dir($currentCourseRepositorySys."upload/forum/images")){
mkdir($currentCourseRepositorySys."upload/forum/images",$perm);
}
//upload > learning_path
if(!is_dir($currentCourseRepositorySys."upload/learning_path")){
mkdir($currentCourseRepositorySys."upload/learning_path",$perm);
}
//upload > learning_path > images
if(!is_dir($currentCourseRepositorySys."upload/learning_path/images")){
mkdir($currentCourseRepositorySys."upload/learning_path/images",$perm);
}
//upload > calendar
if(!is_dir($currentCourseRepositorySys."upload/calendar")){
mkdir($currentCourseRepositorySys."upload/calendar",$perm);
}
//upload > calendar > images
if(!is_dir($currentCourseRepositorySys."upload/calendar/images")){
mkdir($currentCourseRepositorySys."upload/calendar/images",$perm);
}
}
}
else
{

Loading…
Cancel
Save