lp_list.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <?php //$id:$
  2. /* For licensing terms, see /dokeos_license.txt */
  3. /**
  4. ==============================================================================
  5. * This file was origially the copy of document.php, but many modifications happened since then ;
  6. * the direct file view is not any more needed, if the user uploads a scorm zip file, a directory
  7. * will be automatically created for it, and the files will be uncompressed there for example ;
  8. *
  9. * @package dokeos.learnpath
  10. * @author Yannick Warnier <ywarnier@beeznest.org>
  11. ==============================================================================
  12. */
  13. /**
  14. * Script
  15. */
  16. $this_section=SECTION_COURSES;
  17. if(empty($lp_controller_touched) || $lp_controller_touched!=1){
  18. header('location: lp_controller.php?action=list');
  19. }
  20. require_once('back_compat.inc.php');
  21. $courseDir = api_get_course_path().'/scorm';
  22. $baseWordDir = $courseDir;
  23. $display_progress_bar = true;
  24. require_once('learnpathList.class.php');
  25. require_once('learnpath.class.php');
  26. require_once('learnpathItem.class.php');
  27. //$charset = 'UTF-8';
  28. //$charset = 'ISO-8859-1';
  29. /**
  30. * Display initialisation and security checks
  31. */
  32. //extra javascript functions for in html head:
  33. $htmlHeadXtra[] =
  34. "<script language='javascript' type='text/javascript'>
  35. function confirmation(name)
  36. {
  37. if (confirm(\" ".trim(get_lang('AreYouSureToDelete'))." \"+name+\"?\"))
  38. {return true;}
  39. else
  40. {return false;}
  41. }
  42. </script>";
  43. $nameTools = get_lang(ucfirst(TOOL_LEARNPATH));
  44. event_access_tool(TOOL_LEARNPATH);
  45. if (! $is_allowed_in_course) api_not_allowed();
  46. /**
  47. * Display
  48. */
  49. /* Require the search widget and prepare the header with its stuff */
  50. if (api_get_setting('search_enabled') == 'true') {
  51. require api_get_path(LIBRARY_PATH).'search/search_widget.php';
  52. search_widget_prepare(&$htmlHeadXtra);
  53. }
  54. Display::display_header($nameTools,"Path");
  55. $current_session = api_get_session_id();
  56. //api_display_tool_title($nameTools);
  57. /*
  58. -----------------------------------------------------------
  59. Introduction section
  60. (editable by course admins)
  61. -----------------------------------------------------------
  62. */
  63. Display::display_introduction_section(TOOL_LEARNPATH, array(
  64. 'CreateDocumentWebDir' => api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document/',
  65. 'CreateDocumentDir' => '../../courses/'.api_get_course_path().'/document/',
  66. 'BaseHref' => api_get_path('WEB_COURSE_PATH').api_get_course_path().'/'
  67. )
  68. );
  69. $is_allowed_to_edit = api_is_allowed_to_edit(null,true);
  70. if($is_allowed_to_edit)
  71. {
  72. /*--------------------------------------
  73. DIALOG BOX SECTION
  74. --------------------------------------*/
  75. if (!empty($dialog_box))
  76. {
  77. switch ($_GET['dialogtype'])
  78. {
  79. case 'confirmation':
  80. Display::display_confirmation_message($dialog_box);
  81. break;
  82. case 'error':
  83. Display::display_error_message($dialog_box);
  84. break;
  85. case 'warning':
  86. Display::display_warning_message($dialog_box);
  87. break;
  88. default:
  89. Display::display_normal_message($dialog_box);
  90. break;
  91. }
  92. }
  93. if (api_failure::get_last_failure())
  94. {
  95. Display::display_normal_message(api_failure::get_last_failure());
  96. }
  97. //include('content_makers.inc.php');
  98. echo '<div class="actions">';
  99. echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_lp">'.
  100. '<img src="../img/wizard.gif" border="0" align="absmiddle" alt="'.get_lang('_add_learnpath').
  101. '">&nbsp;'.get_lang('_add_learnpath').
  102. '</a>' .
  103. str_repeat('&nbsp;',3).
  104. '<a href="../upload/index.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH.'"><img src="../img/file_zip.gif" border="0" alt="'.get_lang("UploadScorm").'" align="absmiddle">&nbsp;'.get_lang("UploadScorm").'</a>';
  105. if (api_get_setting('service_ppt2lp', 'active') == 'true') {
  106. echo str_repeat('&nbsp;',3).'<a href="../upload/upload_ppt.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH.'"><img src="../img/powerpoint.gif" border="0" alt="'.get_lang("PowerPointConvert").'" align="absmiddle">&nbsp;'.get_lang("PowerPointConvert").'</a>';
  107. //echo str_repeat('&nbsp;',3).'<a href="../upload/upload_word.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH.'"><img src="../img/word.gif" border="0" alt="'.get_lang("WordConvert").'" align="absmiddle">&nbsp;'.get_lang("WordConvert").'</a>';
  108. }
  109. echo '</div>';
  110. }
  111. echo '<table width="100%" border="0" cellspacing="2" class="data_table">';
  112. $is_allowed_to_edit ? $colspan = 9 : $colspan = 3;
  113. /*
  114. if ($curDirName) // if the $curDirName is empty, we're in the root point and we can't go to a parent dir
  115. {
  116. ?>
  117. <!-- parent dir -->
  118. <a href="<?php echo api_get_self().'?'.api_get_cidreq().'&openDir='.$cmdParentDir.'&subdirs=yes'; ?>">
  119. <img src="../img/parent.gif" border="0" align="absbottom" hspace="5" alt="parent" />
  120. <?php echo get_lang("Up"); ?></a>&nbsp;
  121. <?php
  122. }
  123. */
  124. if (!empty($curDirPath))
  125. {
  126. if(substr($curDirPath,1,1)=='/'){
  127. $tmpcurDirPath=substr($curDirPath,1,strlen($curDirPath));
  128. }else{
  129. $tmpcurDirPath = $curDirPath;
  130. }
  131. ?>
  132. <!-- current dir name -->
  133. <tr>
  134. <td colspan="<?php echo $colspan ?>" align="left" bgcolor="#4171B5">
  135. <img src="../img/opendir.gif" align="absbottom" vspace="2" hspace="3" alt="open_dir" />
  136. <font color="#ffffff"><b><?php echo $tmpcurDirPath ?></b></font>
  137. </td>
  138. </tr>
  139. <?php
  140. }
  141. /* CURRENT DIRECTORY */
  142. echo '<tr>';
  143. echo '<th>'.get_lang('Title').'</th>'."\n" .
  144. '<th>'.get_lang('Progress')."</th>\n";
  145. if ($is_allowed_to_edit)
  146. {
  147. echo '<th>'.get_lang('CourseSettings')."</th>\n" .
  148. //xport now is inside "Edit"
  149. //'<th>'.get_lang('ExportShort')."</th>\n" .
  150. '<th>'.get_lang('AuthoringOptions')."</th>\n";
  151. // only available for not session mode
  152. if ($current_session == 0) {
  153. echo'<th>'.get_lang('Move')."</th>\n";
  154. }
  155. }
  156. echo "</tr>\n";
  157. /*--------------------------------------
  158. DISPLAY SCORM LIST
  159. --------------------------------------*/
  160. $list = new LearnpathList(api_get_user_id());
  161. $flat_list = $list->get_flat_list();
  162. $test_mode = api_get_setting('server_type');
  163. $max = count($flat_list);
  164. //var_dump($flat_list);
  165. if (is_array($flat_list))
  166. {
  167. $counter = 0;
  168. $current = 0;
  169. foreach ($flat_list as $id => $details)
  170. {
  171. //validacion when belongs to a session
  172. $session_img = api_get_session_image($details['lp_session'], $_user['status']);
  173. if(!$is_allowed_to_edit && $details['lp_visibility'] == 0)
  174. {
  175. // This is a student and this path is invisible, skip
  176. continue;
  177. }
  178. $counter++;
  179. if (($counter % 2)==0) { $oddclass="row_odd"; } else { $oddclass="row_even"; }
  180. $url_start_lp = 'lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$id;
  181. $name = Security::remove_XSS($details['lp_name']);
  182. $image='<img src="../img/kcmdf.gif" border="0" align="absmiddle" alt="' . $name . '">'."\n";
  183. $dsp_line = '<tr align="center" class="'.$oddclass.'">'."\n" .
  184. '<td align="left" valign="top">' .
  185. '<div style="float: left; width: 35px; height: 22px;"><a href="'.$url_start_lp.'">' .
  186. $image . '</a></div><a href="'.$url_start_lp.'">' . $name . '</a>' . $session_img .
  187. "</td>\n";
  188. //$dsp_desc='<td>'.$details['lp_desc'].'</td>'."\n";
  189. $dsp_desc = '';
  190. $dsp_export = '';
  191. $dsp_edit = '';
  192. $dsp_edit_close = '';
  193. $dsp_delete = '';
  194. $dsp_visible = '';
  195. $dsp_default_view = '';
  196. $dsp_debug = '';
  197. $dsp_order = '';
  198. // Select course theme
  199. if (!empty($platform_theme))
  200. {
  201. $mystyle=$platform_theme;
  202. }
  203. if (!empty($user_theme))
  204. {
  205. $mystyle=$user_theme;
  206. }
  207. if (!empty($mycoursetheme))
  208. {
  209. $mystyle=$mycoursetheme;
  210. }
  211. $lp_theme_css=$mystyle;
  212. if($display_progress_bar)
  213. {
  214. $dsp_progress = '<td>'.learnpath::get_progress_bar('%',learnpath::get_db_progress($id,api_get_user_id()),'').'</td>';
  215. }
  216. else
  217. {
  218. $dsp_progress = '<td style="padding-top:1em;">'.learnpath::get_db_progress($id,api_get_user_id(),'both').'</td>';
  219. }
  220. if($is_allowed_to_edit) {
  221. if ($current_session == $details['lp_session']) {
  222. $dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em> &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id='.$id.'">&nbsp;&nbsp;<img src="../img/edit.gif" border="0" title="'.get_lang('_edit_learnpath').'"></a></td>'."\n";
  223. } else {
  224. $dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em> &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'<img src="../img/edit_na.gif" border="0" title="'.get_lang('_edit_learnpath').'"></td>'."\n";
  225. }
  226. /* export */
  227. //Export is inside "Edit"
  228. //export not available for normal lps yet
  229. /*if($details['lp_type']==1){
  230. $dsp_export = '<td align="center">' .
  231. "<a href='".api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id'>" .
  232. "<img src=\"../img/cd.gif\" border=\"0\" title=\"".get_lang('Export')."\">" .
  233. "</a>" .
  234. "";
  235. }elseif($details['lp_type']==2){
  236. $dsp_export = '<td align="center">' .
  237. "<a href='".api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id&export_name=".replace_dangerous_char($name,'strict').".zip'>" .
  238. "<img src=\"../img/cd.gif\" border=\"0\" title=\"".get_lang('Export')."\">" .
  239. "</a>" .
  240. "";
  241. }else{
  242. $dsp_export = '<td align="center">' .
  243. //"<a href='".api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id'>" .
  244. "<img src=\"../img/cd_gray.gif\" border=\"0\" title=\"".get_lang('Export')."\">" .
  245. //"</a>" .
  246. "";
  247. }*/
  248. /* edit title and description */
  249. $dsp_edit = '<td align="center">';
  250. $dsp_edit_close = '</td>';
  251. /* BUILD */
  252. if ($current_session == $details['lp_session']) {
  253. if($details['lp_type']==1 || $details['lp_type']==2){
  254. $dsp_build = '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=build&amp;lp_id='.$id.'"><img src="../img/wizard.gif" border="0" title="'.get_lang("Build").'"></a>&nbsp;';
  255. } else {
  256. $dsp_build = '<img src="../img/wizard_gray.gif" border="0" title="'.get_lang("Build").'">&nbsp;';
  257. }
  258. } else {
  259. $dsp_build = '<img src="../img/wizard_gray.gif" border="0" title="'.get_lang("Build").'">&nbsp;';
  260. }
  261. /* VISIBILITY COMMAND */
  262. if ($current_session == $details['lp_session']) {
  263. if ($details['lp_visibility'] == 0)
  264. {
  265. $dsp_visible = "<a href=\"".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=1\">" .
  266. "<img src=\"../img/invisible.gif\" border=\"0\" title=\"".get_lang('Show')."\" />" .
  267. "</a>" .
  268. "";
  269. }
  270. else
  271. {
  272. $dsp_visible = "<a href='".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=0'>" .
  273. "<img src=\"../img/visible.gif\" border=\"0\" title=\"".get_lang('Hide')."\" />" .
  274. "</a>".
  275. "";
  276. }
  277. } else {
  278. $dsp_visible = '<img src="../img/invisible.gif" border="0" title="'.get_lang('Show').'" />';
  279. }
  280. /* PUBLISH COMMAND */
  281. if ($current_session == $details['lp_session']) {
  282. if ($details['lp_published'] == "i")
  283. {
  284. $dsp_publish = "<a href=\"".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=v\">" .
  285. "<img src=\"../img/invisible_LP_list.gif\" border=\"0\" title=\"".get_lang('_publish')."\" />" .
  286. "</a>" .
  287. "";
  288. }
  289. else
  290. {
  291. $dsp_publish = "<a href='".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=i'>" .
  292. "<img src=\"../img/visible_LP_list.gif\" border=\"0\" title=\"".get_lang('_no_publish')."\" />" .
  293. "</a>".
  294. "";
  295. }
  296. } else {
  297. $dsp_publish = '<img src="../img/invisible_LP_list.gif" border="0" title="'.get_lang('_no_publish').'" />';
  298. }
  299. /* MULTIPLE ATTEMPTS */
  300. if ($current_session == $details['lp_session']) {
  301. if($details['lp_prevent_reinit']==1){
  302. $dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' .
  303. '<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'.get_lang("AllowMultipleAttempts").'"/>' .
  304. '</a>&nbsp;';
  305. }else{
  306. $dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' .
  307. '<img src="../img/kaboodleloop.gif" border="0" alt="Prevent reinit" title="'.get_lang("PreventMultipleAttempts").'"/>' .
  308. '</a>&nbsp;';
  309. }
  310. } else {
  311. $dsp_reinit = '<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'.get_lang("AllowMultipleAttempts").'"/>';
  312. }
  313. /* FUll screen VIEW */
  314. if ($current_session == $details['lp_session']) {
  315. /* Default view mode settings (fullscreen/embedded) */
  316. if($details['lp_view_mode'] == 'fullscreen'){
  317. $dsp_default_view = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.'">' .
  318. '<img src="../img/view_fullscreen.gif" border="0" alt="'.get_lang("ViewModeEmbedded").'" title="'.get_lang("ViewModeEmbedded").'"/>' .
  319. '</a>&nbsp;';
  320. }else{
  321. $dsp_default_view = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.'">' .
  322. '<img src="../img/view_choose.gif" border="0" alt="'.get_lang("ViewModeFullScreen").'" title="'.get_lang("ViewModeFullScreen").'"/>' .
  323. '</a>&nbsp;';
  324. }
  325. } else {
  326. if($details['lp_view_mode'] == 'fullscreen')
  327. $dsp_default_view = '<img src="../img/view_fullscreen_na.gif" border="0" alt="'.get_lang("ViewModeEmbedded").'" title="'.get_lang("ViewModeEmbedded").'"/>';
  328. else
  329. $dsp_default_view = '<img src="../img/view_choose_na.gif" border="0" alt="'.get_lang("ViewModeEmbedded").'" title="'.get_lang("ViewModeFullScreen").'"/>';
  330. }
  331. /* Increase SCORM recording */
  332. /*
  333. if($details['lp_force_commit'] == 1){
  334. $dsp_force_commit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_force_commit&lp_id='.$id.'">' .
  335. '<img src="../img/clock.gif" border="0" alt="Normal SCORM recordings" title="'.get_lang("MakeScormRecordingNormal").'"/>' .
  336. '</a>&nbsp;';
  337. }else{
  338. $dsp_force_commit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_force_commit&lp_id='.$id.'">' .
  339. '<img src="../img/clock_gray.gif" border="0" alt="Extra SCORM recordings" title="'.get_lang("MakeScormRecordingExtra").'"/>' .
  340. '</a>&nbsp;';
  341. }
  342. */
  343. /* DEBUG */
  344. if($test_mode == 'test' or api_is_platform_admin()) {
  345. if($details['lp_scorm_debug']==1){
  346. $dsp_debug = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'">' .
  347. '<img src="../img/bug.gif" border="0" alt="'.get_lang("HideDebug").'" title="'.get_lang("HideDebug").'"/>' .
  348. '</a>&nbsp;';
  349. }else{
  350. $dsp_debug = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'">' .
  351. '<img src="../img/bug_gray.gif" border="0" alt="'.get_lang("ShowDebug").'" title="'.get_lang("ShowDebug").'"/>' .
  352. '</a>&nbsp;';
  353. }
  354. }
  355. /* DELETE COMMAND */
  356. if ($current_session == $details['lp_session']) {
  357. $dsp_delete = "<a href=\"lp_controller.php?".api_get_cidreq()."&action=delete&lp_id=$id\" " .
  358. "onClick=\"return confirmation('".addslashes($name)."');\">" .
  359. "<img src=\"../img/delete.gif\" border=\"0\" title=\"".get_lang('_delete_learnpath')."\" />" .
  360. "</a>";
  361. } else {
  362. $dsp_delete = '<img src="../img/delete_na.gif" border="0" title="'.get_lang('_delete_learnpath').'" />';
  363. }
  364. if($details['lp_prevent_reinit']==1){
  365. $dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' .
  366. '<img src="../img/kaboodleloop_gray.gif" border="0" alt="Allow reinit" title="'.get_lang("AllowMultipleAttempts").'"/>' .
  367. '</a>&nbsp;';
  368. }else{
  369. $dsp_reinit = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_reinit&lp_id='.$id.'">' .
  370. '<img src="../img/kaboodleloop.gif" border="0" alt="Prevent reinit" title="'.get_lang("PreventMultipleAttempts").'"/>' .
  371. '</a>&nbsp;';
  372. }
  373. if($details['lp_type']==1 || $details['lp_type']==2){
  374. $dsp_build = '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=build&amp;lp_id='.$id.'"><img src="../img/wizard.gif" border="0" title="'.get_lang("Build").'"></a>&nbsp;';
  375. }else{
  376. $dsp_build = '<img src="../img/wizard_gray.gif" border="0" title="'.get_lang("Build").'">&nbsp;';
  377. }
  378. if($test_mode == 'test' or api_is_platform_admin())
  379. {
  380. if($details['lp_scorm_debug']==1){
  381. $dsp_debug = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'">' .
  382. '<img src="../img/bug.gif" border="0" alt="'.get_lang("HideDebug").'" title="'.get_lang("HideDebug").'"/>' .
  383. '</a>&nbsp;';
  384. }else{
  385. $dsp_debug = '<a href="lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'">' .
  386. '<img src="../img/bug_gray.gif" border="0" alt="'.get_lang("ShowDebug").'" title="'.get_lang("ShowDebug").'"/>' .
  387. '</a>&nbsp;';
  388. }
  389. }
  390. /* Export */
  391. if($details['lp_type']==1){
  392. $dsp_disk =
  393. "<a href='".api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id'>" .
  394. "<img src=\"../img/cd.gif\" border=\"0\" title=\"".get_lang('Export')."\">" .
  395. "</a>" .
  396. "";
  397. }elseif($details['lp_type']==2){
  398. $dsp_disk =
  399. "<a href='".api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id&export_name=".replace_dangerous_char($name,'strict').".zip'>" .
  400. "<img src=\"../img/cd.gif\" border=\"0\" title=\"".get_lang('Export')."\">" .
  401. "</a>" .
  402. "";
  403. }else{
  404. $dsp_disk =
  405. //"<a href='".api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id'>" .
  406. "<img src=\"../img/cd_gray.gif\" border=\"0\" title=\"".get_lang('Export')."\">" .
  407. //"</a>" .
  408. "";
  409. }
  410. //hide icon export scorm
  411. //$dsp_disk='';
  412. /* COLUMN ORDER */
  413. // only active in a not session mode
  414. if ($current_session == 0) {
  415. if($details['lp_display_order'] == 1 && $max != 1)
  416. {
  417. $dsp_order .= '<td><a href="lp_controller.php?'.api_get_cidreq().'&action=move_lp_down&lp_id='.$id.'">' .
  418. '<img src="../img/arrow_down_0.gif" border="0" alt="'.get_lang("MoveDown").'" title="'.get_lang("MoveDown").'"/>' .
  419. '</a><img src="../img/blanco.png" border="0" alt="" title="" /></td>';
  420. }
  421. elseif($current == $max-1 && $max != 1) //last element
  422. {
  423. $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.'">' .
  424. '<img src="../img/arrow_up_0.gif" border="0" alt="'.get_lang("MoveUp").'" title="'.get_lang("MoveUp").'"/>' .
  425. '</a></td>';
  426. }
  427. elseif($max == 1)
  428. {
  429. $dsp_order = '<td></td>';
  430. }
  431. else
  432. {
  433. $dsp_order .= '<td><a href="lp_controller.php?'.api_get_cidreq().'&action=move_lp_down&lp_id='.$id.'">' .
  434. '<img src="../img/arrow_down_0.gif" border="0" alt="'.get_lang("MoveDown").'" title="'.get_lang("MoveDown").'"/>' .
  435. '</a>&nbsp;';
  436. $dsp_order .= '<a href="lp_controller.php?'.api_get_cidreq().'&action=move_lp_up&lp_id='.$id.'">' .
  437. '<img src="../img/arrow_up_0.gif" border="0" alt="'.get_lang("MoveUp").'" title="'.get_lang("MoveUp").'"/>' .
  438. '</a></td>';
  439. }
  440. }
  441. } // end if($is_allowedToEdit)
  442. //echo $dsp_line.$dsp_desc.$dsp_export.$dsp_edit.$dsp_delete.$dsp_visible;
  443. echo $dsp_line.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_visible.$dsp_publish.$dsp_reinit.$dsp_default_view.$dsp_debug.$dsp_delete.$dsp_disk.$dsp_order;
  444. //echo $dsp_line.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_visible.$dsp_reinit.$dsp_force_commit.$dsp_delete;
  445. echo "</tr>\n";
  446. $current ++; //counter for number of elements treated
  447. } // end foreach ($flat_list)
  448. //TODO print some user-friendly message if counter is still = 0 to tell nothing can be displayd yet
  449. }// end if ( is_array($flat_list)
  450. echo "</table>";
  451. echo "<br/><br/>";
  452. /*
  453. ==============================================================================
  454. FOOTER
  455. ==============================================================================
  456. */
  457. Display::display_footer();
  458. ?>