[svn r10870] allows to add non-html documents

skala
Eric Marguin 19 years ago
parent 573611bd93
commit 5d1c84602f
  1. 23
      main/newscorm/learnpath.class.php

@ -4448,7 +4448,18 @@ class learnpath {
//$return .= '<hr />'; //$return .= '<hr />';
if($row['item_type'] == TOOL_DOCUMENT) if($row['item_type'] == TOOL_DOCUMENT)
{
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql_doc = "SELECT path FROM " . $tbl_doc . " WHERE id = " . $row['path'];
$result=api_sql_query($sql_doc);
$path_file=mysql_result($result,0,0);
$path_parts = pathinfo($path_file);
if(in_array($path_parts['extension'],array('html','txt')))
{
$return .= $this->display_document($row['path'], true, true); $return .= $this->display_document($row['path'], true, true);
}
}
$return .= '</div>'; $return .= '</div>';
} }
@ -5591,14 +5602,14 @@ function display_thread_form($action = 'add', $id = 0, $extra_info = '')
$return .= '</div>'; $return .= '</div>';
} }
/*
if($no_display_add==true){ if($no_display_add==true){
$return .= '<div class="lp_message" style="margin-bottom:15px;">'; $return .= '<div class="lp_message" style="margin-bottom:15px;">';
$return .= get_lang("CantEditDocument"); $return .= get_lang("CantEditDocument");
$return .= '</div>'; $return .= '</div>';
return $return; return $return;
} }
*/
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$form = new FormValidator('form','POST',$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]); $form = new FormValidator('form','POST',$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]);
@ -5671,7 +5682,8 @@ function display_thread_form($action = 'add', $id = 0, $extra_info = '')
if($action != 'move'){ if($action != 'move'){
$form->addElement('text','title', get_lang('Title').' :','id="idTitle" style="background:#F8F8F8; border:1px solid #999999; font-family:Arial, Verdana, Helvetica, sans-serif; font-size:12px; padding:1px 2px; width:300px;"'); $form->addElement('text','title', get_lang('Title').' :','id="idTitle" style="background:#F8F8F8; border:1px solid #999999; font-family:Arial, Verdana, Helvetica, sans-serif; font-size:12px; padding:1px 2px; width:300px;"');
//$form->addElement('textarea','description',get_lang("Description").' :', 'id="idDescription" style="background:#F8F8F8; border:1px solid #999999; font-family:Arial, Verdana, Helvetica, sans-serif; font-size:12px; padding:1px 2px; width:300px;"'); //$form->addElement('textarea','description',get_lang("Description").' :', 'id="idDescription" style="background:#F8F8F8; border:1px solid #999999; font-family:Arial, Verdana, Helvetica, sans-serif; font-size:12px; padding:1px 2px; width:300px;"');
if(!$no_display_add)
{
if(($extra_info == 'new' || $extra_info['item_type'] == TOOL_DOCUMENT || $_GET['edit'] == 'true')) if(($extra_info == 'new' || $extra_info['item_type'] == TOOL_DOCUMENT || $_GET['edit'] == 'true'))
{ {
@ -5693,10 +5705,6 @@ function display_thread_form($action = 'add', $id = 0, $extra_info = '')
$form->addElement('html_editor','content_lp',get_lang("Content")." :"); $form->addElement('html_editor','content_lp',get_lang("Content")." :");
$defaults["content_lp"]=$content; $defaults["content_lp"]=$content;
} }
else{
$return = $this->display_document($extra_info['path'], false, true);
$form->addElement('html',$return);
}
} }
@ -5705,6 +5713,7 @@ function display_thread_form($action = 'add', $id = 0, $extra_info = '')
$return = $this->display_document($extra_info, true, true, true); $return = $this->display_document($extra_info, true, true, true);
$form->addElement('html',$return); $form->addElement('html',$return);
} }
}
} }

Loading…
Cancel
Save