123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- <?php
- $language_file = "slideshow";
- include ('../inc/global.inc.php');
- $noPHP_SELF = true;
- $path = $_GET['curdirpath'];
- $pathurl = urlencode($path);
- $slide_id = $_GET['slide_id'];
- if ($path and $path <> "")
- {
- $folder = $path."/";
- }
- else
- {
- $folder = "";
- }
- $sys_course_path = api_get_path(SYS_COURSE_PATH);
- include ('slideshow.inc.php');
- $url = "document.php?curdirpath=".$pathurl;
- $originaltoolname = get_lang('Documents');
- $interbreadcrumb[] = array ("url" => $url, "name" => $originaltoolname);
- $url = "slideshow.php?curdirpath=".$pathurl;
- $originaltoolname = get_lang('SlideShow');
- Display :: display_header($originaltoolname, "Doc");
- $image_files_only = $_SESSION["image_files_only"];
- if ($slide_id <> "all")
- {
- if ($slide_id)
- {
- $slide = $slide_id;
- }
- else
- {
- $slide = 0;
- }
- $previous_slide = $slide -1;
- $next_slide = $slide +1;
- }
- $total_slides = count($image_files_only);
- ?>
- <script language="JavaScript" type="text/JavaScript">
- <!--
- function MM_openBrWindow(theURL,winName,features) {
- window.open(theURL,winName,features);
- }
- </script>
- <p></p>
- <h3 style="margin-top: 0; margin-bottom: 0"><?php echo get_lang('SlideShow'); ?></h3>
- <table width="100%" border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td>
- <?php
- if ($slide > 0)
- {
- echo "<a href='slideshow.php?slide_id=".$previous_slide."&curdirpath=$pathurl'>";
- }
- ?>
- <strong><< <?php echo get_lang('_previous_slide'); ?></strong> <?php
- if ($slide > 0)
- {
- echo "</a>";
- }
- ?>
- |
- <?php
- if ($slide < $total_slides -1 and $slide_id <> "all")
- {
- echo "<a href='slideshow.php?slide_id=".$next_slide."&curdirpath=$pathurl'>";
- }
- ?>
- <strong><?php echo get_lang('_next_slide'); ?> >></strong>
- <?php
- if ($slide > 0)
- {
- echo "</a>";
- }
- ?>
- </td>
- <td>
- <?php
- if ($slide_id <> "all")
- {
- echo get_lang('_image')." ".$next_slide." ".get_lang('_of')." ".$total_slides;
- }
- ?>
- </td>
- <td align="right"><a href="document.php?action=exit_slideshow&curdirpath=<?php echo $pathurl;?>"><?php echo get_lang('_exit_slideshow');?></a> </td>
- </tr>
- <tr>
- <td>
- <?php
- if ($slide_id <> "all")
- {
- echo "<a href='slideshow.php?slide_id=all&curdirpath=".$pathurl."'>".get_lang('_show_thumbnails')."</a>";
- }
- else
- {
- echo get_lang('_click_thumbnails');
- }
- $image = $sys_course_path.$_course['path']."/document/".$folder.$image_files_only[$slide];
- ?>
- </td>
- <td><?php echo htmlspecialchars($image_files_only[$slide]) ?></td>
- <td align="right"><a href="slideshowoptions.php?curdirpath=<?php echo $pathurl; ?>"><?php echo get_lang('_set_slideshow_options');?></a></td>
- </tr>
- </table>
- <?php
- if (isset ($_POST['Submit']))
- {
- $_SESSION["image_resizing"] = $_POST['radio_resizing'];
- if ($_POST['radio_resizing'] == "resizing" && $_POST['width'] != '' && $_POST['height'] != '')
- {
-
- $_SESSION["image_resizing_width"] = $_POST['width'];
- $_SESSION["image_resizing_height"] = $_POST['height'];
- }
- else
- {
-
- $_SESSION["image_resizing_width"] = null;
- $_SESSION["image_resizing_height"] = null;
- }
- }
- if ($_SESSION["image_resizing"] == "resizing")
- {
- $target_width = $_SESSION["image_resizing_width"];
- $target_height = $_SESSION["image_resizing_height"];
- }
- else
- {
- $image_width = $source_width;
- $image_height = $source_height;
- }
- $image_tag = array ();
- if ($slide_id == "all")
- {
- $thumbnail_width = 100;
- $thumbnail_height = 100;
- $row_items = 4;
- foreach ($image_files_only as $one_image_file)
- {
- $image = $sys_course_path.$_course['path']."/document/".$folder.$one_image_file;
- $image_height_width = resize_image($image, $thumbnail_width, $thumbnail_height, 1);
- $image_height = $image_height_width[0];
- $image_width = $image_height_width[1];
- if ($path and $path !== "/")
- {
- $doc_url = $path."/".$one_image_file;
- }
- else
- {
- $doc_url = $path.$one_image_file;
- }
- $image_tag[] = "<img src='download.php?doc_url=".$doc_url."' border='0' width='".$image_width."' height='".$image_height."'>";
- }
- }
- echo "\n<table align='center'>";
- $i = 0;
- foreach ($image_tag as $image_tag_item)
- {
-
- if ($i == 0)
- {
- echo "\n<tr>\n";
- }
- echo "\t<td><a href='slideshow.php?slide_id=".$i."&curdirpath=".$pathurl."'>".$image_tag_item."</a></td>\n";
- if ($i % 3 == 0 and $i !== 0)
- {
- echo "</tr>\n<tr>\n";
- }
- $i ++;
- }
- echo "</table>\n\n";
- if ($slide_id !== "all")
- {
- $image = $sys_course_path.$_course['path']."/document/".$folder.$image_files_only[$slide];
- $image_height_width = resize_image($image, $target_width, $target_height);
- $image_height = $image_height_width[0];
- $image_width = $image_height_width[1];
- if ($_SESSION["image_resizing"] == "resizing")
- {
- $height_width_tags = "width='$image_width' height='$image_height'";
- }
-
-
- $tbl_documents = Database::get_course_table(TABLE_DOCUMENT);
- if ($path=='/')
- {
- $pathpart='/';
- }
- else
- {
- $pathpart=$path.'/';
- }
- $sql = "SELECT * FROM $tbl_documents WHERE path='".$pathpart.$image_files_only[$slide]."'";
- $result = api_sql_query($sql,__FILE__,__LINE__);
- $row = mysql_fetch_array($result);
- echo $row['comment'];
- echo "<center><img src='download.php?doc_url=$path/".$image_files_only[$slide]."' border='0' $height_width_tags></center>";
- }
- Display :: display_footer();
- ?>
|