Created
September 26, 2016 20:44
-
-
Save Burick/6531ea50058d72f61784deb7ee6da681 to your computer and use it in GitHub Desktop.
Определяет наличие не скрытых в дереве детей ресурса REVO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* определяет наличие не скрытых в дереве детей ресурса | |
* | |
* @var {xPDO|xPDO} | |
*/ | |
$parent = !empty($parent) ? $parent : $modx->resource->id; | |
$q = $modx->newQuery('modResource'); | |
$q->where(array( | |
'show_in_tree' =>1, | |
'parent' => $parent, | |
'deleted' =>0 | |
)); | |
$out = ''; | |
$out = $modx->getCount('modResource', $q) | |
? 'haschild' | |
: 'nochild'; | |
return $out; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment