Source for file lp_list.php
Documentation is available at lp_list.php
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2004 Denes Nagy
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, rue du Corbeau, 108, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
==============================================================================
* This file was origially the copy of document.php, but many modifications happened since then ;
* the direct file view is not any more needed, if the user uploads a scorm zip file, a directory
* will be automatically created for it, and the files will be uncompressed there for example ;
* @package dokeos.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
==============================================================================
if(empty($lp_controller_touched) || $lp_controller_touched!= 1){
header('location: lp_controller.php?action=list');
require_once('back_compat.inc.php');
$baseWordDir = $courseDir;
$display_progress_bar = true;
require_once('learnpathList.class.php');
require_once('learnpath.class.php');
require_once('learnpathItem.class.php');
//$charset = 'ISO-8859-1';
* Display initialisation and security checks
//extra javascript functions for in html head:
"<script language='javascript' type='text/javascript'>
function confirmation(name)
if (confirm(\" ". trim(get_lang('AreYouSureToDelete')). " ?\"))
//api_display_tool_title($nameTools);
-----------------------------------------------------------
(editable by course admins)
-----------------------------------------------------------
/*--------------------------------------
--------------------------------------*/
//include('content_makers.inc.php');
'<img src="../img/wizard.gif" border="0" align="absmiddle" alt="scormbuilder"> '. get_lang('_add_learnpath').
'<a href="../upload/index.php?'. api_get_cidreq(). '&curdirpath=/&tool='. TOOL_LEARNPATH. '"><img src="../img/file_zip.gif" border="0" alt="scormbuilder" align="absmiddle"> '. get_lang("UploadScorm"). '</a>';
echo str_repeat(' ',3). '<a href="../upload/upload_ppt.php?'. api_get_cidreq(). '&curdirpath=/&tool='. TOOL_LEARNPATH. '"><img src="../img/powerpoint.gif" border="0" alt="scormbuilder" align="absmiddle"> '. get_lang("PowerPointConvert"). '</a>';
echo str_repeat(' ',3). '<a href="../upload/upload_word.php?'. api_get_cidreq(). '&curdirpath=/&tool='. TOOL_LEARNPATH. '"><img src="../img/word.gif" border="0" alt="scormbuilder" align="absmiddle"> '. get_lang("WordConvert"). '</a>';
echo '<table width="100%" border="0" cellspacing="2" class="data_table">';
if ($curDirName) // if the $curDirName is empty, we're in the root point and we can't go to a parent dir
<a href="<?php echo api_get_self().'?'.api_get_cidreq().'&openDir='.$cmdParentDir.'&subdirs=yes'; ?>">
<img src="../img/parent.gif" border="0" align="absbottom" hspace="5" alt="parent" />
<?php echo get_lang("Up"); ?></a>
if(substr($curDirPath,1,1)== '/'){
$tmpcurDirPath = $curDirPath;
<!-- current dir name -->
<td colspan=" <?php echo $colspan ?>" align="left" bgcolor="#4171B5">
<img src="../img/opendir.gif" align="absbottom" vspace="2" hspace="3" alt="open_dir" />
<font color="#ffffff"><b> <?php echo $tmpcurDirPath ?></b></font>
echo '<th>'. get_lang("Name"). '</th>'. "\n" .
echo '<th>'. get_lang("Description"). "</th>\n" .
'<th>'. get_lang("ExportShort"). "</th>\n" .
/*--------------------------------------
--------------------------------------*/
$flat_list = $list->get_flat_list();
$max = count($flat_list);
foreach ($flat_list as $id => $details)
if(!$is_allowed_to_edit && $details['lp_visibility'] == 0)
// This is a student and this path is invisible, skip
if (($counter % 2)== 0) { $oddclass= "row_odd"; } else { $oddclass= "row_even"; }
$url_start_lp = 'lp_controller.php?'. api_get_cidreq(). '&action=view&lp_id='. $id;
$name = $details['lp_name'];
$image= '<img src="../img/kcmdf.gif" border="0" align="absmiddle" alt="scorm">'. "\n";
$dsp_line = '<tr align="center" class="'. $oddclass. '">'. "\n" .
'<td align="left" valign="top">' .
'<div style="float: left; width: 35px; height: 22px;"><a href="'. $url_start_lp. '" '. $style. '>' .
$image . '</a></div><a href="'. $url_start_lp. '" '. $style. '>' . $name . '</a>' .
//$dsp_desc='<td>'.$details['lp_desc'].'</td>'."\n";
if (!empty($platform_theme))
$mystyle= $platform_theme;
if (!empty($mycoursetheme))
if($display_progress_bar)
$dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'. $details['lp_maker']. '</em> '. $details['lp_proximity']. ' '. $details['lp_encoding']. '<a href="lp_controller.php?'. api_get_cidreq(). '&action=edit&lp_id='. $id. '"> <img src="../img/edit.gif" border="0" title="'. get_lang('_edit_learnpath'). '"></a></td>'. "\n";
$fileExtension= explode('.',$dspFileName);
//export not available for normal lps yet
if($details['lp_type']== 1){
$dsp_export = '<td align="center">' .
"<img src=\"../img/cd.gif\" border=\"0\" title=\"". get_lang('Export'). "\">" .
}elseif($details['lp_type']== 2){
$dsp_export = '<td align="center">' .
"<img src=\"../img/cd.gif\" border=\"0\" title=\"". get_lang('Export'). "\">" .
$dsp_export = '<td align="center">' .
//"<a href='".api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id'>" .
"<img src=\"../img/cd_gray.gif\" border=\"0\" title=\"". get_lang('Export'). "\">" .
/* edit title and description */
$dsp_edit = '<td align="center">';
$dsp_edit_close = '</td>';
$dsp_delete = "<a href=\"lp_controller.php?". api_get_cidreq(). "&action=delete&lp_id=$id\" " .
"onClick=\"return confirmation('". addslashes($dspFileName). "');\">" .
"<img src=\"../img/delete.gif\" border=\"0\" title=\"". get_lang('_delete_learnpath'). "\" />" .
if ($details['lp_published'] == "i")
"<img src=\"../img/visible_LP_list.gif\" border=\"0\" title=\"". get_lang('_publish'). "\" />" .
"<img src=\"../img/invisible_LP_list.gif\" border=\"0\" title=\"". get_lang('_no_publish'). "\" />" .
if ($details['lp_visibility'] == 0)
"<img src=\"../img/invisible.gif\" border=\"0\" title=\"". get_lang('Show'). "\" />" .
"<img src=\"../img/visible.gif\" border=\"0\" title=\"". get_lang('Hide'). "\" />" .
/* Default view mode settings (fullscreen/embedded) */
if($details['lp_view_mode'] == 'fullscreen'){
$dsp_default_view = '<a href="lp_controller.php?'. api_get_cidreq(). '&action=switch_view_mode&lp_id='. $id. '">' .
'<img src="../img/view_fullscreen.gif" border="0" alt="'. get_lang("ViewModeEmbedded"). '" title="'. get_lang("ViewModeEmbedded"). '"/>' .
$dsp_default_view = '<a href="lp_controller.php?'. api_get_cidreq(). '&action=switch_view_mode&lp_id='. $id. '">' .
'<img src="../img/view_choose.gif" border="0" alt="'. get_lang("ViewModeFullScreen"). '" title="'. get_lang("ViewModeFullScreen"). '"/>' .
/* Increase SCORM recording */
if($details['lp_force_commit'] == 1){
$dsp_force_commit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_force_commit&lp_id='.$id.'">' .
'<img src="../img/clock.gif" border="0" alt="Normal SCORM recordings" title="'.get_lang("MakeScormRecordingNormal").'"/>' .
$dsp_force_commit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_force_commit&lp_id='.$id.'">' .
'<img src="../img/clock_gray.gif" border="0" alt="Extra SCORM recordings" title="'.get_lang("MakeScormRecordingExtra").'"/>' .
if($details['lp_prevent_reinit']== 1){
$dsp_reinit = '<a href="lp_controller.php?'. api_get_cidreq(). '&action=switch_reinit&lp_id='. $id. '">' .
'<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'. get_lang("AllowMultipleAttempts"). '"/>' .
$dsp_reinit = '<a href="lp_controller.php?'. api_get_cidreq(). '&action=switch_reinit&lp_id='. $id. '">' .
'<img src="../img/kaboodleloop.gif" border="0" alt="Prevent reinit" title="'. get_lang("PreventMultipleAttempts"). '"/>' .
if($details['lp_type']== 1 || $details['lp_type']== 2){
$dsp_build = '<a href="lp_controller.php?'. api_get_cidreq(). '&action=build&lp_id='. $id. '"><img src="../img/wizard.gif" border="0" title="'. get_lang("Build"). '"></a> ';
$dsp_build = '<img src="../img/wizard_gray.gif" border="0" title="'. get_lang("Build"). '"> ';
if($details['lp_scorm_debug']== 1){
$dsp_debug = '<a href="lp_controller.php?'. api_get_cidreq(). '&action=switch_scorm_debug&lp_id='. $id. '">' .
'<img src="../img/bug.gif" border="0" alt="'. get_lang("HideDebug"). '" title="'. get_lang("HideDebug"). '"/>' .
$dsp_debug = '<a href="lp_controller.php?'. api_get_cidreq(). '&action=switch_scorm_debug&lp_id='. $id. '">' .
'<img src="../img/bug_gray.gif" border="0" alt="'. get_lang("ShowDebug"). '" title="'. get_lang("ShowDebug"). '"/>' .
if($details['lp_display_order'] == 1 && $max != 1)
$dsp_order .= '<td><a href="lp_controller.php?'. api_get_cidreq(). '&action=move_lp_down&lp_id='. $id. '">' .
'<img src="../img/arrow_down_0.gif" border="0" alt="'. get_lang("MoveDown"). '" title="'. get_lang("MoveDown"). '"/>' .
'</a><img src="../img/blanco.png" border="0" alt="" title="" /></td>';
elseif($current == $max- 1 && $max != 1) //last element
$dsp_order .= '<td><img src="../img/blanco.png" border="0" alt="" title="" /><a href="lp_controller.php?'. api_get_cidreq(). '&action=move_lp_up&lp_id='. $id. '">' .
'<img src="../img/arrow_up_0.gif" border="0" alt="'. get_lang("MoveDown"). '" title="'. get_lang("MoveDown"). '"/>' .
$dsp_order = '<td></td>';
$dsp_order .= '<td><a href="lp_controller.php?'. api_get_cidreq(). '&action=move_lp_down&lp_id='. $id. '">' .
'<img src="../img/arrow_down_0.gif" border="0" alt="'. get_lang("MoveDown"). '" title="'. get_lang("MoveDown"). '"/>' .
$dsp_order .= '<a href="lp_controller.php?'. api_get_cidreq(). '&action=move_lp_up&lp_id='. $id. '">' .
'<img src="../img/arrow_up_0.gif" border="0" alt="'. get_lang("MoveDown"). '" title="'. get_lang("MoveDown"). '"/>' .
} // end if($is_allowedToEdit)
//echo $dsp_line.$dsp_desc.$dsp_export.$dsp_edit.$dsp_delete.$dsp_visible;
echo $dsp_line. $dsp_progress. $dsp_desc. $dsp_export. $dsp_edit. $dsp_build. $dsp_visible. $dsp_publish. $dsp_reinit. $dsp_default_view. $dsp_force_commit. $dsp_debug. $dsp_delete. $dsp_close. $dsp_order;
//echo $dsp_line.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_visible.$dsp_reinit.$dsp_force_commit.$dsp_delete;
$current ++ ; //counter for number of elements treated
} // end foreach ($flat_list)
//TODO print some user-friendly message if counter is still = 0 to tell nothing can be displayd yet
}// end if ( is_array($flat_list)
==============================================================================
==============================================================================
|