Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/config.inc.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/config.inc.php,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/config.inc.php 27 Mar 2009 08:20:44 -0000 1.10 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ImageManager/config.inc.php 23 May 2010 11:58:33 -0000 1.11 @@ -163,6 +163,17 @@ // ------------------------------------------------------------------------- /** + * Resize files, or not. If the dimensions for an image are changed + * this will control if the image is actually resized. + * + * Usually you want this true, unless you are very disk space concious. + */ + +$IMConfig['resize_files'] = true; + +// ------------------------------------------------------------------------- + +/** * Resized prefix * * The prefix for resized files, something like .resized will do. The @@ -233,6 +244,37 @@ // ------------------------------------------------------------------------- /** +* Allow Delete +* +* Possible values: true, false +* +* TRUE - Allow the user to delete files/dirs +* +* FALSE - No deleting allowed. +* +*/ + +$IMConfig['allow_delete'] = true; + +// ------------------------------------------------------------------------- + +/** +* Allow Edit +* +* Possible values: true, false +* +* TRUE - Allow the user to edit files +* +* FALSE - No editing allowed. +* +*/ + +$IMConfig['allow_edit'] = true; + + +// ------------------------------------------------------------------------- + +/** * Validate Images * * Possible values: true, false @@ -283,9 +325,60 @@ $IMConfig['ViewMode'] = 'thumbs'; +// ------------------------------------------------------------------------- +/** Margin Types + * If your HTML will be used in an email, then using CSS type "margin" + * is not so reliable and you should set UseHSpaceVSpace to be true + * to go back to the old fashioned hspace="" and vspace="" attributes on + * images. + */ +$IMConfig['UseHSpaceVSpace'] = false; +// ------------------------------------------------------------------------- +/** + * ImageManager/Picker can provide selection interfaces for more than just + * images on the server ("Pictures"). + * + * Local - the classical ImageManager for images stored on this server. + * + * YouTube - provides selection (but not upload etc) of videos on YouTube + * see smart-image.js for how to make the videos work as videos instead of + * static images. + * + * Flickr - provides selection (but not upload etc) of public images on Flickr + * Set + * $IMConfig['Flickr'] = array('Key' => 'yourkeyhere'); + * to turn on Flickr support. + * + * To get a key: http://www.flickr.com/services/api/keys/ + * + * WARNING: Flickr restricts commercial use of the API. If your site is in any way even + * remotely commercial you need to ask for a commercial key from flickr. + * + * ADDITIONAL WARNING: Flickr requires that you provide a link back to them, preferably + * on the image itself (linking to the image) - you can use smart-image.js to do + * something like this. + * + * ADDITIONAL ADDITIONAL WARNING: It's up to you to comply with the image's license!! + */ + +$IMConfig['Local'] = TRUE; +$IMConfig['YouTube'] = FALSE; +$IMConfig['Flickr'] = FALSE; + +// These are some configurable defaults for Flickr, to override +// $IMConfig['Flickr'] = array('Whatever' => 'You Want'); +$FlickrDefaults = array +( + // This is the URL as flickr provides it for the licence which you wish + // to search on by default. The default here is the least restrictive one. + 'Default License' => 'http://creativecommons.org/licenses/by/2.0/', + +); + + //////////////////////////////////////////////////////////////////////////////// // ================== END OF CONFIGURATION ======================= // //////////////////////////////////////////////////////////////////////////////// @@ -299,6 +392,17 @@ { $IMConfig = array_merge($IMConfig, $passed_data); $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&'; + + if($IMConfig['Flickr']) + { + foreach($FlickrDefaults as $k => $v) + { + if(!isset($IMConfig['Flickr'][$k])) + { + $IMConfig['Flickr'][$k] = $v; + } + } + } } // Deprecated config passing, don't use this way any more! elseif(isset($_REQUEST['backend_config'])) @@ -307,6 +411,13 @@ $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']); } + if($_REQUEST['backend_config_secret_key_location'] !== 'Xinha:ImageManager') + { + trigger_error('Programming Error - please contact the website administrator/programmer to alert them to this problem. A non-default backend key location is being used to pass backend data to Xinha, but the same key location is not being used to receive data. The special backend configuration has been ignored. To resolve this, you should edit plugins/ImageManager/config.php and change the default key location from "Xinha:ImageManager" to your desired non default. See: http://trac.xinha.org/ticket/1518', E_USER_ERROR); + } + else + { + // Config specified from front end, check that it's valid session_start(); $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']]; @@ -326,7 +437,7 @@ $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&'; $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&'; $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&'; - + } } define('IMAGE_CLASS', $IMConfig['IMAGE_CLASS']);