<?php  return 'function elements_modsnippet_32($scriptProperties= array()) {
global $modx;
if (is_array($scriptProperties)) {
extract($scriptProperties, EXTR_SKIP);
}
	$tpl=\'fem.trosk.troskCrumbs\';
	$categoryId=$_REQUEST[\'category_id\'];
	$projectId=$_REQUEST[\'proj_id\'];
    if(empty($categoryId)) $categoryId=2;
	$parentIds=$modx->getParentIds($categoryId,15);
	$parentIds[]=$categoryId;
	if(empty($parentIds)){
		$category=$modx->getObject(\'modResource\',$categoryId);
		$categoryArray = $category->toArray();
		return $modx->getChunk($tpl,$categoryArray);
	}
	$criteria=$modx->newQuery(\'modResource\');
    $criteria->where(array(
         \'id:IN\' => $parentIds,
    ));
    $criteria->sortby(\'id\',\'ASC\');
    $categories=$modx->getCollection(\'modResource\',$criteria);
    $i=0;
    $output=\'\';
    foreach ($categories as $category) {
      $catUrl=$modx->makeUrl(26,\'\',array(\'category_id\' => $category->id,\'proj_id\'=>$projectId));  
      $category->fromArray(array(
        \'catUrl\'=>$catUrl,
      ));
      $categoryArray = $category->toArray();
      $output .= $modx->getChunk($tpl,$categoryArray);
    };
    return $output;
}
';