<div dir="ltr"><div>It did work using arg(0)==&#39;news&#39; cause news is a views which list the last story type. I guess views page name is the real path :)<br></div><div><br></div><div class="gmail_quote">On Thu, Aug 25, 2011 at 4:43 PM, Ms. Nancy Wichmann <span dir="ltr">&lt;<a href="mailto:nan_wich@bellsouth.net">nan_wich@bellsouth.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color:#000;background-color:#fff;font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Also remember that &quot;arg(0)&quot; sees the real path, not a URL alias. If &quot;news&quot; is an alias of &quot;node/123&quot; then arg(0) will be &quot;node.&quot; If you want to see the alias, then you need to check &quot;$_GET[&#39;q&#39;]&quot;.</span> <br>
</div><div><font color="#ff007f" size="4" face="bookman old style, new york, times, serif"><i><b>Nancy</b></i></font></div> <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;<a href="mailto:pooya.source@gmail.com" target="_blank">pooya.source@gmail.com</a>&gt;<br><b><span style="font-weight:bold">To:</span></b> <a href="mailto:development@drupal.org" target="_blank">development@drupal.org</a><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><div><div class="h5">
<br><div><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>On Thu, Aug 25, 2011 at 3:50 PM, Todd <span dir="ltr">&lt;<a rel="nofollow" href="mailto:todd@savagevenus.net" target="_blank">todd@savagevenus.net</a>&gt;</span> wrote:<br>

<blockquote 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" 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><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? <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) == &#39;news&#39;){<br>  global $base_url;<br>  if($language-&gt;language==&#39;en&#39;):<br>        $breadcrumb[0] = l(&#39;Home&#39;, $base_url);<br>


        $breadcrumb[1] = l(&#39;News&#39;, &#39;news&#39;);</div><div>  endif;<br>  }<br> 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. </div><div><br></div>-- <br><div dir="ltr">Pooya Sanooei<br><div><a rel="nofollow" href="http://twitter.com/sourcesoft" target="_blank">Twitter</a> - <a rel="nofollow" href="http://facebook.com/pooya.sanooei" target="_blank">Facebook</a> - <a rel="nofollow" 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 rel="nofollow" href="http://twitter.com/sourcesoft" target="_blank">Twitter</a> - <a rel="nofollow" href="http://facebook.com/pooya.sanooei" target="_blank">Facebook</a> - <a rel="nofollow" href="http://www.sanooei.com" target="_blank">Website</a></div>

</div><br>
</div>
</div><br><br></div></div></div></div></blockquote></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>