<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I believe you can use the $user variable in template.php.<div><br></div><div>global $user;</div><div>debug($user);</div><div>-or, if using Drupal 6-</div><div>dsm($user);</div><div><br></div><div><a href="http://api.drupal.org/api/drupal/developer--globals.php/global/user/7">http://api.drupal.org/api/drupal/developer--globals.php/global/user/7</a></div><div><br></div><div>Regards,</div><div>Todd</div><div><br><div><div>On 25 Aug 2011, at 06:34, Pooya wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Quick and simple:</div><div>is there a way to get the active language user is viewing site in template.php, sth like $language-&gt;language in page.tpl.php?&nbsp;<br clear="all"></div><div><br></div><div>I want to use it in a condition like this:</div>
<div>function rouzdarou_breadcrumb($breadcrumb) {<br></div><div><br></div><div>if(arg(0) == 'news'){<br>&nbsp; global $base_url;<br>&nbsp; if($language-&gt;language=='en'):<br>&nbsp;     &nbsp; $breadcrumb[0] = l('Home', $base_url);<br>
&nbsp;     &nbsp; $breadcrumb[1] = l('News', 'news');</div><div>&nbsp; endif;<br>  }<br>&nbsp;return theme_breadcrumb($breadcrumb);<br>}</div><div><br></div><div><br></div><div>but dsm($language-&gt;language); returns nothing in template.php. If any1 knows another way to achieve this share :)</div>
<div>Thanks in advanced.&nbsp;</div><div><br></div>-- <br><div dir="ltr">Pooya Sanooei<br><div><a href="http://twitter.com/sourcesoft" target="_blank">Twitter</a> - <a href="http://facebook.com/pooya.sanooei" target="_blank">Facebook</a> -&nbsp;<a href="http://www.sanooei.com/" target="_blank">Website</a></div>
</div><br>
</div>
</blockquote></div><br></div></body></html>