X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuserset.inc.php;h=23a117ee8c2acc4c2c35d639d4b915f6cfa1c691;hb=b270577e919c58455a3629a4d9d61bd38ea49e11;hp=73ba6c8faadbcd5b9b7489473f53f2b3c25fc805;hpb=34465ab035104f739a54ec62660f04f874448627;p=platal.git diff --git a/include/userset.inc.php b/include/userset.inc.php index 73ba6c8..23a117e 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -115,21 +115,13 @@ class SearchSet extends ProfileSet $this->conds->addChild($ufb->getUFC()); } - public function &get(PlLimit $limit = null, $orders = array()) + protected function &getFilterResults(PlFilter &$pf, PlLimit $limit) { - $orders = array_merge($orders, $this->orders); - - $uf = $this->buildFilter($this->conds, $orders); - if (is_null($limit)) { - $limit = new PlLimit(20, 0); - } - $it = $uf->getProfiles($limit); - $this->count = $uf->getTotalCount(); - return $it; + return $pf->getProfiles($limit, Profile::FETCH_MINIFICHES); } } -class ArraySet extends UserSet +class ArraySet extends ProfileSet { public function __construct(array $users) { @@ -160,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 @@ -193,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'; @@ -235,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'; @@ -263,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), @@ -271,6 +247,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), @@ -279,23 +256,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';