function init(&$controller) { $this->__controller =& $controller; if ($this->__controller->components !== false) { $loaded = array(); $this->__controller->components = array_merge($this->__controller->components, array('Session')); $loaded = $this->__loadComponents($loaded, $this->__controller->components); $bit = 0; foreach (array_keys($loaded)as $component) { $tempComponent =& $loaded[$component]; if($component == 'RequestHandler') { if (env('HTTP_X_REQUESTED_WITH') != null) { //echo "its not null"; if( env('HTTP_X_REQUESTED_WITH') == "XMLHttpRequest") { $bit = 1; } } } if (isset($tempComponent->components) && is_array($tempComponent->components)) { foreach ($tempComponent->components as $subComponent) { $this->__controller->{$component}->{$subComponent} =& $loaded[$subComponent]; } } } if ($bit == 0) { //if its not an ajax request, then use the SMF menu //if you dont ever want to use the SMF menu, then just comment out the next line. $ssi_layers = array('main'); } require_Once('forums/SSI.php'); } }