slideshowoptions.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <?php // $Id: slideshowoptions.php 22565 2009-08-02 21:12:59Z yannoo $
  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. // name of the language file that needs to be included
  54. $language_file = array ('slideshow', 'document');
  55. require_once '../inc/global.inc.php';
  56. $path = Security::remove_XSS($_GET['curdirpath']);
  57. $pathurl = urlencode($path);
  58. // breadcrumb navigation
  59. $url="document.php?curdirpath=".$pathurl;
  60. $originaltoolname=get_lang('Documents');
  61. $interbreadcrumb[]= array ("url"=>$url, "name"=>$originaltoolname );
  62. $url="slideshow.php?curdirpath=".$pathurl;
  63. $originaltoolname=get_lang('SlideShow');
  64. $interbreadcrumb[]= array ("url"=>$url, "name"=>$originaltoolname );
  65. // because $nametools uses $_SERVER['PHP_SELF'] for the breadcrumbs instead of $_SERVER['REQUEST_URI'], I had to
  66. // bypass the $nametools thing and use <b></b> tags in the $interbreadcrump array
  67. $url="slideshowoptions.php?curdirpath=".$pathurl;
  68. $originaltoolname="<b>".get_lang('_slideshow_options')."</b>";
  69. $interbreadcrumb[]= array ("url"=>$url, "name"=>$originaltoolname );
  70. Display::display_header($originalToolName,"Doc");
  71. // can't remember why I put this here. This is probably obsolete code
  72. // loading the slides from the session
  73. //$image_files_only = $_SESSION["image_files_only"];
  74. // calculating the current slide, next slide, previous slide and the number of slides
  75. /*if ($slide_id)
  76. {
  77. $slide=$slide_id;
  78. }
  79. else
  80. {
  81. $slide=0;
  82. }
  83. $previous_slide=$slide-1;
  84. $next_slide=$slide+1;
  85. $total_slides=count($image_files_only);
  86. */
  87. ?>
  88. <style type="text/css">
  89. <!--
  90. .disabled_input {
  91. background-color: #cccccc;
  92. }
  93. .enabled_input {
  94. background-color: #ffffff;
  95. }
  96. -->
  97. </style>
  98. <script language="JavaScript" type="text/JavaScript">
  99. <!--
  100. function enableresizing() { //v2.0
  101. document.options.width.disabled=false;
  102. document.options.width.className='enabled_input';
  103. document.options.height.disabled=false;
  104. document.options.height.className='enabled_input';
  105. }
  106. function disableresizing() { //v2.0
  107. document.options.width.disabled=true;
  108. document.options.width.className='disabled_input';
  109. document.options.height.disabled=true;
  110. document.options.height.className='disabled_input';
  111. }
  112. window.onload = <?php echo $_SESSION['image_resizing'] == 'resizing' ? 'enableresizing' : 'disableresizing'; ?>;
  113. //-->
  114. </script>
  115. <?php
  116. echo '<div class="actions">';
  117. echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png').get_lang('BackTo').' '.get_lang('DocumentsOverview').'</a>';
  118. echo '<a href="slideshow.php?curdirpath='.$pathurl.'">'.Display::return_icon('images_gallery.gif').get_lang('BackTo').' '.get_lang('SlideShow').'</a>';
  119. echo '</div>';
  120. ?>
  121. <form action="slideshow.php?curdirpath=<?php echo $pathurl; ?>" method="post" name="options" id="options">
  122. <div class="row"><div class="form_header"><?php echo get_lang('_slideshow_options') ?></div></div>
  123. <div class="row">
  124. <div class="label">
  125. <input class="checkbox" name="radio_resizing" type="radio" onClick="disableresizing()" value="noresizing"
  126. <?php
  127. $image_resizing=$_SESSION["image_resizing"];
  128. if($image_resizing=="noresizing" or $image_resizing=="")
  129. {
  130. echo " checked";
  131. }
  132. ?>>
  133. </div>
  134. <div class="formw"><?php echo get_lang('_no_resizing');?><br /><?php echo get_lang('_no_resizing_comment');?>
  135. </div>
  136. </div>
  137. <div class="row">
  138. <div class="label">
  139. <input class="checkbox" name="radio_resizing" type="radio" onClick="enableresizing()" value="resizing"
  140. <?php
  141. $image_resizing=$_SESSION["image_resizing"];
  142. if($image_resizing=="resizing")
  143. {
  144. echo " checked";
  145. $width=$_SESSION["image_resizing_width"];
  146. $height=$_SESSION["image_resizing_height"];
  147. }
  148. ?>>
  149. </div>
  150. <div class="formw">
  151. <?php echo get_lang('_resizing');?><br /><?php echo get_lang('_resizing_comment');?><br />
  152. <?php echo get_lang('_width');?>:
  153. &nbsp;<input name="width" type="text" id="width"
  154. <?php
  155. if ($image_resizing=="resizing") {
  156. echo " value='".$width."'";
  157. echo " class=\"enabled_input\"";
  158. } else {
  159. echo " class=\"disabled_input\"";
  160. }
  161. ?> >
  162. <br />
  163. <?php echo get_lang('_height');?>:
  164. &nbsp;&nbsp;&nbsp;&nbsp;<input name="height" type="text" id="height"
  165. <?php
  166. if ($image_resizing=="resizing") {
  167. echo " value='".$height."'";
  168. echo " class=\"enabled_input\"";
  169. } else {
  170. echo " class=\"disabled_input\"";
  171. }
  172. ?> >
  173. </div>
  174. </div>
  175. <div class="row">
  176. <div class="label">
  177. </div>
  178. <div class="formw">
  179. <br />
  180. <button type="submit" class="save" name="Submit" value="Save" ><?php echo get_lang('Save'); ?></button>
  181. </div>
  182. </div>
  183. </form>
  184. <?php
  185. Display::display_footer();