Error: No Group Specified
'' : '''';\n}\n\nif (!isset ($chunk)) {\n return $debug ? ''Error: No Chunk Specified
'' : '''';\n}\n\n# turn comma-delimited list of groups into an array\n$groups = explode('','', $groups);\n\nif (!class_exists(''MemberCheck'')) {\n class MemberCheck {\n var $allGroups = NULL;\n var $debug;\n\n static function getInstance($debug) {\n static $instance;\n if (!isset ($instance)) {\n $instance = new MemberCheck($debug);\n }\n return $instance;\n }\n\n function __construct($debug = false) {\n global $modx;\n\n $this->debug = $debug;\n if ($debug) {\n $this->allGroups = array ();\n $tableName = $modx->getFullTableName(''webgroup_names'');\n $sql = "SELECT name FROM $tableName";\n if ($rs = $modx->db->query($sql)) {\n while ($row = $modx->db->getRow($rs)) {\n array_push($this->allGroups, stripslashes($row[''name'']));\n }\n }\n }\n }\n\n function isValidGroup($groupName) {\n $isValid = !(array_search($groupName, $this->allGroups) === false);\n return $isValid;\n }\n\n function getMemberChunk(& $groups, $chunk) {\n global $modx;\n $o = '''';\n if (is_array($groups)) {\n for ($i = 0; $i < count($groups); $i++) {\n $groups[$i] = trim($groups[$i]);\n if ($this->debug) {\n if (!$this->isValidGroup($groups[$i])) {\n return "The group " . $groups[$i] . " could not be found...
";\n }\n }\n }\n\n $check = $modx->isMemberOfWebGroup($groups);\n\n $chunkcheck = $modx->getChunk($chunk);\n\n $o .= ($check && $chunkcheck) ? $chunkcheck : '''';\n if (!$chunkcheck)\n $o .= $this->debug ? "The chunk $chunk not found...
" : '''';\n } else {\n $o .= "No valid group names were specified!
";\n }\n\n return $o;\n }\n }\n}\n\n$memberCheck = MemberCheck :: getInstance($debug);\n\nif (!isset ($ph)) {\n return $memberCheck->getMemberChunk($groups, $chunk);\n} else {\n $modx->setPlaceholder($ph, $memberCheck->getMemberChunk($groups, $chunk));\n return '''';\n}\n', 0, '', ''), (6, 'UltimateParent', '2.0 Travels up the document tree from a specified document and returns its "ultimate" non-root parent', 0, 7, 0, '/*\n * @name UltimateParent\n * @version 2.0 beta (requires MODx 0.9.5+)\n * @author Jason Coward