if (!$tmp->getField('link')) { $nds = $nodes->getNodes(); } else { $nds = $nodes->getField('link')->getNodes(); } foreach ($nds as $node) { if ($node->getField('rel') == 'alternate') { $struct->_subnodes[$id]->setField('link', $node->getField('href')); break; } //end if } //end foreach nodes } //end foreach stuct } //end if ! link || Outline if ($_REQUEST['callback']) { //if we were passed a callback, output it echo $_REQUEST['callback'] . '('; } echo $struct->toJSON(implode(' ', $classes)); //output the JSON markup for the object if ($_REQUEST['callback']) { //if we were passed a callback, finish the () echo ');'; } exit; //we're done } //end if output == json