slideshowoptions.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <?php // $Id: slideshowoptions.php 9246 2006-09-25 13:24:53Z bmol $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) 2003 Ghent University (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. For a full list of contributors, see "credits.txt".
  9. The full license can be read in "license.txt".
  10. This program is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU General Public License
  12. as published by the Free Software Foundation; either version 2
  13. of the License, or (at your option) any later version.
  14. See the GNU General Public License for more details.
  15. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  16. ==============================================================================
  17. */
  18. /**
  19. ==============================================================================
  20. * @author Patrick Cool
  21. * @package dokeos.document
  22. ==============================================================================
  23. */
  24. /*
  25. ==============================================================================
  26. Developped by Patrick Cool
  27. patrick.cool@UGent.be
  28. Ghent University
  29. May 2004
  30. http://icto.UGent.be
  31. Please bear in mind that this is only an beta release.
  32. I wrote this quite quick and didn't think too much about it in advance.
  33. It is not perfect at all but it is workable and usefull (I think)
  34. Do not consider this as a powerpoint replacement, although it has
  35. the same starting point.
  36. ==============================================================================
  37. */
  38. /*
  39. ==============================================================================
  40. Description:
  41. This is a plugin for the documents tool. It looks for .jpg, .jpeg, .gif, .png
  42. files (since these are the files that can be viewed in a browser) and creates
  43. a slideshow with it by allowing to go to the next/previous image.
  44. You can also have a quick overview (thumbnail view) of all the images in
  45. that particular folder.
  46. Maybe it is important to notice that each slideshow is folder based. Only
  47. the images of the chosen folder are shown.
  48. On this page the options of the slideshow can be set: maintain the original file
  49. or resize the file to a given width.
  50. ==============================================================================
  51. */
  52. // including the language file
  53. $langFile = "slideshow";
  54. include('../inc/global.inc.php');
  55. $path = $_GET['curdirpath'];
  56. $pathurl = urlencode($path);
  57. // breadcrumb navigation
  58. $url="document.php?curdirpath=".$pathurl;
  59. $originaltoolname=get_lang('Documents');
  60. $interbreadcrumb[]= array ("url"=>$url, "name"=>$originaltoolname );
  61. $url="slideshow.php?curdirpath=".$pathurl;
  62. $originaltoolname=get_lang('lang_slideshow');
  63. $interbreadcrumb[]= array ("url"=>$url, "name"=>$originaltoolname );
  64. // because $nametools uses $_SERVER['PHP_SELF'] for the breadcrumbs instead of $_SERVER['REQUEST_URI'], I had to
  65. // bypass the $nametools thing and use <b></b> tags in the $interbreadcrump array
  66. $url="slideshowoptions.php?curdirpath=".$pathurl;
  67. $originaltoolname="<b>".get_lang('_slideshow_options')."</b>";
  68. $interbreadcrumb[]= array ("url"=>$url, "name"=>$originaltoolname );
  69. Display::display_header($originalToolName,"Doc");
  70. // can't remember why I put this here. This is probably obsolete code
  71. // loading the slides from the session
  72. //$image_files_only = $_SESSION["image_files_only"];
  73. // calculating the current slide, next slide, previous slide and the number of slides
  74. /*if ($slide_id)
  75. {
  76. $slide=$slide_id;
  77. }
  78. else
  79. {
  80. $slide=0;
  81. }
  82. $previous_slide=$slide-1;
  83. $next_slide=$slide+1;
  84. $total_slides=count($image_files_only);
  85. */
  86. ?>
  87. <style type="text/css">
  88. <!--
  89. .disabled_input {
  90. background-color: #cccccc;
  91. }
  92. .enabled_input {
  93. background-color: #ffffff;
  94. }
  95. -->
  96. </style>
  97. <script language="JavaScript" type="text/JavaScript">
  98. <!--
  99. function enableresizing() { //v2.0
  100. document.options.width.disabled=false;
  101. document.options.width.className='enabled_input';
  102. document.options.height.disabled=false;
  103. document.options.height.className='enabled_input';
  104. }
  105. function disableresizing() { //v2.0
  106. document.options.width.disabled=true;
  107. document.options.width.className='disabled_input';
  108. document.options.height.disabled=true;
  109. document.options.height.className='disabled_input';
  110. }
  111. //-->
  112. </script>
  113. <p></p>
  114. <h2 style="margin-top: 0; margin-bottom: 0"><?php echo get_lang('_slideshow_options'); ?></h2>
  115. <form action="slideshow.php?curdirpath=<?php echo $pathurl; ?>" method="post" name="options" id="options">
  116. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  117. <tr>
  118. <td valign="top"><input class="checkbox" name="radio_resizing" type="radio" onClick="disableresizing()" value="noresizing"
  119. <?php
  120. $image_resizing=$_SESSION["image_resizing"];
  121. if($image_resizing=="noresizing" or $image_resizing=="")
  122. {
  123. echo " checked";
  124. }
  125. ?>
  126. ></td>
  127. <td><?php echo get_lang('_no_resizing');?><br><?php echo get_lang('_no_resizing_comment');?>
  128. </td>
  129. </tr>
  130. <tr>
  131. <td valign="top"><input class="checkbox" name="radio_resizing" type="radio" onClick="enableresizing()" value="resizing"
  132. <?php
  133. $image_resizing=$_SESSION["image_resizing"];
  134. if($image_resizing=="resizing")
  135. {
  136. echo " checked";
  137. $width=$_SESSION["image_resizing_width"];
  138. $height=$_SESSION["image_resizing_height"];
  139. }
  140. ?>></td>
  141. <td><?php echo get_lang('_resizing');?><br><?php echo get_lang('_resizing_comment');?><br>
  142. <?php echo get_lang('_width');?>:
  143. <input name="width" type="text" id="width"
  144. <?php
  145. if ($image_resizing=="resizing")
  146. {
  147. echo " value='".$width."'";
  148. echo " class=\"enabled_input\"";
  149. }
  150. else
  151. {echo " class=\"disabled_input\""; }
  152. ?>>
  153. <br>
  154. <?php echo get_lang('_height');?>:
  155. <input name="height" type="text" id="height"
  156. <?php
  157. if ($image_resizing=="resizing")
  158. {
  159. echo " value='".$height."'";
  160. echo " class=\"enabled_input\"";
  161. }
  162. else
  163. {echo " class=\"disabled_input\""; }
  164. ?>
  165. ></td>
  166. </tr>
  167. <tr>
  168. <td valign="top">&nbsp;</td>
  169. <td><input type="submit" name="Submit" value="<?php echo get_lang('Ok'); ?>"></td>
  170. </tr>
  171. </table>
  172. </form>
  173. <?php
  174. Display::display_footer();
  175. ?>