/** * Constructor. Sets the reference to the transaction in which the trigger is used. * @param object tNG &$tNG reference to transaction object * @access public */ function tNG_TidyContent(&$tNG) { $this->tNG =& $tNG; $this->folderName = KT_RealPath($GLOBALS['TidyContent_TidyTempPath'], true); $this->columns = array(); $this->outEncoding = 'ascii'; $this->deniedTagsList = ''; $this->allowedTagsList = ''; $this->tidiedValues = array(); }
function getPhotoList() { if (!isset($this->config['photo_folder'])) { $arr = array('error' => 'Photo folder is not set. Please check to see if you have cookies enabled.'); return $arr; } $folderName = KT_RealPath($this->config['photo_folder'], true); $thumb_path = $folderName . $GLOBALS['GAL_thumbnail_folder']; $folder = new KT_folder(); $arr = $folder->readFolder($folderName, true); if ($folder->hasError()) { $errors = $folder->getError(); $errorLevel = !empty($GLOBALS['tNG_debug_mode']) ? $GLOBALS['tNG_debug_mode'] == 'PRODUCTION' ? 0 : 1 : 1; $toret['error'] = $errors[$errorLevel]; return $toret; } $ret = array(); foreach ($arr['files'] as $key => $value) { $fullFileName = $folderName . $value['name']; $info = KT_pathinfo($fullFileName); if (GAL_isImage($fullFileName)) { $fullThumbnailName = $info['filename'] . '_' . $this->config['thumbnails']['width'] . 'x' . $this->config['thumbnails']['height'] . '.' . $info['extension']; $imageDetails = GAL_getImageInfo($folderName, $value['name']); clearstatcache(); if ($imageDetails['dateLastModified'] != @filemtime($folderName . $value['name'])) { GAL_deleteThumbnails($folderName, $value['name']); GAL_getImageInfo($folderName, $value['name']); } # if this image has a thumbnail already. if (!file_exists($thumb_path . $fullThumbnailName)) { $value['thumbnail'] = NULL; } else { ob_start(); $thumbSizeArr = getimagesize($folderName . $GLOBALS['GAL_thumbnail_folder'] . $fullThumbnailName); $error = ob_get_contents(); ob_end_clean(); if (is_array($thumbSizeArr)) { $value['thumbnail'] = array('name' => $GLOBALS['GAL_thumbnail_folder'] . $fullThumbnailName, 'width' => $thumbSizeArr[0], 'height' => $thumbSizeArr[1]); } else { $value['thumbnail'] = array('error' => $error); } } if (is_readable($fullFileName)) { $imageSizeArr = getimagesize($fullFileName); $value['width'] = $imageSizeArr[0]; $value['height'] = $imageSizeArr[1]; } else { $value['error'] = 'The ' . $fullFileName . ' is not readable'; } $ret[] = $value; } } return $ret; }
<?php /* * ADOBE SYSTEMS INCORPORATED * Copyright 2007 Adobe Systems Incorporated * All Rights Reserved * * NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the * terms of the Adobe license agreement accompanying it. If you have received this file from a * source other than Adobe, then your use, modification, or distribution of it requires the prior * written permission of Adobe. */ // tidy configuration values $GLOBALS['TidyContent_TidyLocations'] = array('C:\\utils\\tidy.exe', 'tidy', '/usr/bin/tidy', '/usr/local/bin/tidy', '/usr/local/tidy/bin/tidy', '/usr/bin/tidy/bin/tidy', 'tidy.exe', 'C:/Progra~1/tidy/tidy.exe', 'C:/Windows/tidy.exe', 'C:/utils/dlls/tidy.exe'); $GLOBALS['TidyContent_TidyConfiguration'] = KT_RealPath(dirname(realpath(__FILE__)), true) . '.tidyconf'; $GLOBALS['TidyContent_TidyTempPath'] = dirname(__FILE__) . '/../../common/_temp/.tidy/';