X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuserset.inc.php;h=8d65239b9c5b3fc7a9fde7aa46f945847e3a4635;hb=28c20b86be8b40cecba0d83080879f81c49e07ad;hp=a403b8aa4412f46a89979371e39ece6c64145e16;hpb=8467def7b77245ec935d6ce64cf6e031595ccaa7;p=platal.git diff --git a/include/userset.inc.php b/include/userset.inc.php index a403b8a..8d65239 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -117,11 +117,12 @@ class SearchSet extends ProfileSet protected function &getFilterResults(PlFilter &$pf, PlLimit $limit) { - return $pf->getProfiles($limit, Profile::FETCH_MINIFICHES); + $profiles = $pf->getProfiles($limit, Profile::FETCH_MINIFICHES); + return $profiles; } } -class ArraySet extends UserSet +class ArraySet extends ProfileSet { public function __construct(array $users) { @@ -152,6 +153,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 +203,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 +228,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 +239,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,6 +248,7 @@ 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), @@ -271,23 +257,6 @@ class TrombiView 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.trombi.tpl';