diff --git a/main/document/create_document.php b/main/document/create_document.php index cc55013fa4..6aad14d8b4 100644 --- a/main/document/create_document.php +++ b/main/document/create_document.php @@ -1,10 +1,10 @@ defaultRenderer(); //$filename_template = str_replace('{element}', "$display_dir {element} .html", $renderer->_elementTemplate); $filename_template = str_replace('{element}', "{element}", $renderer->_elementTemplate); $renderer->setElementTemplate($filename_template, 'filename'); + +// initialize group array +$group = array(); + // If allowed, add element for document title if (api_get_setting('use_document_title') == 'true') -{ - $form->add_textfield('title', get_lang('Title'),true,'class="input_titles" id="title"'); +{ + //$group[]= $form->add_textfield('title', get_lang('Title'),true,'class="input_titles" id="title"'); + // replace the add_textfield with this + $group[]=$form->createElement('text','title',get_lang('Title'),'class="input_titles" id="title"'); + //$form->applyFilter('title','trim'); + //$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required'); } 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'); +{ + //$form->add_textfield('filename', get_lang('FileName'),true,'class="input_titles" id="filename" onblur="check_if_still_empty()"'); + // replace the add_textfield with this + $group[]=$form->createElement('text','filename',get_lang('FileName'),'class="input_titles" id="filename" onblur="check_if_still_empty()"'); + //$form->applyFilter('filename','trim'); + //$form->addRule('filename', get_lang('ThisFieldIsRequired'), 'required'); + //$form->addRule('filename', get_lang('FileExists'), 'callback', 'document_exists'); } -$renderer->setElementTemplate('