myconfig.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <?php
  2. /*
  3. * Chamilo LMS
  4. *
  5. * Copyright (c) 2009-2010 Juan Carlos Raña
  6. * Copyright (c) 2009-2010 Ivan Tcholakov
  7. * Copyright (c) 2009 Dokeos SPRL
  8. *
  9. * For a full list of contributors, see "credits.txt".
  10. * The full license can be read in "license.txt".
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License
  14. * as published by the Free Software Foundation; either version 2
  15. * of the License, or (at your option) any later version.
  16. *
  17. * See the GNU General Public License for more details.
  18. */
  19. /*
  20. * Custom editor configuration settings, php-side.
  21. * See http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
  22. *
  23. * Configuration data for the editor comes from different sources which are prioritised.
  24. *
  25. * 1-st level (the highest priority)
  26. * "Hardcoded" options by developers. 'Width' and 'Height' are exception of this rule.
  27. *
  28. * 2-nd level
  29. * Configuration settings from myconfig.php (this file).
  30. *
  31. * 3-rd level
  32. * Default configuration settings that are determined (calculated) by the system..
  33. *
  34. * 4-th level
  35. * Configuration settings from myconfig.js. This file may be modified for customization purposes too.
  36. * You may choose to create there options or to transfer options from here (not all) which have low probability of future changes.
  37. * Thus, you will gain performance by exploiting caching, but changes in myconfig.js do not enforce immediatelly.
  38. * Here is the mapping rule:
  39. *
  40. * myconfig.php myconfig.js
  41. * ---------------------------------------------------------------------------------------------
  42. * $config['FontFormats'] = 'p;h1;h2;h3;h4;h5'; FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5';
  43. *
  44. * 5-th level (the lowest priority)
  45. * Configuration settings from myconfig.js. This file is "as is" in the original source, modifying it is not recommended.
  46. */
  47. /*
  48. * Toolbar definitions.
  49. */
  50. // The following setting is the directory where the online editor's toobar definitions reside in correspondent php-files.
  51. // By default, the directory name is 'default' and it has been created at .../chamilo/main/inc/lib/fckeditor/toolbars/ .
  52. // For using your customized toolbars, crate another directory, for example 'custom' at the same path, i.e.
  53. // create .../chamilo/main/inc/lib/fckeditor/toolbars/custom/ . Then, copy the original php-definition files
  54. // from .../chamilo/main/inc/lib/fckeditor/toolbars/default/ to the new one. Change the following configuration setting, so it to
  55. // point to the new directory:
  56. // $config['ToolbarSets']['Directory'] = 'custom';
  57. // Then, you may modify the newly copied toolbar definitions at your will, just keep correct php-syntax.
  58. // It is not mandatory you to create custom files for all the toolbars. In case of missing file in the directory with the
  59. // custom toobar definitions the system would read the correspondent "factory" toolbar definition (form 'default' directory).
  60. // This is the visible toolbar set when the editor is maximized.
  61. // If it has not been defined, then the toolbar set for the "normal" size is used.
  62. // if do you prefer configure for each toolbar edit main/inc/lib/fckeditor/toolbars/
  63. if ((api_get_setting('more_buttons_maximized_mode') == 'true'))
  64. {
  65. $config['ToolbarSets']['Directory'] = 'extended';
  66. }
  67. else
  68. {
  69. $config['ToolbarSets']['Directory'] = 'default';
  70. }
  71. /*
  72. * Plugins.
  73. */
  74. // customizations : This plugin has been developed by the Chamilo team for editor's integration within the system.
  75. // The plugin should be loaded first, before all other plugins. Please, do not disable it.
  76. $config['LoadPlugin'][] = 'customizations';
  77. // dragresizetable & tablecommands : Plugins for improvement table-related operations.
  78. if (trim(get_lang('text_dir', '')) != 'rtl') {
  79. // This plugin works properly only when language writting system is "from left to right (ltr)".
  80. $config['LoadPlugin'][] = 'dragresizetable';
  81. }
  82. $config['LoadPlugin'][] = 'tablecommands';
  83. // prompt : This plugin is a dialog implementation as a replacemet of the javascript function prompt().
  84. // It provides consistent appearance and avoiding activation of browser's blocking features.
  85. $config['LoadPlugin'][] = 'prompt';
  86. // audio: Adds a dialog for inserting audio files (.mp3).
  87. $config['LoadPlugin'][] = 'audio';
  88. // glossary: this plugin add a term from glossary tool in Chamilo.
  89. if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
  90. $config['LoadPlugin'][] = 'glossary';
  91. }
  92. // MP3: This is the old plugin for inserting audio files.
  93. // If you wish to use it, disable the "audio" plugin first.
  94. //$config['LoadPlugin'][] = 'MP3';
  95. // ImageManager : Adds a dialog (image gallery) for inserting images. The advanced file manager has its own functionality
  96. // for previewing images. This is why we load this plugin only in case when the simple file manager is used.
  97. if (!(api_get_setting('advanced_filemanager') == 'true')) {
  98. $config['LoadPlugin'][] = 'ImageManager';
  99. // The following setting defines how the simple file manager to be opened:
  100. // true - in a new browser window, or
  101. // false - as a dialog whithin the page (recommended).
  102. $config['OpenImageManagerInANewWindow'] = false;
  103. }
  104. // fckEmbedMovies : Adds a dilog for inserting video files.
  105. $config['LoadPlugin'][] = 'fckEmbedMovies';
  106. // flvPlayer : Adds a dilog for inserting video files (.flv, .mp4), so they to be viewed through a flash-based player.
  107. $config['LoadPlugin'][] = 'flvPlayer';
  108. // youtube : Adds a dilog for inserting YouTube video-streams.
  109. if ((api_get_setting('youtube_for_students') == 'true')) {
  110. $config['LoadPlugin'][] = 'youtube';
  111. }
  112. else{
  113. if (api_is_allowed_to_edit() || api_is_platform_admin()) { // (not for students)
  114. $config['LoadPlugin'][] = 'youtube';
  115. }
  116. }
  117. // googlemaps : Adds a dilog for inserting Google maps.
  118. $config['LoadPlugin'][] = 'googlemaps';
  119. // API-key for the "googlemaps" plugin.
  120. // The following key is valid for http://localhost (see myconfig.js where this key has been activated by default).
  121. // You must get a new for each server where you intend to use the plugin 'googlemaps'. Just get the key for free after
  122. // agreeing with the Terms of Use of the GoogleMaps API from here: http://www.google.com/apis/maps/signup.html.
  123. // At you choice, you may activate the newly obtained API-key using the following setting or using the same setting in myconfig.js.
  124. // Activated here API-key is not cached by browsers and overrides the key from the configuration file myconfig.js.
  125. //$config['GoogleMaps_Key'] = 'ABQIAAAAlXu5Pw6DFAUgqM2wQn01gxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSy5hTGQdsosYD3dz6faZHVrO-02A';
  126. // mimetex : Adds a dilog for inserting mathematical formulas. In order this plugin to work prpoperly, preliminary changes
  127. // in your server configuration have to be done. The MimeTex executable file has to be installed, see the installation guide.
  128. //
  129. if ((api_get_setting('math_mimetex') == 'true')) {
  130. $config['LoadPlugin'][] = 'mimetex';
  131. }
  132. //
  133. // Some additional settings become active only when the 'mimetex' plugin has been enabled:
  134. //
  135. // The following setting determines whether MimeTeX executable file has been installed on the server or not. This file should be accessible
  136. // for browsers at address http://mysite.com/cgi-bin/mimetex.cgi (Linux) or at address http://mysite.com/cgi-bin/mimetex.exe (Windows).
  137. // How to test manually: Open your browser and enter in the address bar something like http://mysite.com/cgi-bin/mimetex.cgi?hello
  138. // By default, the system tries to detect the MimeTeX executable file automatically.
  139. // If you are sure that the MimeTeX executable has been correctly installed, you may set this option to boolean true value.
  140. $config['MimetexExecutableInstalled'] = 'detect'; // 'detect' (default), true, false
  141. // Sometimes detection fails (due to slow DNS service, security restrictions, ...). For better probability of success,
  142. // the following methods for detection have been defined:
  143. // 'bootstrap_ip' - detection is tried at address like http://127.0.0.1/cgi-bin/mimetex.cgi
  144. // 'localhost' - detection is tried at address like http://localhost/cgi-bin/mimetex.cgi
  145. // 'ip' - detection is tried at ip address, for example http://192.168.0.1/cgi-bin/mimetex.cgi
  146. // 'server_name' - detection is tried at address based on server's name, for example http://mysite.com/cgi-bin/mimetex.cgi
  147. if (IS_WINDOWS_OS) {
  148. $config['MimetexExecutableDetectionMethod'] = 'bootstrap_ip'; // 'bootstrap_ip' for better chance on Windows (no firewall blocking).
  149. } else {
  150. $config['MimetexExecutableDetectionMethod'] = 'server_name';
  151. }
  152. // Timeout for MimeTeX executable file detection - keep this value as low as possible, especially on Windows servers.
  153. $config['MimetexExecutableDetectionTimeout'] = 0.05;
  154. // asciimath : Yet another plugin for inserting mathematical formulas.
  155. // An additional javascript library ASCIIMathML.js has to be inserted within the pages with formulas.
  156. // After enabling it, this plugin is configured to work with full-page html documents out-of-the box.
  157. // You may try it in the "Documents" and "Wiki" tools.
  158. // Browser compatibility: Internet Explorer 6.0+ with MathPlayer plugin, Mozilla Firefox 2.0+, Opera 9.5+
  159. if ((api_get_setting('math_asciimathML') == 'true')) {
  160. $config['LoadPlugin'][] = 'asciimath';
  161. }
  162. // wikilink : Adds a dialog for inserting wiki-formatted links.
  163. $config['LoadPlugin'][] = 'wikilink';
  164. // imgmap : Adds a dialog for assigning hyperlinks to specified image areas.
  165. $config['LoadPlugin'][] = 'imgmap';
  166. /*
  167. * File manager.
  168. */
  169. // Set true/false to enable/disable the file manager for different resource types:
  170. $config['LinkBrowser'] = true; // for any type of files;
  171. $config['ImageBrowser'] = true; // for images;
  172. $config['FlashBrowser'] = true ; // for flash objects;
  173. $config['MP3Browser'] = true ; // for audio files;
  174. $config['VideoBrowser'] = true ; // for video files;
  175. $config['MediaBrowser'] = true ; // for video (flv) files.
  176. // The following setting defines how the simple file manager to be opened:
  177. // true - in a new browser window, or
  178. // false - as a dialog whithin the page (recommended).
  179. $config['OpenSimpleFileManagerInANewWindow'] = false;
  180. // How the advanced file manager to be opened:
  181. // true - in a new browser window, or
  182. // false - as a dialog whithin the page (recommended).
  183. $config['OpenAdvancedFileManagerInANewWindow'] = false;
  184. /*
  185. * Separate settings for the simple and the advanced file manager modes.
  186. */
  187. if ((api_get_setting('advanced_filemanager') == 'true')) {
  188. // For the advanced file manager.
  189. // Dialog/window size for browsing:
  190. // any type of files;
  191. $config['LinkBrowserWindowWidth'] = 800 ;
  192. $config['LinkBrowserWindowHeight'] = 580 ;
  193. // images;
  194. $config['ImageBrowserWindowWidth'] = 800 ;
  195. $config['ImageBrowserWindowHeight'] = 580 ;
  196. // flash objects;
  197. $config['FlashBrowserWindowWidth'] = 800 ;
  198. $config['FlashBrowserWindowHeight'] = 580 ;
  199. // audio files;
  200. $config['MP3BrowserWindowWidth'] = 800 ;
  201. $config['MP3BrowserWindowHeight'] = 580 ;
  202. // video files;
  203. $config['VideoBrowserWindowWidth'] = 800 ;
  204. $config['VideoBrowserWindowHeight'] = 580 ;
  205. // video (flv) files.
  206. $config['MediaBrowserWindowWidth'] = 800 ;
  207. $config['MediaBrowserWindowHeight'] = 580 ;
  208. // Set true/false to enable/disable the quick-upload tabs for different resource types:
  209. $config['LinkUpload'] = false; // for any type of files;
  210. $config['ImageUpload'] = false; // for images;
  211. $config['FlashUpload'] = false; // for flash objects;
  212. $config['MP3Upload'] = false; // for audio files;
  213. $config['VideoUpload'] = false; // for video files;
  214. $config['MediaUpload'] = false; // for video (flv) files.
  215. } else {
  216. // For the simple file manager.
  217. // Dialog/window size for browsing:
  218. // any type of files;
  219. $config['LinkBrowserWindowWidth'] = 780 ;
  220. $config['LinkBrowserWindowHeight'] = 500 ;
  221. // images;
  222. $config['ImageBrowserWindowWidth'] = 780 ;
  223. $config['ImageBrowserWindowHeight'] = 500 ;
  224. // flash objects;
  225. $config['FlashBrowserWindowWidth'] = 780 ;
  226. $config['FlashBrowserWindowHeight'] = 500 ;
  227. // audio files;
  228. $config['MP3BrowserWindowWidth'] = 780 ;
  229. $config['MP3BrowserWindowHeight'] = 500 ;
  230. // video files;
  231. $config['VideoBrowserWindowWidth'] = 780 ;
  232. $config['VideoBrowserWindowHeight'] = 500 ;
  233. // video (flv) files.
  234. $config['MediaBrowserWindowWidth'] = 780 ;
  235. $config['MediaBrowserWindowHeight'] = 500 ;
  236. // Set true/false to enable/disable the quick-upload tabs for different resource types:
  237. $config['LinkUpload'] = true; // for any type of files;
  238. $config['ImageUpload'] = true; // for images;
  239. $config['FlashUpload'] = true; // for flash objects;
  240. $config['MP3Upload'] = true; // for audio files;
  241. $config['VideoUpload'] = true; // for video files;
  242. $config['MediaUpload'] = true; // for video (flv) files.
  243. }
  244. /*
  245. * Miscellaneous settings.
  246. */
  247. // The items in the format drop-down list.
  248. //$config['FontFormats'] = 'p;h1;h2;h3;h4;h5;h6;pre;address;div';
  249. $config['FontFormats'] = 'p;h1;h2;h3;h4;h5'; // A reduced format list.
  250. // The following setting guarantees white backgroung for the editing area
  251. // for all browsers. You may disable or change it if you wish.
  252. $config['EditorAreaStyles'] = 'body { background: #ffffff; }';
  253. // A setting for blocking copy/paste functions of the editor.
  254. // This setting activates on leaners only. For users with other statuses there is no blocking copy/paste.
  255. // if do you prefer configure for each toolbar edit main/inc/lib/fckeditor/toolbars/
  256. if ((api_get_setting('block_copy_paste_for_students') == 'true'))
  257. {
  258. $config['BlockCopyPaste'] = true;
  259. }
  260. /*
  261. * Additional note:
  262. * For debugging purposes the editor may run using original source versions of its javascripts, not the "compressed" versions.
  263. * In case of problems, when you need to use this feature, go to the platform administration settings page and switch the system
  264. * into "test server" mode. Don't forged to switch it back to "production server" mode after testing.
  265. */