コード例 #1
0
ファイル: class.picnik.php プロジェクト: hungnv0789/vhtm
	/**
	* For a provided image type and id, return the URL to send to picnik for loading
	*
	* @param int $imageType One of ISC_PICNIK_TYPE_ constants
	* @param mixed $imageId Image identifier (could be numeric for product images, filename for image manager, etc.)
	* @return string
	*/
	public function getSourceUrlForImage($imageType, $imageId)
	{
		// for internal testing when picnik cannot access the server, send an external url
		//return 'http://farm4.static.flickr.com/3433/3777641358_76e74c2846_o.jpg';

		switch ($imageType) {
			case ISC_PICNIK_TYPE_PRODUCTIMAGE:
				$image = new ISC_PRODUCT_IMAGE((int)$imageId);
				return $image->getSourceUrl();
				break;

			case ISC_PICNIK_TYPE_IMAGEMANAGER:
				return GetConfig('ShopPathSSL') . '/' . GetConfig('ImageDirectory') . '/uploaded_images/' . rawurlencode($imageId);
				break;
		}
	}