From 5613e89215e2a1597b92e3bd0122f89e5e04729c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Sat, 7 Feb 2009 00:24:18 +0100 Subject: [PATCH] [svn r18316] button bar introduction section --- main/newscorm/lp_list.php | 834 +++++++++++++++++++------------------- 1 file changed, 417 insertions(+), 417 deletions(-) diff --git a/main/newscorm/lp_list.php b/main/newscorm/lp_list.php index b50fdb266e..8e506b720e 100644 --- a/main/newscorm/lp_list.php +++ b/main/newscorm/lp_list.php @@ -1,417 +1,417 @@ - -============================================================================== -*/ -/** - * Script - */ - -if(empty($lp_controller_touched) || $lp_controller_touched!=1){ - header('location: lp_controller.php?action=list'); -} - -require_once('back_compat.inc.php'); -$courseDir = api_get_course_path().'/scorm'; -$baseWordDir = $courseDir; -$display_progress_bar = true; - -require_once('learnpathList.class.php'); -require_once('learnpath.class.php'); -require_once('learnpathItem.class.php'); -//$charset = 'UTF-8'; -//$charset = 'ISO-8859-1'; - -/** - * Display initialisation and security checks - */ -//extra javascript functions for in html head: -$htmlHeadXtra[] = -""; -$nameTools = get_lang(ucfirst(TOOL_LEARNPATH)); -event_access_tool(TOOL_LEARNPATH); - -if (! $is_allowed_in_course) api_not_allowed(); - -/** - * Display - */ -/* Require the search widget and prepare the header with its stuff */ -if (api_get_setting('search_enabled') == 'true') { - require api_get_path(LIBRARY_PATH).'search/search_widget.php'; - search_widget_prepare(&$htmlHeadXtra); -} -Display::display_header($nameTools,"Path"); -//api_display_tool_title($nameTools); - -/* ------------------------------------------------------------ - Introduction section - (editable by course admins) ------------------------------------------------------------ -*/ - -$fck_attribute['Width'] = '100%'; -$fck_attribute['Height'] = '400'; -$fck_attribute['ToolbarSet'] = 'Full'; - -// These settings should stay here. -// TODO: Here a calculation mechanism has to be added in order the editor to work -// properly with documents that are not at the root of the repository. -$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document/'; -$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/'; -$fck_attribute['Config']['BaseHref'] = api_get_path('WEB_COURSE_PATH').api_get_course_path().'/'; - -Display::display_introduction_section(TOOL_LEARNPATH); - -$fck_attribute = null; // Clearing this global variable immediatelly after it has been used. - -if(api_is_allowed_to_edit()) -{ - - - /*-------------------------------------- - DIALOG BOX SECTION - --------------------------------------*/ - - if (!empty($dialog_box)) - { - Display::display_normal_message($dialog_box); - } - if (api_failure::get_last_failure()) - { - Display::display_normal_message(api_failure::get_last_failure()); - } - - //include('content_makers.inc.php'); - echo '
'; - echo ''. - ''.get_lang('_add_learnpath').
-		' '.get_lang('_add_learnpath'). - '' . - str_repeat(' ',3). - ''.get_lang( '.get_lang("UploadScorm").''; - if (api_get_setting('service_ppt2lp', 'active') == 'true') - { - echo str_repeat(' ',3).''.get_lang( '.get_lang("PowerPointConvert").''; - echo str_repeat(' ',3).''.get_lang( '.get_lang("WordConvert").''; - } - echo '
'; - - -} - -echo ''; -api_is_allowed_to_edit() ? $colspan = 9 : $colspan = 3; - -/* -if ($curDirName) // if the $curDirName is empty, we're in the root point and we can't go to a parent dir -{ - ?> - - - parent -   - - - - - - '; -echo ''."\n" . - '\n"; -if (api_is_allowed_to_edit()) -{ - echo '\n" . - '\n" . - '\n" . - '\n"; -} - -echo "\n"; - -/*-------------------------------------- - DISPLAY SCORM LIST - --------------------------------------*/ -$list = new LearnpathList(api_get_user_id()); -$flat_list = $list->get_flat_list(); -$is_allowed_to_edit = api_is_allowed_to_edit(); -$test_mode = api_get_setting('server_type'); -$max = count($flat_list); -//var_dump($flat_list); -if (is_array($flat_list)) -{ - $counter = 0; - $current = 0; - 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 - continue; - } - $counter++; - 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='' . $name . ''."\n"; - $dsp_line = ''."\n" . - '\n"; - //$dsp_desc=''."\n"; - $dsp_desc = ''; - - $dsp_export = ''; - $dsp_edit = ''; - $dsp_edit_close = ''; - $dsp_delete = ''; - $dsp_visible = ''; - $dsp_default_view = ''; - $dsp_debug = ''; - $dsp_order = ''; - - // Select course theme - if (!empty($platform_theme)) - { - $mystyle=$platform_theme; - } - - if (!empty($user_theme)) - { - $mystyle=$user_theme; - } - - if (!empty($mycoursetheme)) - { - $mystyle=$mycoursetheme; - } - - $lp_theme_css=$mystyle; - - - if($display_progress_bar) - { - $dsp_progress = ''; - } - else - { - $dsp_progress = ''; - } - if($is_allowed_to_edit) - { - $dsp_desc = ''."\n"; - - /* export */ - //export not available for normal lps yet - if($details['lp_type']==1){ - $dsp_export = ''; - - /* DELETE COMMAND */ - $dsp_delete = "" . - "" . - ""; - - /* VISIBILITY COMMAND */ - - if ($details['lp_published'] == "i") - { - $dsp_publish = "" . - "" . - "" . - ""; - } - else - { - $dsp_publish = "" . - "" . - "". - ""; - } - /* VISIBILITY COMMAND */ - - if ($details['lp_visibility'] == 0) - { - $dsp_visible = "" . - "" . - "" . - ""; - } - else - { - $dsp_visible = "" . - "" . - "". - ""; - } - /* Default view mode settings (fullscreen/embedded) */ - if($details['lp_view_mode'] == 'fullscreen'){ - $dsp_default_view = '' . - ''.get_lang(' . - ' '; - }else{ - $dsp_default_view = '' . - ''.get_lang(' . - ' '; - } - /* Increase SCORM recording */ - /* - if($details['lp_force_commit'] == 1){ - $dsp_force_commit = '' . - 'Normal SCORM recordings' . - ' '; - }else{ - $dsp_force_commit = '' . - 'Extra SCORM recordings' . - ' '; - } - */ - if($details['lp_prevent_reinit']==1){ - $dsp_reinit = '' . - 'Allow reinit' . - ' '; - }else{ - $dsp_reinit = '' . - 'Prevent reinit' . - ' '; - } - if($details['lp_type']==1 || $details['lp_type']==2){ - $dsp_build = ' '; - }else{ - $dsp_build = ' '; - } - if($test_mode == 'test' or api_is_platform_admin()) - { - if($details['lp_scorm_debug']==1){ - $dsp_debug = '' . - ''.get_lang(' . - ' '; - }else{ - $dsp_debug = '' . - ''.get_lang(' . - ' '; - } - } - if($details['lp_display_order'] == 1 && $max != 1) - { - $dsp_order .= ''; - } - elseif($current == $max-1 && $max != 1) //last element - { - $dsp_order .= ''; - } - elseif($max == 1) - { - $dsp_order = ''; - } - else - { - $dsp_order .= ''; - } - } // 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_debug.$dsp_delete.$dsp_order; - //echo $dsp_line.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_visible.$dsp_reinit.$dsp_force_commit.$dsp_delete; - echo "\n"; - $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) -echo "
- open_dir - -
'.get_lang('Name').''.get_lang('Progress')."'.get_lang('Description')."'.get_lang('ExportShort')."'.get_lang('Modify')."'.get_lang('Move')."
' . - '' . $name . '' . - "'.$details['lp_desc'].''.learnpath::get_progress_bar('%',learnpath::get_db_progress($id,api_get_user_id()),'').''.learnpath::get_db_progress($id,api_get_user_id(),'both').''.$details['lp_maker'].'    '.$details['lp_proximity'].'    '.$details['lp_encoding'].'  ' . - "" . - "" . - "" . - ""; - }elseif($details['lp_type']==2){ - $dsp_export = '' . - "" . - "" . - "" . - ""; - }else{ - $dsp_export = '' . - //"" . - "" . - //"" . - ""; - } - /* edit title and description */ - - $dsp_edit = ''; - $dsp_edit_close = '' . - ''.get_lang(' . - '' . - ''.get_lang(' . - '' . - ''.get_lang(' . - ' '; - $dsp_order .= '' . - ''.get_lang(' . - '
"; -echo "

"; - -/* -============================================================================== - FOOTER -============================================================================== -*/ -Display::display_footer(); -?> + +============================================================================== +*/ +/** + * Script + */ + +if(empty($lp_controller_touched) || $lp_controller_touched!=1){ + header('location: lp_controller.php?action=list'); +} + +require_once('back_compat.inc.php'); +$courseDir = api_get_course_path().'/scorm'; +$baseWordDir = $courseDir; +$display_progress_bar = true; + +require_once('learnpathList.class.php'); +require_once('learnpath.class.php'); +require_once('learnpathItem.class.php'); +//$charset = 'UTF-8'; +//$charset = 'ISO-8859-1'; + +/** + * Display initialisation and security checks + */ +//extra javascript functions for in html head: +$htmlHeadXtra[] = +""; +$nameTools = get_lang(ucfirst(TOOL_LEARNPATH)); +event_access_tool(TOOL_LEARNPATH); + +if (! $is_allowed_in_course) api_not_allowed(); + +/** + * Display + */ +/* Require the search widget and prepare the header with its stuff */ +if (api_get_setting('search_enabled') == 'true') { + require api_get_path(LIBRARY_PATH).'search/search_widget.php'; + search_widget_prepare(&$htmlHeadXtra); +} +Display::display_header($nameTools,"Path"); +//api_display_tool_title($nameTools); + +/* +----------------------------------------------------------- + Introduction section + (editable by course admins) +----------------------------------------------------------- +*/ + +$fck_attribute['Width'] = '100%'; +$fck_attribute['Height'] = '300'; +$fck_attribute['ToolbarSet'] = 'Introduction'; + +// These settings should stay here. +// TODO: Here a calculation mechanism has to be added in order the editor to work +// properly with documents that are not at the root of the repository. +$fck_attribute['Config']['CreateDocumentWebDir'] = api_get_path('WEB_COURSE_PATH').api_get_course_path().'/document/'; +$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/'; +$fck_attribute['Config']['BaseHref'] = api_get_path('WEB_COURSE_PATH').api_get_course_path().'/'; + +Display::display_introduction_section(TOOL_LEARNPATH); + +$fck_attribute = null; // Clearing this global variable immediatelly after it has been used. + +if(api_is_allowed_to_edit()) +{ + + + /*-------------------------------------- + DIALOG BOX SECTION + --------------------------------------*/ + + if (!empty($dialog_box)) + { + Display::display_normal_message($dialog_box); + } + if (api_failure::get_last_failure()) + { + Display::display_normal_message(api_failure::get_last_failure()); + } + + //include('content_makers.inc.php'); + echo '
'; + echo ''. + ''.get_lang('_add_learnpath').
+		' '.get_lang('_add_learnpath'). + '' . + str_repeat(' ',3). + ''.get_lang( '.get_lang("UploadScorm").''; + if (api_get_setting('service_ppt2lp', 'active') == 'true') + { + echo str_repeat(' ',3).''.get_lang( '.get_lang("PowerPointConvert").''; + echo str_repeat(' ',3).''.get_lang( '.get_lang("WordConvert").''; + } + echo '
'; + + +} + +echo ''; +api_is_allowed_to_edit() ? $colspan = 9 : $colspan = 3; + +/* +if ($curDirName) // if the $curDirName is empty, we're in the root point and we can't go to a parent dir +{ + ?> + + + parent +   + + + + + + '; +echo ''."\n" . + '\n"; +if (api_is_allowed_to_edit()) +{ + echo '\n" . + '\n" . + '\n" . + '\n"; +} + +echo "\n"; + +/*-------------------------------------- + DISPLAY SCORM LIST + --------------------------------------*/ +$list = new LearnpathList(api_get_user_id()); +$flat_list = $list->get_flat_list(); +$is_allowed_to_edit = api_is_allowed_to_edit(); +$test_mode = api_get_setting('server_type'); +$max = count($flat_list); +//var_dump($flat_list); +if (is_array($flat_list)) +{ + $counter = 0; + $current = 0; + 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 + continue; + } + $counter++; + 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='' . $name . ''."\n"; + $dsp_line = ''."\n" . + '\n"; + //$dsp_desc=''."\n"; + $dsp_desc = ''; + + $dsp_export = ''; + $dsp_edit = ''; + $dsp_edit_close = ''; + $dsp_delete = ''; + $dsp_visible = ''; + $dsp_default_view = ''; + $dsp_debug = ''; + $dsp_order = ''; + + // Select course theme + if (!empty($platform_theme)) + { + $mystyle=$platform_theme; + } + + if (!empty($user_theme)) + { + $mystyle=$user_theme; + } + + if (!empty($mycoursetheme)) + { + $mystyle=$mycoursetheme; + } + + $lp_theme_css=$mystyle; + + + if($display_progress_bar) + { + $dsp_progress = ''; + } + else + { + $dsp_progress = ''; + } + if($is_allowed_to_edit) + { + $dsp_desc = ''."\n"; + + /* export */ + //export not available for normal lps yet + if($details['lp_type']==1){ + $dsp_export = ''; + + /* DELETE COMMAND */ + $dsp_delete = "" . + "" . + ""; + + /* VISIBILITY COMMAND */ + + if ($details['lp_published'] == "i") + { + $dsp_publish = "" . + "" . + "" . + ""; + } + else + { + $dsp_publish = "" . + "" . + "". + ""; + } + /* VISIBILITY COMMAND */ + + if ($details['lp_visibility'] == 0) + { + $dsp_visible = "" . + "" . + "" . + ""; + } + else + { + $dsp_visible = "" . + "" . + "". + ""; + } + /* Default view mode settings (fullscreen/embedded) */ + if($details['lp_view_mode'] == 'fullscreen'){ + $dsp_default_view = '' . + ''.get_lang(' . + ' '; + }else{ + $dsp_default_view = '' . + ''.get_lang(' . + ' '; + } + /* Increase SCORM recording */ + /* + if($details['lp_force_commit'] == 1){ + $dsp_force_commit = '' . + 'Normal SCORM recordings' . + ' '; + }else{ + $dsp_force_commit = '' . + 'Extra SCORM recordings' . + ' '; + } + */ + if($details['lp_prevent_reinit']==1){ + $dsp_reinit = '' . + 'Allow reinit' . + ' '; + }else{ + $dsp_reinit = '' . + 'Prevent reinit' . + ' '; + } + if($details['lp_type']==1 || $details['lp_type']==2){ + $dsp_build = ' '; + }else{ + $dsp_build = ' '; + } + if($test_mode == 'test' or api_is_platform_admin()) + { + if($details['lp_scorm_debug']==1){ + $dsp_debug = '' . + ''.get_lang(' . + ' '; + }else{ + $dsp_debug = '' . + ''.get_lang(' . + ' '; + } + } + if($details['lp_display_order'] == 1 && $max != 1) + { + $dsp_order .= ''; + } + elseif($current == $max-1 && $max != 1) //last element + { + $dsp_order .= ''; + } + elseif($max == 1) + { + $dsp_order = ''; + } + else + { + $dsp_order .= ''; + } + } // 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_debug.$dsp_delete.$dsp_order; + //echo $dsp_line.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_visible.$dsp_reinit.$dsp_force_commit.$dsp_delete; + echo "\n"; + $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) +echo "
+ open_dir + +
'.get_lang('Name').''.get_lang('Progress')."'.get_lang('Description')."'.get_lang('ExportShort')."'.get_lang('Modify')."'.get_lang('Move')."
' . + '' . $name . '' . + "'.$details['lp_desc'].''.learnpath::get_progress_bar('%',learnpath::get_db_progress($id,api_get_user_id()),'').''.learnpath::get_db_progress($id,api_get_user_id(),'both').''.$details['lp_maker'].'    '.$details['lp_proximity'].'    '.$details['lp_encoding'].'  ' . + "" . + "" . + "" . + ""; + }elseif($details['lp_type']==2){ + $dsp_export = '' . + "" . + "" . + "" . + ""; + }else{ + $dsp_export = '' . + //"" . + "" . + //"" . + ""; + } + /* edit title and description */ + + $dsp_edit = ''; + $dsp_edit_close = '' . + ''.get_lang(' . + '' . + ''.get_lang(' . + '' . + ''.get_lang(' . + ' '; + $dsp_order .= '' . + ''.get_lang(' . + '
"; +echo "

"; + +/* +============================================================================== + FOOTER +============================================================================== +*/ +Display::display_footer(); +?>