public function activate(Item $item = null, $recursion = false)
    {
        $item = is_null($item) ? $this : $item;

        // Check to see which element should have class 'active' set.
        if ('item' == $this->builder->conf('active_element')) {
            $item->active();
        } else {
            $item->link->active();
        }

        if (false === $recursion) {
            $item->active = true;
        }

        // If parent activation is enabled:
        if (true === $this->builder->conf('activate_parents')) {
            // Moving up through the parent nodes, activating them as well.
            if ($item->parent) {
                $this->activate($this->builder->whereId($item->parent)->first(), true);
            }
        }
    }
public function activate(Item $item = null, $recursion = false)
    {
        $item = is_null($item) ? $this : $item;

        // Check to see which element should have class 'active' set.
        if ('item' == $this->builder->conf('active_element')) {
            $item->active();
        } else {
            $item->link->active();
        }

        if (false === $recursion) {
            $item->active = true;
        }

        // If parent activation is enabled:
        if (true === $this->builder->conf('activate_parents')) {
            // Moving up through the parent nodes, activating them as well.
            if ($item->parent) {
                $this->activate($this->builder->whereId($item->parent)->first(), true);
            }
        }
    }
public function activate ( Item $ item = null , $ recursion = false ) { $ item = is_null ( $ item ) ? $ this : $ item ; // Check to see which element should have class 'active' set. if ( 'item' == $ this -> builder -> conf ( 'active_element' ) ) { $ item -> active ( ) ; } else { $ item -> link -> active ( ) ; } if ( false === $ recursion ) { $ item -> active = true ; } // If parent activation is enabled: if ( true === $ this -> builder -> conf ( 'activate_parents' ) ) { // Moving up through the parent nodes, activating them as well. if ( $ item -> parent ) { $ this -> activate ( $ this -> builder -> whereId ( $ item -> parent ) -> first ( ) , true ) ; } } }
Activate the item.

@param Item $item
@param bool $recursion
Activate the item .