[svn r19083] improve the organization of the global templates and some text

skala
Juan Carlos Raña 17 years ago
parent c7666f7f24
commit d33184427c
  1. 24
      main/admin/settings.php
  2. 8
      main/inc/lib/fckeditor/fcktemplates.xml.php

@ -1,4 +1,4 @@
<?php // $Id: settings.php 18981 2009-03-11 23:42:46Z herodoto $
<?php // $Id: settings.php 19083 2009-03-16 21:54:10Z herodoto $
/*
==============================================================================
Dokeos - elearning and course management software
@ -976,7 +976,14 @@ function actions_filter($id)
*/
function image_filter($image)
{
return '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/'.$image.'" alt="'.$image.'"/>';
if (!empty($image))
{
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/template_thumb/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>';
}
}
/**
@ -1031,7 +1038,14 @@ function add_edit_template()
$form->addElement('hidden','template_id');
// adding an extrra field: a preview of the image that is currently used
$form->addElement('static','template_image_preview', '', '<img src="'.api_get_path(WEB_PATH).'home/default_platform_document/'.$row['image'].'" alt="'.$row['image'].'"/>');
if (!empty($row['image']))
{
$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/template_thumb/noimage.gif" alt="'.get_lang('NoTemplatePreview').'"/>');
}
// setting the information of the template that we are editing
$form->setDefaults($defaults);
@ -1061,7 +1075,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)) {
@ -1153,7 +1167,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

@ -95,9 +95,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']);
@ -161,7 +161,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/empty.gif';
$image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/noimage.gif';
}
@ -181,7 +181,7 @@ function load_empty_template()
global $css;
?>
<Template title="<?php echo s('Empty'); ?>" image="<?php echo api_get_path(WEB_PATH).'home/default_platform_document/empty.gif'; ?>">
<Template title="<?php echo s('Empty'); ?>" image="<?php echo api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/empty.gif'; ?>">
<Description></Description>
<Html>
<![CDATA[

Loading…
Cancel
Save