<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Also remember that "arg(0)" sees the real path, not a URL alias. If "news" is an alias of "node/123" then arg(0) will be "node." If you want to see the alias, then you need to check "$_GET['q']".</span> <br></div><div><font color="#ff007f" size="4" face="bookman old style, new york, times, serif"><i><strong>Nancy</strong></i></font></div>&nbsp;<div><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span
 style="font-weight:bold;">From:</span></b> Pooya &lt;pooya.source@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> development@drupal.org<br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, August 25, 2011 8:00 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [development] active language in template.php<br></font><br><div id="yiv1785566169"><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="yiv1785566169gmail_quote">On Thu, Aug 25, 2011 at 3:50 PM, Todd <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:todd@savagevenus.net" target="_blank" href="mailto:todd@savagevenus.net">todd@savagevenus.net</a>&gt;</span> wrote:<br>
<blockquote class="yiv1785566169gmail_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 rel="nofollow" target="_blank" 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><div class="yiv1785566169h5"><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-&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 rel="nofollow" target="_blank" href="http://twitter.com/sourcesoft">Twitter</a> - <a rel="nofollow" target="_blank" href="http://facebook.com/pooya.sanooei">Facebook</a> -&nbsp;<a rel="nofollow" target="_blank" href="http://www.sanooei.com/">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 rel="nofollow" target="_blank" href="http://twitter.com/sourcesoft">Twitter</a> - <a rel="nofollow" target="_blank" href="http://facebook.com/pooya.sanooei">Facebook</a> -&nbsp;<a rel="nofollow" target="_blank" href="http://www.sanooei.com">Website</a></div>
</div><br>
</div>
</div><br><br></div></div></blockquote></div></div></body></html>