<?php $properties = implode("-", $scriptProperties); $cache_key = "gal".$properties; $output = $modx->cacheManager->get($cache_key); if ($output) return $output; $files = scandir($galdir, 0); // если директории не существует if (!$files) return false; // удаляем . и .. (я думаю редко кто использует) if ($sort == 0) unset($files[0],$files[1]); else unset($files[count($files)-1], $files[count($files)-1]); foreach ($files as $file) { if (!$each_href) {$href = $modx->runSnippet('phpthumbof', array("input" => "/$galdir/$file", "options" => "w=1100&h=1100"));} else {$href = $each_href;} $output .= $before.'<a href="'.$href.'" '.$class.' rel="prettyPhoto['.$galdir.']"> </a>'.$after."\n"; } $modx->cacheManager->set($cache_key,$output); return $output;
выводит то что нужно единственно индификатор это полный путь. можно как то обрезать до названия папки? ато сейчас он вот в таком виде rel=«prettyPhoto[assets/components/focus/images/gal]»