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

Source for file faq.php

Documentation is available at faq.php

  1. <?php
  2. /*
  3. ==============================================================================
  4.     Dokeos - elearning and course management software
  5.  
  6.     Copyright (c) 2004-2008 Dokeos SPRL
  7.     Copyright (c) 2003-2005 Ghent University (UGent)
  8.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9.  
  10.     Copyright (c) Sally "Example" Programmer (sally@somewhere.net)
  11.  
  12.     For a full list of contributors, see "credits.txt".
  13.     The full license can be read in "license.txt".
  14.  
  15.     This program is free software; you can redistribute it and/or
  16.     modify it under the terms of the GNU General Public License
  17.     as published by the Free Software Foundation; either version 2
  18.     of the License, or (at your option) any later version.
  19.  
  20.     See the GNU General Public License for more details.
  21.  
  22.     Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  23.     Mail: info@dokeos.com
  24. ==============================================================================
  25. */
  26. /**
  27. ==============================================================================
  28. *    This script displays a help window.
  29. *
  30. *    @package dokeos.help
  31. ==============================================================================
  32. */
  33. // name of the language file that needs to be included 
  34. $language_file='help';
  35. $helpName=$_GET['open'];
  36. include('../inc/global.inc.php');
  37. include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  38. $language_code Database::get_language_isocode($language_interface);
  39. header('Content-Type: text/html; charset='$charset);
  40. ?>
  41. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  42. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $language_code?>" lang="<?php echo $language_code?>">
  43. <head>
  44. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
  45. <title>
  46. <?php echo get_lang('H'.$helpName)?>
  47. </title>
  48. <style type="text/css" media="screen, projection">
  49. /*<![CDATA[*/
  50. @import "<?php echo api_get_path(WEB_CODE_PATH)?>css/public_admin/default.css";
  51. /*]]>*/
  52. </style>
  53. <?php
  54. if(api_get_setting('stylesheets')<>'')
  55. {
  56.     ?>
  57.     <style type="text/css" media="screen, projection">
  58.     /*<![CDATA[*/
  59.     @import "<?php echo api_get_path(WEB_CODE_PATH)?>css/<?php echo api_get_setting('stylesheets');?>/default.css";
  60.     /*]]>*/
  61.     </style>
  62.     <?php
  63. }
  64. ?>
  65. </head>
  66. <body>
  67. <div style="margin:10px;">
  68. <div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close')?></a></div>
  69. <h4>
  70. <?php 
  71. echo get_lang('Faq')
  72. {
  73.     echo '&nbsp;<a href="faq.php?edit=true"><img src="'.api_get_path(WEB_IMG_PATH).'edit.gif" /></a>';
  74. }
  75. ?>
  76. </h4>
  77. <?php
  78. $faq_file 'faq.html';
  79. if(!empty($_GET['edit']&& $_GET['edit']=='true' && api_is_platform_admin())
  80. {
  81.     $form new FormValidator('set_faq','post','faq.php?edit=true');
  82.     $form -> add_html_editor('faq_content',nullfalse);
  83.     $form -> addElement('submit','faq_submit'get_lang('Ok'));
  84.     $form -> setDefaults(array('faq_content'=>file_get_contents(api_get_path(SYS_PATH).'home/faq.html')));
  85.     if($form -> validate())
  86.     {
  87.         $content $form -> getSubmitValue('faq_content');
  88.         $fpath api_get_path(SYS_PATH).'home/'.$faq_file;
  89.         if(is_file($fpath&& is_writeable($fpath))
  90.         {
  91.             $fp fopen(api_get_path(SYS_PATH).'home/'.$faq_file,'w');
  92.             fwrite($fp$content);
  93.             fclose($fp);
  94.         }
  95.         else
  96.         {
  97.             echo get_lang('WarningFaqFileNonWriteable').'<br />';
  98.         }
  99.         echo $content;
  100.     }
  101.     else
  102.     {
  103.         $form -> display();
  104.     }
  105. }
  106. else
  107. {
  108.     echo file_get_contents(api_get_path(SYS_PATH).'home/'.$faq_file);    
  109. }
  110. ?>
  111. <div style="text-align:right;"><a href="javascript:window.close();"><?php echo get_lang('Close')?></a></div>
  112. </div>
  113. </body>
  114. </html>

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