<div dir="ltr"><div>I used global $language;<br></div><div>$user is the one which user select for default language in profile I guess</div><br><div class="gmail_quote">On Thu, Aug 25, 2011 at 3:50 PM, Todd <span dir="ltr"><<a href="mailto:todd@savagevenus.net">todd@savagevenus.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">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" target="_blank">http://api.drupal.org/api/drupal/developer--globals.php/global/user/7</a></div>
<div><br></div><div>Regards,</div><div>Todd</div><div><div class="h5"><div><br><div><div>On 25 Aug 2011, at 06:34, Pooya wrote:</div><br><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->language in page.tpl.php? <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> global $base_url;<br> if($language->language=='en'):<br> $breadcrumb[0] = l('Home', $base_url);<br>
$breadcrumb[1] = l('News', 'news');</div><div> endif;<br> }<br> return theme_breadcrumb($breadcrumb);<br>}</div><div><br></div><div><br></div><div>but dsm($language->language); returns nothing in template.php. If any1 knows another way to achieve this share :)</div>
<div>Thanks in advanced. </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> - <a href="http://www.sanooei.com/" target="_blank">Website</a></div>
</div><br>
</div>
</blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <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> - <a href="http://www.sanooei.com" target="_blank">Website</a></div>
</div><br>
</div>