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

Source for file online_htmlarea.php

Documentation is available at online_htmlarea.php

  1. <?php
  2. /*
  3. ==============================================================================
  4.     Dokeos - elearning and course management software
  5.  
  6.     Copyright (c) 2004 Dokeos S.A.
  7.     Copyright (c) 2003 Ghent University (UGent)
  8.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9.     Copyright (c) Olivier Brouckaert
  10.  
  11.     For a full list of contributors, see "credits.txt".
  12.     The full license can be read in "license.txt".
  13.  
  14.     This program is free software; you can redistribute it and/or
  15.     modify it under the terms of the GNU General Public License
  16.     as published by the Free Software Foundation; either version 2
  17.     of the License, or (at your option) any later version.
  18.  
  19.     See the GNU General Public License for more details.
  20.  
  21.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  22. ==============================================================================
  23. */
  24. /**
  25. ==============================================================================
  26. *    Displays the rich text editor
  27. *
  28. *    @author Olivier Brouckaert
  29. *    @package dokeos.online
  30. ==============================================================================
  31. */
  32.  
  33. define('FRAME','htmlarea');
  34.  
  35. // name of the language file that needs to be included 
  36. $language_file='chat';
  37.  
  38. include('../inc/global.inc.php');
  39. $this_section=SECTION_COURSES;
  40.  
  41.  
  42. $query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
  43. $result=api_sql_query($query,__FILE__,__LINE__);
  44.  
  45. list($pseudoUser)=mysql_fetch_row($result);
  46.  
  47. $isAllowed=(empty($pseudoUser|| !$_cid)?false:true;
  48. $isMaster=$is_courseAdmin?true:false;
  49.  
  50. if(!$isAllowed)
  51. {
  52.     exit();
  53. }
  54.  
  55. $htmlareaURL=api_get_path(WEB_CODE_PATH).'plugin/htmlarea/';
  56. $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
  57. $onlinePath=$documentPath.'online_files/';
  58.  
  59. if(!$htmlarea=@file($onlinePath.'htmlarea.html'))
  60. {
  61.     $htmlarea=array();
  62. }
  63.  
  64. $htmlarea=implode('',$htmlarea);
  65.  
  66. include('header_frame.inc.php');
  67.  
  68. if($isMaster)
  69. {
  70. ?>
  71.  
  72. <form name="formHTMLarea" method="post" action="online_hidden2.php" target="online_hidden2" style="width: 100%; height: 100%;">
  73.  
  74. <?php
  75. api_disp_html_area('editor',$htmlarea,'100%');
  76. ?>
  77.  
  78. </form>
  79.  
  80. <?php
  81. }
  82. else
  83. {
  84.     echo $htmlarea;
  85. }
  86.  
  87. include('footer_frame.inc.php');
  88. ?>

Documentation generated on Thu, 12 Jun 2008 14:08:25 -0500 by phpDocumentor 1.4.1