Fixes vim mode line.
[platal.git] / plugins / modifier.sex.php
index 4686ec2..9be6eff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,9 +23,11 @@ function smarty_modifier_sex($male, $female, $sex = null)
 {
     if (is_null($sex)) {
         $sex = S::user()->isFemale();
+    } else if ($sex instanceof PlUser || $sex instanceof Profile) {
+        $sex = $sex->isFemale();
     }
     return $sex ? $female : $male;
 }
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>