Accept User and Profile object as condition.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 22 Feb 2009 21:35:32 +0000 (22:35 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 10 Apr 2009 17:22:59 +0000 (19:22 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/plset.php
plugins/modifier.sex.php
templates/plview.multipage.tpl

index 88ced82..4b08d99 100644 (file)
@@ -28,7 +28,7 @@ class PlSet
     private $joins   = null;
     private $where   = null;
 
-    private $count   = null;
+    protected $count   = null;
 
     private $mods      = array();
     private $modParams = array();
index 4686ec2..ea8f583 100644 (file)
@@ -23,6 +23,8 @@ 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;
 }
index e1b38cf..d2e1428 100644 (file)
@@ -68,7 +68,6 @@
 {/if}
 {/capture}
 
-
 {$smarty.capture.order|smarty:nodefaults}
 
 {$smarty.capture.pages|smarty:nodefaults}