Due to lack of php knowledge i cant find where i am mistaken and how it`s better to do this. I have several languages one of them LTR and the other RTL and i need sidebars to be displayed vice-versa. It means that in LTR menu would be in the first and in the RTL it would be in the second sidebar. The code returns '1' somehow and breaks the markup. Please help me to modify this code:
global $language;
switch ($language->language) {
case "en":
if ($page["sidebar_first"]):
print "<aside id='sidebar-first' role='complementary' class='sidebar clearfix'>".print render($page['sidebar_first'])."</aside>";
endif;
if ($page["sidebar_second"]):
print "<aside id='sidebar-second' role='complementary' class='sidebar clearfix'>".print render($page['sidebar_second'])."</aside>";
endif;
break;
case "ar":
if ($page["sidebar_second"]):
print "<aside id='sidebar-first' role='complementary' class='sidebar clearfix'>".print render($page['sidebar_second'])."</aside>";
endif;
if ($page["sidebar_first"]):
print "<aside id='sidebar-second' role='complementary' class='sidebar clearfix'>".print render($page['sidebar_first'])."</aside>";
endif;
break;
}