myconfig.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /*
  4. * Custom editor configuration settings, php-side.
  5. * See http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
  6. *
  7. * Configuration data for the editor comes from different sources which are prioritised.
  8. *
  9. * 1-st level (the highest priority)
  10. * "Hardcoded" options by developers. 'Width' and 'Height' are exception of this rule.
  11. *
  12. * 2-nd level
  13. * Configuration settings from myconfig.php (this file).
  14. *
  15. * 3-rd level
  16. * Default configuration settings that are determined (calculated) by the system..
  17. *
  18. * 4-th level
  19. * Configuration settings from myconfig.js. This file may be modified for customization purposes too.
  20. * You may choose to create there options or to transfer options from here (not all) which have low probability of future changes.
  21. * Thus, you will gain performance by exploiting caching, but changes in myconfig.js do not enforce immediatelly.
  22. * Here is the mapping rule:
  23. *
  24. * myconfig.php myconfig.js
  25. * ---------------------------------------------------------------------------------------------
  26. * $config['FontFormats'] = 'p;h1;h2;h3;h4;h5'; FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5';
  27. *
  28. * 5-th level (the lowest priority)
  29. * Configuration settings from myconfig.js. This file is "as is" in the original source, modifying it is not recommended.
  30. */
  31. /*
  32. * Toolbar definitions.
  33. */
  34. // The following setting is the directory where the online editor's toobar definitions reside in correspondent php-files.
  35. // By default, the directory name is 'default' and it has been created at .../chamilo/main/inc/lib/fckeditor/toolbars/ .
  36. // For using your customized toolbars, crate another directory, for example 'custom' at the same path, i.e.
  37. // create .../chamilo/main/inc/lib/fckeditor/toolbars/custom/ . Then, copy the original php-definition files
  38. // from .../chamilo/main/inc/lib/fckeditor/toolbars/default/ to the new one. Change the following configuration setting, so it to
  39. // point to the new directory:
  40. // $config['ToolbarSets']['Directory'] = 'custom';
  41. // Then, you may modify the newly copied toolbar definitions at your will, just keep correct php-syntax.
  42. // It is not mandatory you to create custom files for all the toolbars. In case of missing file in the directory with the
  43. // custom toobar definitions the system would read the correspondent "factory" toolbar definition (form 'default' directory).
  44. // This is the visible toolbar set when the editor is maximized.
  45. // If it has not been defined, then the toolbar set for the "normal" size is used.
  46. // if do you prefer configure for each toolbar edit main/inc/lib/fckeditor/toolbars/
  47. if ((api_get_setting('more_buttons_maximized_mode') == 'true')) {
  48. $config['ToolbarSets']['Directory'] = 'extended';
  49. } else {
  50. $config['ToolbarSets']['Directory'] = 'default';
  51. }
  52. /*
  53. * Plugins.
  54. */
  55. // customizations : This plugin has been developed by the Chamilo team for editor's integration within the system.
  56. // The plugin should be loaded first, before all other plugins. Please, do not disable it.
  57. $config['LoadPlugin'][] = 'customizations';
  58. // dragresizetable & tablecommands : Plugins for improvement table-related operations.
  59. if (trim(get_lang('text_dir', '')) != 'rtl') {
  60. // This plugin works properly only when language writting system is "from left to right (ltr)".
  61. $config['LoadPlugin'][] = 'dragresizetable';
  62. }
  63. $config['LoadPlugin'][] = 'tablecommands';
  64. //This plug-in allows to insert tables with one click
  65. $config['LoadPlugin'][] = 'tableoneclick';
  66. // prompt : This plugin is a dialog implementation as a replacemet of the javascript function prompt().
  67. // It provides consistent appearance and avoiding activation of browser's blocking features.
  68. $config['LoadPlugin'][] = 'prompt';
  69. // audio: Adds a dialog for inserting audio files (.mp3).
  70. $config['LoadPlugin'][] = 'audio';
  71. // glossary: this plugin add a term from glossary tool in Chamilo.
  72. if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
  73. $config['LoadPlugin'][] = 'glossary';
  74. }
  75. // MP3: This is the old plugin for inserting audio files.
  76. // If you wish to use it, disable the "audio" plugin first.
  77. //$config['LoadPlugin'][] = 'MP3';
  78. // ImageManager : Adds a dialog (image gallery) for inserting images. The advanced file manager has its own functionality
  79. // for previewing images. This is why we load this plugin only in case when the simple file manager is used.
  80. if (!(api_get_setting('advanced_filemanager') == 'true')) {
  81. $config['LoadPlugin'][] = 'ImageManager';
  82. // The following setting defines how the simple file manager to be opened:
  83. // true - in a new browser window, or
  84. // false - as a dialog whithin the page (recommended).
  85. $config['OpenImageManagerInANewWindow'] = false;
  86. }
  87. // fckEmbedMovies : Adds a dilog for inserting video files.
  88. $config['LoadPlugin'][] = 'fckEmbedMovies';
  89. // flvPlayer : Adds a dilog for inserting video files (.flv, .mp4), so they to be viewed through a flash-based player.
  90. $config['LoadPlugin'][] = 'flvPlayer';
  91. // Choosing Flash embedding technique:
  92. // 'embed' - <embed> tag is used, this is the oldest way that is still supported by most of the browsers;
  93. // 'object' - <object> tag is used, specific for Internet Explorer;
  94. // 'adobe' - this is the "adobe way" - <object><embed /></object>, it works very well, but the <object> tag is not XML-compliant;
  95. // 'swfobject' - this is a technique that uses a special javascript, it works very well if javasripts are not disabled (due to security reasons).
  96. // This setting works only for the plugin 'flvPlayer' so far.
  97. $config['FlashEmbeddingMethod'] = 'adobe' ;
  98. // youtube : Adds a dilog for inserting YouTube video-streams.
  99. if (api_get_setting('youtube_for_students') == 'true') {
  100. $config['LoadPlugin'][] = 'youtube';
  101. } else {
  102. if (api_is_allowed_to_edit() || api_is_platform_admin()) { // (not for students)
  103. $config['LoadPlugin'][] = 'youtube';
  104. }
  105. }
  106. $config['LoadPlugin'][] = 'media';
  107. // googlemaps : Adds a dialog for inserting Google maps.
  108. if ((api_get_setting('enabled_googlemaps') == 'true')) {
  109. $config['LoadPlugin'][] = 'googlemaps';
  110. /*
  111. **API-key for the "googlemaps" plugin.
  112. The following key is valid for http://localhost (see myconfig.js where this key has been activated by default).
  113. You must get a new for each server where you intend to use the plugin 'googlemaps'. Just get the key for free after agreeing with the Terms of Use of the GoogleMaps API from here: http://www.google.com/apis/maps/signup.html.
  114. At you choice, you may activate the newly obtained API-key using the following setting or using the same setting in myconfig.js.
  115. Activated here API-key is not cached by browsers and overrides the key from the configuration file myconfig.js.
  116. *
  117. */
  118. //$config['GoogleMaps_Key'] = 'ABQIAAAAlXu5Pw6DFAUgqM2wQn01gxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSy5hTGQdsosYD3dz6faZHVrO-02A'; //sample for localhost
  119. }
  120. // mimetex : Adds a dialog for inserting mathematical formulas. In order this plugin to work properly, preliminary changes.
  121. if ((api_get_setting('math_mimetex') == 'true')) {
  122. $config['LoadPlugin'][] = 'mimetex';
  123. // in your server configuration have to be done. The MimeTex executable file has to be installed, see the installation guide.
  124. // Some additional settings become active only when the 'mimetex' plugin has been enabled:
  125. //
  126. // The following setting determines whether MimeTeX executable file has been installed on the server or not. This file should be accessible
  127. // for browsers at address http://mysite.com/cgi-bin/mimetex.cgi (Linux) or at address http://mysite.com/cgi-bin/mimetex.exe (Windows).
  128. // How to test manually: Open your browser and enter in the address bar something like http://mysite.com/cgi-bin/mimetex.cgi?hello
  129. // By default, the system tries to detect the MimeTeX executable file automatically.
  130. // If you are sure that the MimeTeX executable has been correctly installed, you may set this option to boolean true value.
  131. $config['MimetexExecutableInstalled'] = 'true'; // 'detect' (default), true, false.
  132. // Sometimes detection fails (due to slow DNS service, security restrictions, ...). For better probability of success,
  133. // the following methods for detection have been defined:
  134. // 'bootstrap_ip' - detection is tried at address like http://127.0.0.1/cgi-bin/mimetex.cgi
  135. // 'localhost' - detection is tried at address like http://localhost/cgi-bin/mimetex.cgi
  136. // 'ip' - detection is tried at ip address, for example http://192.168.0.1/cgi-bin/mimetex.cgi
  137. // 'server_name' - detection is tried at address based on server's name, for example http://mysite.com/cgi-bin/mimetex.cgi
  138. if (IS_WINDOWS_OS) {
  139. $config['MimetexExecutableDetectionMethod'] = 'bootstrap_ip'; // 'bootstrap_ip' for better chance on Windows (no firewall blocking).
  140. } else {
  141. $config['MimetexExecutableDetectionMethod'] = 'server_name';
  142. }
  143. // Timeout for MimeTeX executable file detection - keep this value as low as possible, especially on Windows servers.
  144. $config['MimetexExecutableDetectionTimeout'] = 0.05;
  145. }
  146. // asciimath : Yet another plugin for inserting mathematical formulas.
  147. // This plugin works only with full-page documents (with full html syntax).
  148. // The "Documents" tool can use this plugin for sure, so, activate its button there.
  149. // An additional javascript library ASCIIMathML.js is automaticaly inserted within the pages with formulas,
  150. // if there is no security restriction (script-tag should not be filtered, by default this is valid for teachers).
  151. // After enabling it, this plugin is configured to work with full-page html documents out-of-the box.
  152. // Browser compatibility: Internet Explorer 6.0+ with MathPlayer plugin, Mozilla Firefox 2.0+, Opera 9.5+
  153. if ((api_get_setting('math_asciimathML') == 'true')) {
  154. // The following additional conditions are mandatory for correct working of the plugin. Please, don't alter them.
  155. if ($this->Config['FullPage'] || api_get_setting('include_asciimathml_script') == 'true') {
  156. $config['LoadPlugin'][] = 'asciimath';
  157. }
  158. }
  159. // asciisvg: A plugin for drawing mathematical graphics on svg-enabled browsers.
  160. // This plugin works only with full-page documents (i.e. place its buttons for "Documents" tool).
  161. // An additional javascript library ASCIIMathML.js is automaticaly inserted within the pages with graphics,
  162. // if there is no security restriction (script-tag should not be filtered, by default this is valid for teachers).
  163. // Internet Explorer 8 (or prior) needs Adobe SVG Viewer installed, see http://www.adobe.com/svg/viewer/install/
  164. if ((api_get_setting('enabled_asciisvg') == 'true')) {
  165. // The following additional conditions are mandatory for correct working of the plugin. Please, don't alter them.
  166. if ($this->Config['FullPage'] || api_get_setting('include_asciimathml_script') == 'true') {
  167. $config['LoadPlugin'][] = 'asciisvg';
  168. }
  169. }
  170. // Yet another mandatory condition for proper working of the plugins 'asciimath' and 'asciisvg'.
  171. if (api_get_setting('include_asciimathml_script') == 'true') {
  172. // The automatic content parsing should be disabled on this case, otherwise content would be damaged.
  173. // The editor does the necessary parsing within its separate iframe.
  174. $config['LoadAsciiMath'] = '<script type="text/javascript">var translateOnLoad = false;</script>';
  175. }
  176. // WIRIS: plugin for inserting mathematical formulas
  177. // You may try it in the "Documents" and "Wiki" tools.
  178. // Users' computers need java installed
  179. if ((api_get_setting('enabled_wiris') == 'true')) {
  180. $config['LoadPlugin'][] = 'fckeditor_wiris';
  181. }
  182. // imgmap : Adds a dialog for assigning hyperlinks to specified image areas.
  183. if ((api_get_setting('enabled_imgmap') == 'true')) {
  184. $config['LoadPlugin'][] = 'imgmap';
  185. }
  186. // wikilink : Adds a dialog for inserting wiki-formatted links.
  187. $config['LoadPlugin'][] = 'wikilink';
  188. // insertHtml: Plugin for inserting HTML. A single preconfigured snippet; a choice from multiple preconfigured snippets; or manually entered HTML.
  189. if ((api_get_setting('enabled_insertHtml') == 'true')) {
  190. $config['LoadPlugin'][] = 'insertHtml';
  191. // Enter a single snippet (HMTL string) or multiple snippets to choose form (object of description string and HTML string pairs). Or leave empty if you want to show a dialog for the user to enter HTML manually (and not show any default HTML in the dialog textarea)
  192. //$config['insertHtml_snippets'] = { 'ArtGallery': '<embed width="475" height="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="FlashGallery/Art/ArtFlashGallery.swf" mediaType="flashGallery" bgcolor="#ffffff" allowfullscreen="true" flashvars="XMLFile=userfiles/image/ArtGallery/gallery.xml"></embed>', 'PhotoFlowGallery' : '<embed width="700" height="300" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="FlashGallery/PhotoFlow/PhotoFlowGallery.swf" mediaType="flashGallery" bgcolor="#ffffff" flashvars="XMLFile=userfiles/image/PhotoFlowGallery/gallery.xml"></embed>', 'StackPhotoGallery' : '<embed width="600" height="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="FlashGallery/StackPhoto/StackPhotoGallery.swf" mediaType="flashGallery" bgcolor="#ffffff" flashvars="XMLFile=userfiles/image/StackPhotoGallery/gallery.xml"></embed>', 'ZenGallery' : '<embed width="550" height="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="FlashGallery/Zen/ZenGallery.swf" mediaType="flashGallery" bgcolor="#ffffff" flashvars="XMLFile=userfiles/image/ZenGallery/gallery.xml"></embed>'};// TODO: this $config['insertHtml_snippets'] does not work. See also temporal hack around line 76 insertHtml.js
  193. // (If no snippets are specified the dialog will show up anyhow)
  194. $config['insertHtml_showDialog'] = true;
  195. // Specify a custom tooltip if you want this to appear when hovering the plugin's toolbar button (e.g. a description of the element being inserted). If no custom tooltip is set 'Insert HTML' will appear, and if available, translated into your language
  196. $config['insertHtml_buttonTooltip'] = '';
  197. // Show a textarea in the dialog? The first HTML set with $config['insertHtml_snippets'] will be shown in the textarea by default. If no snippets specified the textarea will show anyhow
  198. $config['insertHtml_showTextarea']= false;
  199. // The size of the textarea in the dialog, in px
  200. $config['insertHtml_textareaWidth'] = 400;
  201. $config['insertHtml_textareaHeight'] = 300;
  202. // The size of the the dialog, in px
  203. $config['insertHtml_dialogWidth'] = 475;
  204. $config['insertHtml_dialogHeight'] = 475;
  205. }
  206. // Abbr : Insert, change or delete Abbr-Title-TAG
  207. $config['LoadPlugin'][] = 'Abbr';
  208. /*
  209. * File manager.
  210. */
  211. // Set true/false to enable/disable the file manager for different resource types:
  212. $config['LinkBrowser'] = true; // for any type of files;
  213. $config['ImageBrowser'] = true; // for images;
  214. $config['FlashBrowser'] = true ; // for flash objects;
  215. $config['MP3Browser'] = true ; // for audio files;
  216. $config['VideoBrowser'] = true ; // for video files;
  217. $config['MediaBrowser'] = true ; // for video (flv) files.
  218. // The following setting defines how the simple file manager to be opened:
  219. // true - in a new browser window, or
  220. // false - as a dialog whithin the page (recommended).
  221. $config['OpenSimpleFileManagerInANewWindow'] = false;
  222. // How the advanced file manager to be opened:
  223. // true - in a new browser window, or
  224. // false - as a dialog whithin the page (recommended).
  225. $config['OpenAdvancedFileManagerInANewWindow'] = false;
  226. /*
  227. * Separate settings for the simple and the advanced file manager modes.
  228. */
  229. if ((api_get_setting('advanced_filemanager') == 'true')) {
  230. // For the advanced file manager.
  231. // Dialog/window size for browsing:
  232. // any type of files;
  233. $config['LinkBrowserWindowWidth'] = 930 ;
  234. $config['LinkBrowserWindowHeight'] = 580 ;
  235. // images;
  236. $config['ImageBrowserWindowWidth'] = 930 ;
  237. $config['ImageBrowserWindowHeight'] = 580 ;
  238. // flash objects;
  239. $config['FlashBrowserWindowWidth'] = 930 ;
  240. $config['FlashBrowserWindowHeight'] = 580 ;
  241. // audio files;
  242. $config['MP3BrowserWindowWidth'] = 930 ;
  243. $config['MP3BrowserWindowHeight'] = 580 ;
  244. // video files;
  245. $config['VideoBrowserWindowWidth'] = 930 ;
  246. $config['VideoBrowserWindowHeight'] = 580 ;
  247. // video (flv) files.
  248. $config['MediaBrowserWindowWidth'] = 930 ;
  249. $config['MediaBrowserWindowHeight'] = 580 ;
  250. // Set true/false to enable/disable the quick-upload tabs for different resource types:
  251. $config['LinkUpload'] = false; // for any type of files;
  252. $config['ImageUpload'] = false; // for images;
  253. $config['FlashUpload'] = false; // for flash objects;
  254. $config['MP3Upload'] = false; // for audio files;
  255. $config['VideoUpload'] = false; // for video files;
  256. $config['MediaUpload'] = false; // for video (flv) files.
  257. } else {
  258. // For the simple file manager.
  259. // Dialog/window size for browsing:
  260. // any type of files;
  261. $config['LinkBrowserWindowWidth'] = 780 ;
  262. $config['LinkBrowserWindowHeight'] = 500 ;
  263. // images;
  264. $config['ImageBrowserWindowWidth'] = 780 ;
  265. $config['ImageBrowserWindowHeight'] = 500 ;
  266. // flash objects;
  267. $config['FlashBrowserWindowWidth'] = 780 ;
  268. $config['FlashBrowserWindowHeight'] = 500 ;
  269. // audio files;
  270. $config['MP3BrowserWindowWidth'] = 780 ;
  271. $config['MP3BrowserWindowHeight'] = 500 ;
  272. // video files;
  273. $config['VideoBrowserWindowWidth'] = 780 ;
  274. $config['VideoBrowserWindowHeight'] = 500 ;
  275. // video (flv) files.
  276. $config['MediaBrowserWindowWidth'] = 780 ;
  277. $config['MediaBrowserWindowHeight'] = 500 ;
  278. // Set true/false to enable/disable the quick-upload tabs for different resource types:
  279. $config['LinkUpload'] = true; // for any type of files;
  280. $config['ImageUpload'] = true; // for images;
  281. $config['FlashUpload'] = true; // for flash objects;
  282. $config['MP3Upload'] = true; // for audio files;
  283. $config['VideoUpload'] = true; // for video files;
  284. $config['MediaUpload'] = true; // for video (flv) files.
  285. }
  286. /*
  287. * Miscellaneous settings.
  288. */
  289. // The items in the format drop-down list.
  290. //$config['FontFormats'] = 'p;h1;h2;h3;h4;h5;h6;pre;address;div';
  291. $config['FontFormats'] = 'p;h1;h2;h3;h4;h5'; // A reduced format list.
  292. // The following setting guarantees white backgroung for the editing area
  293. // for all browsers. You may disable or change it if you wish.
  294. $config['EditorAreaStyles'] = 'body { background: #ffffff; }';
  295. // A setting for blocking copy/paste functions of the editor.
  296. // This setting activates on leaners only. For users with other statuses there is no blocking copy/paste.
  297. // if do you prefer configure for each toolbar edit main/inc/lib/fckeditor/toolbars/
  298. if ((api_get_setting('block_copy_paste_for_students') == 'true')) {
  299. $config['BlockCopyPaste'] = true;
  300. }
  301. /*
  302. * Additional note:
  303. * For debugging purposes the editor may run using original source versions of its javascripts, not the "compressed" versions.
  304. * In case of problems, when you need to use this feature, go to the platform administration settings page and switch the system
  305. * into "test server" mode. Don't forged to switch it back to "production server" mode after testing.
  306. */