Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/public_html/core/cache/includes/elements/modsnippet/ |
<?php function elements_modsnippet_10($scriptProperties= array()) { global $modx; if (is_array($scriptProperties)) { extract($scriptProperties, EXTR_SKIP); } /** * phpThumbOf * * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com> * * phpThumbOf is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) any * later version. * * phpThumbOf is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * phpThumbOf; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * @package phpthumbof */ /** * A custom output filter for phpThumb * * @var modX $modx * @var array $scriptProperties * @var phpThumbOf $phpThumbOf * @var string $input * @var string|array $options * * @package phpthumbof */ if (empty($modx)) return ''; if (!$modx->loadClass('modPhpThumb',$modx->getOption('core_path').'model/phpthumb/',true,true)) { $modx->log(modX::LOG_LEVEL_ERROR,'[phpThumbOf] Could not load modPhpThumb class.'); return ''; } if (empty($input)) { $modx->log(modX::LOG_LEVEL_DEBUG,'[phpThumbOf] Empty image path passed, aborting.'); return ''; } $modelPath = $modx->getOption('phpthumbof.core_path',null,$modx->getOption('core_path').'components/phpthumbof/').'model/'; require_once $modelPath.'phpthumbof/phpthumbof.class.php'; $phpThumbOf = new phpThumbOf($modx,$scriptProperties); $phpThumbOf->getCacheDirectory(); $phpThumbOf->ensureCacheDirectoryIsWritable(); $thumbnail = $phpThumbOf->createThumbnailObject(); $thumbnail->setInput($input); $thumbnail->setOptions($options); $thumbnail->initializeService(); return $thumbnail->render(); }