/** * Gets the choices that apply to this tag, via option/optgroup/options tags. * * @param array $children Child tags to search * @param XenForo_Template_Compiler $compiler Compiler * @param array $options Compiler options * @param string $newOutputVar * * @return string */ protected function _getChoicesCode(array $children, XenForo_Template_Compiler $compiler, array $options, &$newOutputVar = '') { $oldOutputVar = $compiler->getOutputVar(); $newOutputVar = $compiler->getUniqueVar(); $compiler->setOutputVar($newOutputVar); $code = '$' . $newOutputVar . " = array();\n"; foreach ($children as $child) { $compiler->setLastVistedSegment($child); $code .= $this->_compileChoiceChild($newOutputVar, $child, $compiler, $options); } $compiler->setOutputVar($oldOutputVar); return $code; }