Thanks Lior, was useful. I thought it would solve my problem.
I am trying to set a default menu position in an old version of moodle.
I have more and more categories of questions.
Since the default position of the menu on category.php (set in category_class.php)
is "Top", when I add a new category I have to scroll through tens or hundreds ofcategories, to get to my recent additions, which are generally in numerical order.
So I tried changing this line
$row['parent'] = choose_from_menu ($viableparents, "newparent", $this->str->top, "", "", "", true);
to
$row['parent'] = choose_from_menu ($viableparents, "newparent", end($viableparents), "", "", "", true);
but no change
However,
$row['parent'] = choose_from_menu ($viableparents, "newparent", end($viableparents), end($viableparents), "", "", true);
did result in the last category being desplayed, but as a replica of the last category, at the top of the menu.
I would like to start the menu at the bottom of the menu. Perhaps this is just impossible.
Better still it would be nice if it displayed the last parent category that i used in similar way to the way in which the import screen shows the last category imported to using
the following code (in my ancient moodle).
if ($categoryid) { // update category in session variable
$SESSION->questioncat = $categoryid;
} else { // try to get category from modform
$showcatmenu = true; // will ensure that user can choose category
if (isset($SESSION->questioncat)) {
$categoryid = $SESSION->questioncat;
}
}
Tim