| | 917 | |
|---|
| | 918 | // CURRENT LEAF COMPATIBILITY CODE, REMOVE ONCE THE REST OF BASICNAV HAS BEEN CLEANED UP. |
|---|
| | 919 | // this will load the NAP class and check for the current leaf. In the future, this |
|---|
| | 920 | // should be done using the current context information instead of this old method. |
|---|
| | 921 | if ($this->_current == $topic->id) |
|---|
| | 922 | { |
|---|
| | 923 | // Load the leaves of the current topic automatically. |
|---|
| | 924 | $this->_load_leaves($nodedata); |
|---|
| | 925 | |
|---|
| | 926 | $nap =& $this->_loader->get_nap_class($nodedata[MIDCOM_NAV_COMPONENT]); |
|---|
| | 927 | if (!$nap->set_object($topic)) |
|---|
| | 928 | { |
|---|
| | 929 | $midcom_errstr = "Could not set NAP to Topic {$topic->id}."; |
|---|
| | 930 | debug_add($midcom_errstr, MIDCOM_LOG_ERROR); |
|---|
| | 931 | debug_pop(); |
|---|
| | 932 | return MIDCOM_ERRCRIT; |
|---|
| | 933 | } |
|---|
| | 934 | $currentleaf = $nap->get_current_leaf(); |
|---|
| | 935 | $currentleaf_id = "{$nodedata[MIDCOM_NAV_ID]}-{$currentleaf}"; |
|---|
| | 936 | if (! array_key_exists($currentleaf_id, $this->_leaves)) |
|---|
| | 937 | { |
|---|
| | 938 | debug_add("Warning, the current leaf {$currentleaf_id} could not be found in the leaf list. Ignoring silently.", MIDCOM_LOG_WARN); |
|---|
| | 939 | } |
|---|
| | 940 | else |
|---|
| | 941 | { |
|---|
| | 942 | debug_add("Set current leaf to {$currentleaf_id}."); |
|---|
| | 943 | $this->_currentleaf = $currentleaf_id; |
|---|
| | 944 | } |
|---|
| | 945 | } |
|---|
| | 946 | // CURRENT LEAF COMPATIBILITY CODE END |
|---|
| | 947 | |
|---|
| | 948 | |
|---|