I found a solution for my problem.
If anybody want to take this further, feel free to do whatever you want.
If you have any suggestions how to optimize this, please tell me.
Update: This one does not respect partial loading like pagination, there must be a better solution.
<?php namespace ProcessWire;
class myHappyModule extends Process implements Module {
public static function getModuleInfo() {
return array(
'title' => 'My Happy Module',
'icon' => 'sort-amount-asc',
'version' => 001,
'singular' => true,
'autoload' => 'template=admin',
);
}
public function init() {
$this->addHookAfter("ProcessPageList::find", $this, "hookPageTreeFind");
}
public function hookPageTreeFind($event) {
$page = $event->arguments('page');
$selectorString = $event->arguments('selectorString');
$children = $page->children($selectorString);
$a = array();
foreach ($children as $key => $value) {
$a[$key] = array($value->name, $value);
}
sort($a);
$pages = array();
foreach ($a as $key => $value) {
$pages[$key] = $value[1];
}
$sortedPages = new PageArray();
$sortedPages->import($pages);
$event->return = $sortedPages;
}
}