slideshowoptions.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @author Patrick Cool
  5. * @package chamilo.document
  6. */
  7. /*
  8. Developped by Patrick Cool
  9. patrick.cool@UGent.be
  10. Ghent University
  11. May 2004
  12. http://icto.UGent.be
  13. Please bear in mind that this is only an beta release.
  14. I wrote this quite quick and didn't think too much about it in advance.
  15. It is not perfect at all but it is workable and usefull (I think)
  16. Do not consider this as a powerpoint replacement, although it has
  17. the same starting point.
  18. */
  19. /*
  20. Description:
  21. This is a plugin for the documents tool. It looks for .jpg, .jpeg, .gif, .png
  22. files (since these are the files that can be viewed in a browser) and creates
  23. a slideshow with it by allowing to go to the next/previous image.
  24. You can also have a quick overview (thumbnail view) of all the images in
  25. that particular folder.
  26. Maybe it is important to notice that each slideshow is folder based. Only
  27. the images of the chosen folder are shown.
  28. On this page the options of the slideshow can be set: maintain the original file
  29. or resize the file to a given width.
  30. */
  31. // Language files that need to be included
  32. $language_file = array('slideshow', 'document');
  33. require_once '../inc/global.inc.php';
  34. $path = Security::remove_XSS($_GET['curdirpath']);
  35. $pathurl = urlencode($path);
  36. // Breadcrumb navigation
  37. $url = 'document.php?curdirpath='.$pathurl;
  38. $originaltoolname = get_lang('Documents');
  39. $interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname);
  40. $url = 'slideshow.php?curdirpath='.$pathurl;
  41. $originaltoolname = get_lang('SlideShow');
  42. $interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname);
  43. // Because $nametools uses $_SERVER['PHP_SELF'] for the breadcrumbs instead of $_SERVER['REQUEST_URI'], I had to
  44. // bypass the $nametools thing and use <b></b> tags in the $interbreadcrump array
  45. $url = 'slideshowoptions.php?curdirpath='.$pathurl;
  46. $originaltoolname = '<b>'.get_lang('_slideshow_options').'</b>';
  47. $interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname );
  48. Display::display_header($originalToolName, 'Doc');
  49. // can't remember why I put this here. This is probably obsolete code
  50. // loading the slides from the session
  51. //$image_files_only = $_SESSION['image_files_only'];
  52. // calculating the current slide, next slide, previous slide and the number of slides
  53. /*if ($slide_id) {
  54. $slide = $slide_id;
  55. } else {
  56. $slide = 0;
  57. }
  58. $previous_slide = $slide - 1;
  59. $next_slide = $slide + 1;
  60. $total_slides = count($image_files_only);
  61. */
  62. ?>
  63. <style type="text/css">
  64. <!--
  65. .disabled_input {
  66. background-color: #cccccc;
  67. }
  68. .enabled_input {
  69. background-color: #ffffff;
  70. }
  71. -->
  72. </style>
  73. <script language="JavaScript" type="text/javascript">
  74. <!--
  75. function enableresizing() { //v2.0
  76. document.options.width.disabled=false;
  77. document.options.width.className='enabled_input';
  78. document.options.height.disabled=false;
  79. document.options.height.className='enabled_input';
  80. }
  81. function disableresizing() { //v2.0
  82. document.options.width.disabled=true;
  83. document.options.width.className='disabled_input';
  84. document.options.height.disabled=true;
  85. document.options.height.className='disabled_input';
  86. }
  87. window.onload = <?php echo $_SESSION['image_resizing'] == 'resizing' ? 'enableresizing' : 'disableresizing'; ?>;
  88. //-->
  89. </script>
  90. <?php
  91. echo '<div class="actions">';
  92. echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png').get_lang('BackTo').' '.get_lang('DocumentsOverview').'</a>';
  93. echo '<a href="slideshow.php?curdirpath='.$pathurl.'">'.Display::return_icon('images_gallery.gif').get_lang('BackTo').' '.get_lang('SlideShow').'</a>';
  94. echo '</div>';
  95. ?>
  96. <form action="slideshow.php?curdirpath=<?php echo $pathurl; ?>" method="post" name="options" id="options">
  97. <div class="row"><div class="form_header"><?php echo get_lang('_slideshow_options') ?></div></div>
  98. <div class="row">
  99. <div class="label">
  100. <input class="checkbox" name="radio_resizing" type="radio" onClick="disableresizing()" value="noresizing" <?php
  101. $image_resizing = $_SESSION['image_resizing'];
  102. if ($image_resizing == 'noresizing' || $image_resizing == '') {
  103. echo ' checked';
  104. }
  105. ?>>
  106. </div>
  107. <div class="formw"><?php echo get_lang('_no_resizing');?><br /><?php echo get_lang('_no_resizing_comment');?>
  108. </div>
  109. </div>
  110. <div class="row">
  111. <div class="label">
  112. <input class="checkbox" name="radio_resizing" type="radio" onClick="javascript: enableresizing();" value="resizing" <?php
  113. $image_resizing = $_SESSION['image_resizing'];
  114. if ($image_resizing == 'resizing') {
  115. echo ' checked';
  116. $width = $_SESSION['image_resizing_width'];
  117. $height = $_SESSION['image_resizing_height'];
  118. }
  119. ?>>
  120. </div>
  121. <div class="formw">
  122. <?php echo get_lang('_resizing'); ?><br /><?php echo get_lang('_resizing_comment'); ?><br />
  123. <?php echo get_lang('_width'); ?>:
  124. &nbsp;<input name="width" type="text" id="width" <?php
  125. if ($image_resizing == 'resizing') {
  126. echo ' value="'.$width.'"';
  127. echo ' class="enabled_input"';
  128. } else {
  129. echo ' class="disabled_input"';
  130. }
  131. ?> >
  132. <br />
  133. <?php echo get_lang('_height');?>:
  134. &nbsp;&nbsp;&nbsp;&nbsp;<input name="height" type="text" id="height" <?php
  135. if ($image_resizing == 'resizing') {
  136. echo ' value="'.$height.'"';
  137. echo ' class="enabled_input"';
  138. } else {
  139. echo ' class="disabled_input"';
  140. }
  141. ?> >
  142. </div>
  143. </div>
  144. <div class="row">
  145. <div class="label">
  146. </div>
  147. <div class="formw">
  148. <br />
  149. <button type="submit" class="save" name="Submit" value="Save" ><?php echo get_lang('Save'); ?></button>
  150. </div>
  151. </div>
  152. </form>
  153. <?php
  154. Display::display_footer();