[svn r12759] remove filename when document title option is enabled (FS#1770)

skala
Eric Marguin 18 years ago
parent e5953e0dae
commit e1994a063a
  1. 13
      main/document/create_document.php
  2. 7
      main/document/edit_document.php

@ -1,5 +1,5 @@
<?php
// $Id: create_document.php 12218 2007-05-01 18:27:14Z yannoo $
// $Id: create_document.php 12759 2007-07-19 07:52:56Z elixir_inter $
/*
==============================================================================
Dokeos - elearning and course management software
@ -241,8 +241,6 @@ $default['dir'] = $dir;
$form->addElement('hidden','title_edited','false','id="title_edited"');
$form->add_textfield('filename', get_lang('FileName'),true,'class="input_titles" id="filename" onblur="check_if_still_empty()"');
$form->addRule('filename', get_lang('FileExists'), 'callback', 'document_exists');
/**
* Check if a document width the choosen filename allready exists
*/
@ -262,6 +260,11 @@ if (api_get_setting('use_document_title') == 'true')
{
$form->add_textfield('title', get_lang('Title'),true,'class="input_titles" id="title"');
}
else
{
$form->add_textfield('filename', get_lang('FileName'),true,'class="input_titles" id="filename" onblur="check_if_still_empty()"');
$form->addRule('filename', get_lang('FileExists'), 'callback', 'document_exists');
}
// HTML-editor
$form->add_html_editor('content', get_lang('Content'), false, true);
// Comment-field
@ -277,6 +280,10 @@ if ($form->validate())
{
$values['title'] = $values['filename'];
}
else
{
$values['filename'] = $values['title'];
}
$filename = replace_dangerous_char($values['filename']);
$texte = $values['content'];
$title = $values['filename'];

@ -1,4 +1,4 @@
<?php // $Id: edit_document.php 12272 2007-05-03 14:40:45Z elixir_julian $
<?php // $Id: edit_document.php 12759 2007-07-19 07:52:56Z elixir_inter $
/*
==============================================================================
Dokeos - elearning and course management software
@ -477,12 +477,15 @@ $form->addElement('hidden','filename');
$form->addElement('hidden','extension');
$form->addElement('hidden','file_path');
$form->addElement('hidden','commentPath');
$form->add_textfield('renameTo',get_lang('FileName'));
if($use_document_title)
{
$form->add_textfield('newTitle',get_lang('Title'));
$defaults['newTitle'] = $oldTitle;
}
else
{
$form->addElement('hidden','renameTo');
}
if($extension == "htm" || $extension == "html")
{
$form->addElement('hidden','formSent');

Loading…
Cancel
Save