- $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;
+ $this->entriesPerPage = 10;
+ $this->addSort(new PlViewOrder('rand', array(new PFO_Random(S::i('uid'))), 'aléatoirement'));
+ $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'));
+ $this->addSort(new PlViewOrder('date_mod', array(
+ new UFO_ProfileUpdate(true),
+ new UFO_Promo(UserFilter::DISPLAY, true),
+ new UFO_Name(Profile::DN_SORT),
+ ), 'dernière modification'));
+ parent::__construct($set, $params);
+ }
+
+ public function templateName()
+ {
+ return 'include/plview.referent.tpl';
+ }
+}
+
+class TrombiView extends ProfileView
+{
+ public function __construct(PlSet &$set, array $params)
+ {
+ $this->entriesPerPage = 24;
+ $this->defaultkey = 'name';
+ if (@$params['with_score']) {
+ $this->addSort(new PlViewOrder('score', array(
+ new UFO_Score(true),
+ new UFO_ProfileUpdate(true),
+ new UFO_Promo(UserFilter::DISPLAY, true),
+ new UFO_Name(Profile::DN_SORT),
+ ), 'pertinence'));