diff --git a/main/css/public_admin/images/bar_1.gif b/main/css/public_admin/images/bar_1.gif index 48e9556050..938ae0c354 100755 Binary files a/main/css/public_admin/images/bar_1.gif and b/main/css/public_admin/images/bar_1.gif differ diff --git a/main/css/public_admin/images/bar_1m.gif b/main/css/public_admin/images/bar_1m.gif index 3e4591771f..1358076550 100755 Binary files a/main/css/public_admin/images/bar_1m.gif and b/main/css/public_admin/images/bar_1m.gif differ diff --git a/main/css/public_admin/images/bar_1r.gif b/main/css/public_admin/images/bar_1r.gif index 91a679a6a2..3bfc397e10 100755 Binary files a/main/css/public_admin/images/bar_1r.gif and b/main/css/public_admin/images/bar_1r.gif differ diff --git a/main/css/public_admin/images/bar_1u.gif b/main/css/public_admin/images/bar_1u.gif index 815776fdee..b0a50cd4e8 100755 Binary files a/main/css/public_admin/images/bar_1u.gif and b/main/css/public_admin/images/bar_1u.gif differ diff --git a/main/css/public_admin/scorm.css b/main/css/public_admin/scorm.css index 1db98e0af4..bd7eba0515 100644 --- a/main/css/public_admin/scorm.css +++ b/main/css/public_admin/scorm.css @@ -178,9 +178,9 @@ clear: both; } -#preview_image -{ - text-align:center; +#author_name +{ + padding-left: 17px; } #msg_div_id{ diff --git a/main/img/lp_arrow.gif b/main/img/lp_arrow.gif new file mode 100644 index 0000000000..95f77cf05b Binary files /dev/null and b/main/img/lp_arrow.gif differ diff --git a/main/img/lp_author_background.gif b/main/img/lp_author_background.gif new file mode 100644 index 0000000000..b9b650cf90 Binary files /dev/null and b/main/img/lp_author_background.gif differ diff --git a/main/img/unknown_250_100.jpg b/main/img/unknown_250_100.jpg new file mode 100644 index 0000000000..335c9a146d Binary files /dev/null and b/main/img/unknown_250_100.jpg differ diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 993f9f8419..ffb6415b86 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -1963,7 +1963,7 @@ class learnpath { $text = $percentage.$text_add; //Default progress bar config - $factor=1.5; + $factor=1.4; if ($from_lp) $progress_height='25'; else @@ -8489,7 +8489,7 @@ EOD; } /** - * Uploads a new image to the learning path image upload directory + * Uploads an author image to the upload/learning_path/images directory * @param array The image array, coming from the $_FILES superglobal * @return boolean True on success, false on error */ @@ -8512,14 +8512,16 @@ EOD; { $courseDir = api_get_course_path().'/upload/learning_path/images'; $sys_course_path = api_get_path(SYS_COURSE_PATH); - $updir = $sys_course_path.$courseDir; - + $updir = $sys_course_path.$courseDir; // Try to add an extension to the file if it hasn't one $new_file_name = add_ext_on_mime(stripslashes($image_array['name']), $image_array['type']); - // user's file name - $file_name =$image_array['name']; + + + + + if (!filter_extension($new_file_name)) { //Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension')); @@ -8531,14 +8533,50 @@ EOD; $file_extension = strtolower($file_extension[sizeof($file_extension) - 1]); $new_file_name = uniqid('').'.'.$file_extension; $new_path=$updir.'/'.$new_file_name; - $result= @move_uploaded_file($image_array['tmp_name'], $new_path); + + //$result= @move_uploaded_file($image_array['tmp_name'], $new_path); + + // resize the image + include_once (api_get_path(LIBRARY_PATH).'image.lib.php'); + $temp = new image($image_array['tmp_name']); + $picture_infos=getimagesize($image_array['tmp_name']); // $picture_infos[0]-> width + if ($picture_infos[0]>240) + $thumbwidth=240; + else + $thumbwidth=$picture_infos[0]; + + if ($picture_infos[1]>100) + $new_height=100; + else + $new_height = $picture_infos[1]; + + + //$new_height = round(($thumbwidth/$picture_infos[0])*$picture_infos[1]); + + $temp->resize($thumbwidth,$new_height,0); + $type=$picture_infos[2]; + + switch ($type) { + case 2 : $temp->send_image('JPG',$new_path); + break; + case 3 : $temp->send_image('PNG',$new_path); + break; + case 1 : $temp->send_image('GIF',$new_path); + break; + } + + + + // Storing the attachments if any - if ($result) + if (1) { $image_moved=true; $this->set_preview_image($new_file_name); - return true; - } + //return true; + } + + } } } diff --git a/main/newscorm/lp_author_image.php b/main/newscorm/lp_author_image.php index 18240c887d..ed8faf9051 100644 --- a/main/newscorm/lp_author_image.php +++ b/main/newscorm/lp_author_image.php @@ -32,13 +32,26 @@ include_once('../inc/reduced_header.inc.php'); echo ' '; -echo '
'; -if ($_SESSION['oLP']->get_preview_image()!='') - echo ''.$_SESSION['oLP']->get_author().''; -else - echo Display::display_icon('unknown.jpg',$_SESSION['oLP']->get_author()); -echo '
'; - + $image = '../img/lp_author_background.gif'; + echo '
'; + echo ''; + echo ''; + echo '
'; + + if ($_SESSION['oLP']->get_preview_image()!='') + echo ''.$_SESSION['oLP']->get_author().''; + else + echo Display::display_icon('unknown_250_110.jpg',$_SESSION['oLP']->get_author()); + + + echo '
'; + + + echo '
'; + + echo $_SESSION['oLP']->get_author(); + echo '
'; + ?> \ No newline at end of file diff --git a/main/newscorm/lp_edit.php b/main/newscorm/lp_edit.php index 03ba33e6ea..370f7cdf74 100644 --- a/main/newscorm/lp_edit.php +++ b/main/newscorm/lp_edit.php @@ -96,13 +96,20 @@ if( strlen($_SESSION['oLP']->get_preview_image() ) > 0) '.$show_preview_image.' '; - $form->addElement('html', $div .'
'); $form->addElement('checkbox', 'remove_picture', null, get_lang('DelImage')); + } $form->addElement('file', 'lp_preview_image', ($_SESSION['oLP']->get_preview_image() != '' ? get_lang('UpdateImage') : get_lang('AddImage'))); + $div = '
+
+
'.get_lang('ImageWillResizeMsg').' +
+
'; +$form->addElement('html', $div); + $form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'mimetype', array('image/gif', 'image/jpeg', 'image/png')); diff --git a/main/newscorm/lp_header.php b/main/newscorm/lp_header.php index 50f9a3f720..b865823d66 100644 --- a/main/newscorm/lp_header.php +++ b/main/newscorm/lp_header.php @@ -59,8 +59,14 @@ $interbreadcrumb[] = array("url"=>"./lp_controller.php?action=view&lp_id=".$path $noPHP_SELF = true; $lp_theme_css=$_SESSION['oLP']->get_theme(); include('../inc/reduced_header.inc.php'); -echo '
'; +echo '
'; +echo '
'; +echo ''; +echo ''; +echo ''; +echo ''; echo ''.get_lang('CourseHomepageLink').''; +echo '
'; echo ''; ?> diff --git a/main/newscorm/lp_nav.php b/main/newscorm/lp_nav.php index 5f2876f891..c40ec168d6 100644 --- a/main/newscorm/lp_nav.php +++ b/main/newscorm/lp_nav.php @@ -58,7 +58,7 @@ if(isset($_SESSION['lpobject'])) $lp_theme_css=$my_style; } - //$progress_bar = $_SESSION['oLP']->get_progress_bar(); + //$progress_bar = $_SESSION['oLP']->get_progress_bar(); $progress_bar = $_SESSION['oLP']->get_progress_bar('',-1,'',true); $navigation_bar = $_SESSION['oLP']->get_navigation_bar(); } diff --git a/main/newscorm/lp_view.php b/main/newscorm/lp_view.php index 4fe5e28dc1..c76ae54b72 100644 --- a/main/newscorm/lp_view.php +++ b/main/newscorm/lp_view.php @@ -183,7 +183,7 @@ else ?> - +