|
|
|
@ -4,93 +4,87 @@ |
|
|
|
* @package dokeos.learnpath |
|
|
|
* @package dokeos.learnpath |
|
|
|
* @author Yannick Warnier <ywarnier@beeznest.org> |
|
|
|
* @author Yannick Warnier <ywarnier@beeznest.org> |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
/** |
|
|
|
|
|
|
|
* Script |
|
|
|
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$show_description_field = false; //for now |
|
|
|
$show_description_field = false; //for now |
|
|
|
|
|
|
|
|
|
|
|
$nameTools = get_lang("Doc"); |
|
|
|
$nameTools = get_lang("Doc"); |
|
|
|
|
|
|
|
|
|
|
|
event_access_tool(TOOL_LEARNPATH); |
|
|
|
event_access_tool(TOOL_LEARNPATH); |
|
|
|
|
|
|
|
|
|
|
|
if (! $is_allowed_in_course) api_not_allowed(); |
|
|
|
if (! $is_allowed_in_course) api_not_allowed(); |
|
|
|
/** |
|
|
|
|
|
|
|
* Display |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
$interbreadcrumb[]= array ("url"=>"lp_controller.php?action=list", "name"=> get_lang("_learning_path")); |
|
|
|
$interbreadcrumb[]= array ("url"=>"lp_controller.php?action=list", "name"=> get_lang("_learning_path")); |
|
|
|
$interbreadcrumb[]= array ("url"=>$_SERVER['PHP_SELF']."?action=admin_view&lp_id=$learnpath_id", "name" => $_SESSION['oLP']->get_name()); |
|
|
|
$interbreadcrumb[]= array ("url"=>$_SERVER['PHP_SELF']."?action=admin_view&lp_id=$learnpath_id", "name" => $_SESSION['oLP']->get_name()); |
|
|
|
|
|
|
|
|
|
|
|
Display::display_header(null,'Path'); |
|
|
|
Display::display_header(null,'Path'); |
|
|
|
api_display_tool_title($nameTools); |
|
|
|
|
|
|
|
if($my_version=='1.8'){ |
|
|
|
//Page subtitle |
|
|
|
Display::display_introduction_section(TOOL_LEARNPATH); |
|
|
|
echo '<h4>'.get_lang('_edit_learnpath').'</h4>'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$defaults=array(); |
|
|
|
|
|
|
|
$form = new FormValidator('form1', 'post', 'lp_controller.php'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Title |
|
|
|
|
|
|
|
$form -> addElement('text', 'lp_name', get_lang('_title')); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Ecoding |
|
|
|
|
|
|
|
$encoding_select = &$form->addElement('select', 'lp_encoding', get_lang('Charset')); |
|
|
|
|
|
|
|
$encodings = array('UTF-8','ISO-8859-1','ISO-8859-15','cp1251','cp1252','KOI8-R','BIG5','GB2312','Shift_JIS','EUC-JP'); |
|
|
|
|
|
|
|
foreach($encodings as $encoding){ |
|
|
|
|
|
|
|
if($encoding == $_SESSION['oLP']->encoding){ |
|
|
|
|
|
|
|
$s_selected_encoding = $encoding; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$encoding_select->addOption($encoding,$encoding); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Origin |
|
|
|
|
|
|
|
$origin_select = &$form->addElement('select', 'lp_maker', get_lang('Origin')); |
|
|
|
|
|
|
|
$lp_orig = $_SESSION['oLP']->get_maker(); |
|
|
|
|
|
|
|
include('content_makers.inc.php'); |
|
|
|
|
|
|
|
foreach($content_origins as $origin){ |
|
|
|
|
|
|
|
if($lp_orig == $origin){ |
|
|
|
|
|
|
|
$s_selected_origin = $origin; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$origin_select->addOption($origin,$origin); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Content proximity |
|
|
|
|
|
|
|
$content_proximity_select = &$form->addElement('select', 'lp_proximity', get_lang('ContentProximity')); |
|
|
|
|
|
|
|
$lp_prox = $_SESSION['oLP']->get_proximity(); |
|
|
|
|
|
|
|
if($lp_prox != 'local'){ |
|
|
|
|
|
|
|
$s_selected_proximity = 'remote'; |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
api_introductionsection(TOOL_LEARNPATH); |
|
|
|
$s_selected_proximity = 'local'; |
|
|
|
} |
|
|
|
} |
|
|
|
?> |
|
|
|
$content_proximity_select->addOption(get_lang('Local'), 'local'); |
|
|
|
<form name="form1" method="post" action="lp_controller.php"> |
|
|
|
$content_proximity_select->addOption(get_lang('Remote'), 'remote'); |
|
|
|
<h4> |
|
|
|
|
|
|
|
<?php echo get_lang('_edit_learnpath'); ?> |
|
|
|
|
|
|
|
</h4> |
|
|
|
//default values |
|
|
|
<table width="400" border="0" cellspacing="2" cellpadding="0"> |
|
|
|
$content_proximity_select -> setSelected($s_selected_proximity); |
|
|
|
<tr> |
|
|
|
$origin_select -> setSelected($s_selected_origin); |
|
|
|
<td align="right"><?php echo get_lang('_title');?></td>
|
|
|
|
$encoding_select -> setSelected($s_selected_encoding); |
|
|
|
<td><input name="lp_name" type="text" value="<?php echo $_SESSION['oLP']->get_name();?>" size="50" /></td>
|
|
|
|
$defaults["lp_name"]=$_SESSION['oLP']->get_name(); |
|
|
|
</tr> |
|
|
|
|
|
|
|
<?php if($show_description_field){ ?> |
|
|
|
|
|
|
|
<tr> |
|
|
|
//Submit button |
|
|
|
<td align="right" valign="top"><?php echo get_lang('_description');?></td>
|
|
|
|
$form->addElement('submit', 'Submit', get_lang('Ok')); |
|
|
|
<td><textarea name='lp_description' cols='45'><?php echo $_SESSION['oLP']->get_description();?></textarea></td>
|
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
<?php } ?> |
|
|
|
//Hidden fields |
|
|
|
<tr> |
|
|
|
$form->addElement('hidden', 'action', 'update_lp'); |
|
|
|
<td align="right"><?php echo get_lang('Charset');?></td>
|
|
|
|
$form->addElement('hidden', 'lp_id', $_SESSION['oLP']->get_id()); |
|
|
|
<td><select name="lp_encoding"> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
$encodings = array('UTF-8','ISO-8859-1','ISO-8859-15','cp1251','cp1252','KOI8-R','BIG5','GB2312','Shift_JIS','EUC-JP'); |
|
|
|
$form->setDefaults($defaults); |
|
|
|
foreach($encodings as $encoding){ |
|
|
|
$form -> display(); |
|
|
|
if($encoding == $_SESSION['oLP']->encoding){ |
|
|
|
|
|
|
|
echo " <option value='$encoding' selected='selected'>$encoding</option>\n"; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
echo " <option value='$encoding'>$encoding</option>\n"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
?></select></td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<td align="right"><?php echo get_lang('Origin');?></td>
|
|
|
|
|
|
|
|
<td><select name="lp_maker"> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
$lp_orig = $_SESSION['oLP']->get_maker(); |
|
|
|
|
|
|
|
include('content_makers.inc.php'); |
|
|
|
|
|
|
|
foreach($content_origins as $origin){ |
|
|
|
|
|
|
|
$selected = ''; |
|
|
|
|
|
|
|
if($lp_orig == $origin){ |
|
|
|
|
|
|
|
$selected = ' selected = "selected"'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
echo ' <option value="'.$origin.'"'.$selected.'>'.$origin.'</option>' ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
?></select></td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<td align="right"><?php echo get_lang('Location');?></td>
|
|
|
|
|
|
|
|
<td><select name="lp_proximity"> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
$lp_prox = $_SESSION['oLP']->get_proximity(); |
|
|
|
|
|
|
|
if($lp_prox != 'local'){ |
|
|
|
|
|
|
|
echo ' <option value="local">'.get_lang('Local')."</option>" . |
|
|
|
|
|
|
|
' <option value="remote" selected="selected">'.get_lang('Remote')."</option>"; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
echo ' <option value="local" selected="selected">'.get_lang('Local')."</option>" . |
|
|
|
|
|
|
|
' <option value="remote">'.get_lang('Remote')."</option>"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
?></select></td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<td align="right"> </td> |
|
|
|
|
|
|
|
<input type="hidden" name="action" value="update_lp" /> |
|
|
|
|
|
|
|
<input type="hidden" name="lp_id" value="<?php echo $_SESSION['oLP']->get_id(); ?>" />
|
|
|
|
|
|
|
|
<td><input type="submit" name="Submit" value="<?php echo get_lang('Ok'); ?>" /></td>
|
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
</form> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
Display::display_footer(); |
|
|
|
Display::display_footer(); |
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
|
?> |