Closed Bruno17 closed 11 years ago
No, It's definitely not correct. Looking at the code, I don't think there's an easy fix. In order to handle multiple menus, I think it would be have to be refactored along the lines of the static createTransportFile() method in the ObjectAdapter (which I don't think can be used because menus are so weird).
As you probably know, the data used by createTransportFile() is in the big ObjectAdapter::$myObjects array(). If you're going to work on this, you might want to uncomment line 131 of the ExportObject snippet to get a look at that array. I used to have code to dump that array to a file called objectarray.txt, but it appears to be gone.
I will take a look at this when I have time, but I'm swamped right now.
OK, I carved out a little time to work on this. Not as difficult as I thought. I need to do some tests, but in the meantime, just move the $code = ''; line inside the foreach (at the top), remove the $code .= "\nreturn \$menus;\n"; line and put
$tpl .= "\nreturn \$menus;\n";
Just below the closing brace of the foreach().
I've pushed the changes. Should be all fixed. I noticed a comment (LOL): /* ToDo: make this work */
is this correct to have a
return $menus;
after each menuField in menuadapter?