dokeos
[ class tree: dokeos ] [ index: dokeos ] [ all elements ]

Source for file appshare.php

Documentation is available at appshare.php

  1. <?php
  2. // $Id: infocours.php 10902 2007-01-25 14:44:35Z elixir_julian $
  3. /*
  4. ==============================================================================
  5.     Dokeos - elearning and course management software
  6.  
  7.     Copyright (c) 2004 Dokeos S.A.
  8.     Copyright (c) 2003 Ghent University (UGent)
  9.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  10.     Copyright (c) Hugues Peeters
  11.     Copyright (c) Roan Embrechts (Vrije Universiteit Brussel)
  12.     Copyright (c) Olivier Brouckaert
  13.     Copyright (c) Bart Mollet, Hogeschool Gent
  14.  
  15.     For a full list of contributors, see "credits.txt".
  16.     The full license can be read in "license.txt".
  17.  
  18.     This program is free software; you can redistribute it and/or
  19.     modify it under the terms of the GNU General Public License
  20.     as published by the Free Software Foundation; either version 2
  21.     of the License, or (at your option) any later version.
  22.  
  23.     See the GNU General Public License for more details.
  24.  
  25.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  26. ==============================================================================
  27.  
  28.  
  29. ==============================================================================
  30.        INIT SECTION
  31. ==============================================================================
  32. */
  33. // name of the language file that needs to be included
  34. $language_file array ('create_course''course_info');
  35. include ('../inc/global.inc.php');
  36. $this_section SECTION_COURSES;
  37.  
  38. $nameTools get_lang("ModifInfo");
  39.  
  40. $course_code $_course["sysCode"];
  41.  
  42. // WARNING : try to use GARBAGE_PATH ? but no WEB_GARBAGE ? (api_get_path)
  43. $app_share_tmp_dir_base api_get_path(SYS_CODE_PATH).'garbage/app_share/';
  44. mkdir ($app_share_tmp_dir_base0700)
  45. $app_share_tmp_dir $app_share_tmp_dir_base.$course_code;
  46. $app_base_file api_get_path(SYS_CODE_PATH).'app_share/DokeosAppShare.exe';
  47. $app_share_app_file $app_share_tmp_dir.'/DokeosAppShare.exe';
  48.  
  49. $specialCode='';
  50. if (file_exists($app_share_app_file== FALSE{
  51.     
  52.     mkdir ($app_share_tmp_dir0700);
  53.     
  54.     if (file_exists($app_base_file== FALSE{
  55.         echo('FATAL ERROR: file <b>'.$app_base_file.'</b> not found.<br />');
  56.     else {
  57.         $source fopen($app_base_file"r");
  58.         $target fopen($app_share_app_file"a" );
  59.         
  60.         $specialCode rand(100000,999999).time().rand(100000,999999);
  61.         $contents fread ($sourcefilesize ($app_base_file));
  62.         fwrite ($target$contentsfilesize ($app_base_file));
  63.         fwrite ($target$specialCodefilesize ($app_base_file));
  64.         fclose($source);
  65.         fclose($target);
  66.     }
  67.     
  68. else {
  69.     $source fopen($app_share_app_file"r" );
  70.     fread ($sourcefilesize ($app_base_file))// skip binary content
  71.     $serverID fread ($sourcefilesize($app_share_app_file)-filesize ($app_base_file));
  72.     fclose($source);
  73. }
  74.  
  75. if ($_GET["client"== 'true'{
  76.     ?>
  77.     <HTML>
  78.   <HEAD><TITLE> [test viewApplet appShare] </TITLE></HEAD>
  79.   <BODY>
  80.   <SPAN style='position: absolute; top:0px;left:0px'>
  81. <OBJECT style="width: 100%; height: 100%"
  82.     ID='DokeosSharing'
  83.     classid = 'clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'
  84.     codebase = 'http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0'
  85.     WIDTH = 1000 HEIGHT = 700 >
  86.     <PARAM NAME = CODE VALUE = VncViewer.class >
  87.     <PARAM NAME = ARCHIVE VALUE = VncViewer.jar >
  88.     <PARAM NAME = 'type' VALUE = 'application/x-java-applet;version=1.4'>
  89.     <PARAM NAME = 'scriptable' VALUE = 'false'>
  90.     <PARAM NAME = PORT VALUE=443>
  91.     <PARAM NAME = 'HOST' VALUE='dokeos.noctis.be'>
  92.     <PARAM NAME = 'SERVERID' VALUE='<?php echo($serverID);?>'>
  93.     <PARAM NAME = ENCODING VALUE=Tight>
  94.     <PARAM NAME = 'Open New Window' VALUE='Yes'>
  95.     <COMMENT>
  96.     <EMBED 
  97.             type = 'application/x-java-applet;version=1.4' \
  98.             CODE = VncViewer.class \
  99.             ARCHIVE = VncViewer.jar \
  100.             WIDTH = 1000 \
  101.             HEIGHT = 700 \
  102.             PORT = 443 \
  103.             SERVERID = '<?php echo($serverID);?>' \
  104.             ENCODING =Tight \
  105.         scriptable = false \
  106.         pluginspage ='http://java.sun.com/products/plugin/index.html#download'>
  107.         <NOEMBED>
  108.             </NOEMBED>
  109.     </EMBED>
  110.     </COMMENT>
  111. </OBJECT>
  112.   </SPAN>
  113.   </BODY>
  114. </HTML>
  115.     <?php
  116. else {
  117.  
  118.     // WARNING : try to use GARBAGE_PATH ? but no WEB_GARBAGE ? (api_get_path) 
  119.     $linkToFile api_get_path(WEB_PATH).'main/garbage/app_share/'.$course_code.'/DokeosAppShare.exe';
  120. ?>
  121.      <h3>prérequis pour DokeosAppShare :</h3>
  122.      <ul>
  123.       <li>Microsoft .NET : <a target="top" href="http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en">install</a></li>
  124.       <li style="margin-top: 5px;">Visual J# Redistributable Packages : <a target="top" href="http://msdn2.microsoft.com/en-us/vjsharp/bb188598.aspx">install</a></li>
  125.      </ul>
  126.      <form style="float: left;" id="view_screen" action="<?php echo($linkToFile);?>">
  127.      <input style="width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="Partager mon écran" />
  128.       </form>
  129. <?php
  130. }?>
  131.      <form style="float: left;" id="view_screen" action="">
  132.       <input type="hidden" name="client" value="true" />
  133.       <input style="margin-left: 20px; width: 220px; font-size: 14px; font-weight: bold;" type="submit" value="Visualiser l'écran partagé" />
  134.      </form><?php
  135. }?>

Documentation generated on Thu, 12 Jun 2008 12:59:13 -0500 by phpDocumentor 1.4.1