Example #1
0
    {
        $out = array();
        include_once MODX_BASE_PATH . 'assets/snippets/DocLister/lib/jsonHelper.class.php';
        $thumbs = \jsonHelper::jsonDecode(urldecode($tconfig), array('assoc' => true), true);
        foreach ($thumbs as $thumb) {
            if ($thumb['rid'] == $rid || $thumb['template'] == $template) {
                $out = $thumb;
                break;
            }
        }
        return $out;
    }
}
if ($e->name == "OnFileBrowserUpload" && isset($template) || $e->name == "OnSimpleGalleryRefresh") {
    $thumb = new \Helpers\PHPThumb();
    $thumb->optimize($filepath . '/' . $filename);
    $fs = \Helpers\FS::getInstance();
    $thumbConfig = getThumbConfig($tconfig, $sg_rid, $template);
    if (!empty($thumbConfig)) {
        extract($thumbConfig);
        $fs->makeDir($filepath . '/' . $folder);
        $thumb->create($filepath . '/' . $filename, $filepath . '/' . $folder . '/' . $filename, $options);
        $thumb->optimize($filepath . '/' . $folder . '/' . $filename);
    }
}
if ($e->name == "OnSimpleGalleryDelete") {
    $fs = \Helpers\FS::getInstance();
    $thumbConfig = getThumbConfig($tconfig, $sg_rid, $template);
    if (!empty($thumbConfig)) {
        extract($thumbConfig);
        $file = $filepath . '/' . $folder . '/' . $filename;