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

Source for file config.inc.php

Documentation is available at config.inc.php

  1. <?php
  2. /**
  3.  * Image Manager configuration file.
  4.  * @author $Author: Wei Zhuo $
  5.  * @author $Author: Paul Moers <mail@saulmade.nl> $ - watermarking and replace code + several small enhancements <http://fckplugins.saulmade.nl>
  6.  * @version $Id: config.inc.php 27 2004-04-01 08:31:57Z Wei Zhuo $
  7.  * @package ImageManager
  8.  */
  9.  
  10.  
  11. /* 
  12.  File system path to the directory you want to manage the images
  13.  for multiple user systems, set it dynamically.
  14.  
  15.  NOTE: This directory requires write access by PHP. That is, 
  16.        PHP must be able to create files in this directory.
  17.        Able to create directories is nice, but not necessary.
  18. */
  19. #$IMConfig['base_dir'] = '/var/www/FCKeditor/images/';
  20.  
  21. /*
  22.  The URL to the above path, the web browser needs to be able to see it.
  23.  It can be protected via .htaccess on apache or directory permissions on IIS,
  24.  check you web server documentation for futher information on directory protection
  25.  If this directory needs to be publicly accessiable, remove scripting capabilities
  26.  for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
  27.  in this directory and its subdirectories.
  28. */
  29. $language_file array('document');
  30. include ('../../../../../../inc/global.inc.php');
  31.  
  32. //The user is in a course
  33. if(isset($_SESSION["_course"]["sysCode"])){
  34.     if(api_is_allowed_to_edit()){
  35.         $IMConfig['base_dir'api_get_path(SYS_COURSE_PATH).$_SESSION["_course"]["path"]."/document/images/";
  36.         $IMConfig['base_url'api_get_path(WEB_COURSE_PATH).$_SESSION["_course"]["path"]."/document/images/";
  37.     }
  38.     elseif(isset($_GET['uploadPath']&& $_GET['uploadPath']!=""){
  39.         $IMConfig['base_dir'api_get_path(SYS_COURSE_PATH).$_SESSION["_course"]["path"]."/".$_GET['uploadPath'];
  40.         $IMConfig['base_url'api_get_path(WEB_COURSE_PATH).$_SESSION["_course"]["path"]."/".$_GET['uploadPath'];
  41.     }
  42.     else{
  43.         $IMConfig['base_dir'api_get_path(SYS_COURSE_PATH).$_SESSION["_course"]["path"]."/upload/";
  44.         $IMConfig['base_url'api_get_path(WEB_COURSE_PATH).$_SESSION["_course"]["path"]."/upload/";
  45.     }
  46. }
  47.  
  48. //Out of any course (admin)
  49. else{
  50.     $IMConfig['base_dir'$_configuration['root_sys'].'main/default_course_document/images/';
  51.     $IMConfig['base_url'$_configuration['root_web'].'main/default_course_document/images/';
  52. }
  53.  
  54. $IMConfig['server_name'$_SERVER['SERVER_NAME'];
  55.  
  56. /*
  57.  demo - when true, no saving is allowed
  58. */
  59. $IMConfig['demo'false;
  60.  
  61. /*
  62.  
  63.   Possible values: true, false
  64.  
  65.   TRUE - If PHP on the web server is in safe mode, set this to true.
  66.          SAFE MODE restrictions: directory creation will not be possible,
  67.          only the GD library can be used, other libraries require
  68.          Safe Mode to be off.
  69.  
  70.   FALSE - Set to false if PHP on the web server is not in safe mode.
  71. */
  72. $IMConfig['safe_mode'false;
  73.  
  74. /* 
  75.  Possible values: 'GD', 'IM', or 'NetPBM'
  76.  
  77.  The image manipulation library to use, either GD or ImageMagick or NetPBM.
  78.  If you have safe mode ON, or don't have the binaries to other packages, 
  79.  your choice is 'GD' only. Other packages require Safe Mode to be off.
  80. */
  81. define('IMAGE_CLASS''GD');
  82.  
  83.  
  84. /*
  85.  After defining which library to use, if it is NetPBM or IM, you need to
  86.  specify where the binary for the selected library are. And of course
  87.  your server and PHP must be able to execute them (i.e. safe mode is OFF).
  88.  GD does not require the following definition.
  89. */
  90. define('IMAGE_TRANSFORM_LIB_PATH''/usr/bin/');
  91.  
  92.  
  93. /* ==============  OPTIONAL SETTINGS ============== */
  94.  
  95.  
  96. /*
  97.   The prefix for thumbnail files, something like .thumb will do. The
  98.   thumbnails files will be named as "prefix_imagefile.ext", that is,
  99.   prefix + orginal filename.
  100. */
  101. $IMConfig['thumbnail_prefix''.';
  102.  
  103. /*
  104.   Thumbnail can also be stored in a directory, this directory
  105.   will be created by PHP. If PHP is in safe mode, this parameter
  106.   is ignored, you can not create directories. 
  107.  
  108.   If you do not want to store thumbnails in a directory, set this
  109.   to false or empty string '';
  110. */
  111. $IMConfig['thumbnail_dir''.thumbs';
  112.  
  113. /*
  114.   Possible values: true, false
  115.  
  116.  TRUE -  Allow the user to create new sub-directories in the
  117.          $IMConfig['base_dir'].
  118.  
  119.  FALSE - No directory creation.
  120.  
  121.  NOTE: If $IMConfig['safe_mode'] = true, this parameter
  122.        is ignored, you can not create directories
  123. */
  124. $IMConfig['allow_new_dir'false;
  125.  
  126. /*
  127.   Possible values: true, false
  128.  
  129.   TRUE - Allow the user to upload files.
  130.  
  131.   FALSE - No uploading allowed.
  132. */
  133. $IMConfig['allow_upload'true;
  134.  
  135. /*
  136.   Possible values: true, false
  137.  
  138.   TRUE - Allow the replacement of the image with a newly uploaded image in the editor dialog.
  139.  
  140.   FALSE - No replacing allowed.
  141. */
  142. $IMConfig['allow_replace'false;
  143.  
  144. /*
  145.   Possible values: true, false
  146.  
  147.   TRUE - Allow the deletion of images
  148.  
  149.   FALSE - No deleting allowed
  150. */
  151. $IMConfig['allow_delete'true;
  152.  
  153. /*
  154.   Possible values: true, false
  155.  
  156.   TRUE - Allow the user to enter a new filename for saving the edited image.
  157.  
  158.   FALSE - Overwrite
  159. */
  160. $IMConfig['allow_newFileName'false;
  161.  
  162. /*
  163.   Possible values: true, false
  164.   Only applies when the the user can enter a new filename (The baove settig = 'allow_newFileName' true)
  165.  
  166.   TRUE - Overwrite file of entered filename, if file already exist.
  167.  
  168.   FALSE - Save to variant of entered filename, if file already exist.
  169. */
  170. $IMConfig['allow_overwrite'false;
  171.  
  172. /*
  173.   Specify the paths of the watermarks to use (relative to $IMConfig['base_dir']).
  174.   Specifying none will hide watermarking functionality.
  175. */
  176. $IMConfig['watermarks'array    (
  177.                                                     "imageManager.png",
  178.                                                     "imageManager.jpg",
  179.                                                     "devshed.png",
  180.                                                     "natureWatermark.png"
  181.                                                 );
  182.  
  183. /*
  184.     To limit the width and height for uploaded files, specify the maximum pixeldimensions.
  185.     Setting either zero or empty will allow any size.
  186. */
  187. $IMConfig['maxWidth'333;
  188. $IMConfig['maxHeight'333;
  189.  
  190. /*
  191.  Possible values: true, false
  192.  
  193.  TRUE - If set to true, uploaded files will be validated based on the 
  194.         function getImageSize, if we can get the image dimensions then 
  195.         I guess this should be a valid image. Otherwise the file will be rejected.
  196.  
  197.  FALSE - All uploaded files will be processed.
  198.  
  199.  NOTE: If uploading is not allowed, this parameter is ignored.
  200. */
  201. $IMConfig['validate_images'true;
  202.  
  203. /*
  204.  The default thumbnail if the thumbnails can not be created, either
  205.  due to error or bad image file.
  206. */
  207. $IMConfig['default_thumbnail''img/default.gif';
  208.  
  209. /*
  210.   Thumbnail dimensions.
  211. */
  212. $IMConfig['thumbnail_width'96;
  213. $IMConfig['thumbnail_height'96;
  214.  
  215. /*
  216.   Image Editor temporary filename prefix.
  217. */
  218. $IMConfig['tmp_prefix''.editor_';
  219. ?>

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