X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuserset.inc.php;h=23a117ee8c2acc4c2c35d639d4b915f6cfa1c691;hb=87d72675e4a6d5e2ca377cde0f30666f6305ad2b;hp=92e041aa062d6385f94c00b5441e70d46957f04c;hpb=470d14f6148c522e1ee2968cb61140104e7fade0;p=platal.git diff --git a/include/userset.inc.php b/include/userset.inc.php index 92e041a..23a117e 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -152,6 +152,23 @@ abstract class ProfileView extends MultipageView } return null; } + + public function bounds() + { + $order = Env::v('order', $this->defaultkey); + $show_bounds = 0; + if (($order == "name") || ($order == "-name")) { + $this->bound_field = "name"; + $show_bounds = 1; + } elseif (($order == "promo") || ($order == "-promo")) { + $this->bound_field = "promo"; + $show_bounds = -1; + } + if ($order{0} == '-') { + $show_bounds = -$show_bounds; + } + return $show_bounds; + } } class MinificheView extends ProfileView @@ -185,23 +202,6 @@ class MinificheView extends ProfileView parent::__construct($set, $data, $params); } - public function bounds() - { - $order = Env::v('order', $this->defaultkey); - $show_bounds = 0; - if (($order == "name") || ($order == "-name")) { - $this->bound_field = "name"; - $show_bounds = 1; - } elseif (($order == "promo") || ($order == "-promo")) { - $this->bound_field = "promo"; - $show_bounds = -1; - } - if ($order{0} == '-') { - $show_bounds = -$show_bounds; - } - return $show_bounds; - } - public function templateName() { return 'include/plview.minifiche.tpl'; @@ -227,23 +227,6 @@ class MentorView extends ProfileView parent::__construct($set, $data, $params); } - public function bounds() - { - $order = Env::v('order', $this->defaultkey); - $show_bounds = 0; - if (($order == "name") || ($order == "-name")) { - $this->bound_field = "nom"; - $show_bounds = 1; - } elseif (($order == "promo") || ($order == "-promo")) { - $this->bound_field = "promo"; - $show_bounds = -1; - } - if ($order{0} == '-') { - $show_bounds = -$show_bounds; - } - return $show_bounds; - } - public function templateName() { return 'include/plview.referent.tpl'; @@ -255,6 +238,7 @@ class TrombiView extends ProfileView public function __construct(PlSet &$set, $data, array $params) { $this->entriesPerPage = 24; + $this->defaultkey = 'name'; if (@$params['with_score']) { $this->addSort(new PlViewOrder('score', array( new UFO_Score(true), @@ -263,32 +247,15 @@ class TrombiView extends ProfileView new UFO_Name(Profile::DN_SORT), ), 'pertinence')); } + $set->addCond(new UFC_Photo()); $this->addSort(new PlViewOrder('name', array(new UFO_Name(Profile::DN_SORT)), 'nom')); $this->addSort(new PlViewOrder('promo', array( new UFO_Promo(UserFilter::DISPLAY, true), new UFO_Name(Profile::DN_SORT), ), 'promotion')); - $set->addCond(new UFC_Photo()); parent::__construct($set, $data, $params); } - public function bounds() - { - $order = Env::v('order', $this->defaultkey); - $show_bounds = 0; - if (($order == "name") || ($order == "-name")) { - $this->bound_field = "nom"; - $show_bounds = 1; - } elseif (($order == "promo") || ($order == "-promo")) { - $this->bound_field = "promo"; - $show_bounds = -1; - } - if ($order{0} == '-') { - $show_bounds = -$show_bounds; - } - return $show_bounds; - } - public function templateName() { return 'include/plview.trombi.tpl';