refine renderIndexItem()
put some opening curly PHP braces to Allman style

Besides that, add missing spaces to the modified lines where necessary
to meet the style of the rest of the code.