Indefero

Indefero Commit Details


Date:2011-01-03 08:10:42 (13 years 11 months ago)
Author:Thomas Keller
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:d4929622bf5d3770ce69a3408d0e309bbcf9005a
Parents: 777937b70c2cf013a285707036ec4f45352445fe
Message:Sort directories before files in source views. Thanks to William Martin! (closes issue 573)

Changes:

File differences

src/IDF/Views/Source.php
154154
155155
156156
157
157158
158159
159160
......
246247
247248
248249
250
249251
250252
251253
......
456458
457459
458460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
459483
460484
461485
}
$scmConf = $request->conf->getVal('scm', 'git');
$props = $scm->getProperties($commit);
$res->uasort(array('IDF_Views_Source', 'treeSort'));
return Pluf_Shortcuts_RenderToResponse('idf/source/'.$scmConf.'/tree.html',
array(
'page_title' => $title,
$previous = substr($request_file, 0, -strlen($l.' '));
$scmConf = $request->conf->getVal('scm', 'git');
$props = $scm->getProperties($commit, $request_file);
$res->uasort(array('IDF_Views_Source', 'treeSort'));
return Pluf_Shortcuts_RenderToResponse('idf/source/'.$scmConf.'/tree.html',
array(
'page_title' => $page_title,
}
/**
* Callback function to sort tree entries
*/
public static function treeSort($a, $b)
{
// compare two nodes of the same type
if ($a->type === $b->type) {
if (mb_convert_case($a->file, MB_CASE_LOWER) <
mb_convert_case ($b->file, MB_CASE_LOWER)) {
return -1;
}
return 1;
}
// compare two nodes of different types, directories ("tree")
// should come before files ("blob")
if ($a->type > $b->type) {
return -1;
}
return 1;
}
/**
* Get the scm type for page title
*
* @return String

Archive Download the corresponding diff file

Page rendered in 0.07508s using 14 queries.