<?php
class c_services_quiz_get_themes_collections
{
  function show()
  { $files=get_files_list(_DIR_EXT.'/quiz/collections/') ;
	  if (_sizeof($files)) foreach($files as $i=>$filename)
	  { $cont=file_get_contents($filename) ;
	    $arr=json_decode($cont,true) ;
	    $res[]=array(   'id'=>$i+1,//str_replace('.json','',basename($filename)), // текст в ID не проходит
	                    'label'=>$arr['thema']['name'],
	                    'type'=>'theme',
	                    'parent'=>0,
	                    'clss'=>1,
	                    'has_children'=>false
	                    ) ;
	  }
    echo json_encode($res,JSON_UNESCAPED_UNICODE) ;

  }
}
