<?php
	
	if(!$dprotect) die ('Access Denied!');
        
        $galleries = $core->listGalleriesForRedactor();
        $i = 1;
        $images = Array();
        if($galleries) foreach($galleries as $k => $v) {
            if($v['images']) foreach ($v['images'] as $k2 => $v2) {
                $cell['thumb'] = $config['url'].$config['thumbdir'].'/'.$v2['filename'];
                $cell['image'] = $config['url'].$config['imagedir'].'/'.$v2['filename'];
                $cell['title'] = 'Img'.$i;
                $cell['folder'] = $v['name'];
                array_push($images, $cell);
                $i++;
            }
        }
        echo json_encode($images);
	
	exit();
	
?>