Rename tips to reminder_tips.
[platal.git] / include / userset.inc.php
index 55647df..73ba6c8 100644 (file)
@@ -53,8 +53,6 @@ class SearchSet extends ProfileSet
 
     public function __construct($quick = false, $no_search = false, PlFilterCondition $cond = null)
     {
-        Platal::load('search', 'search.inc.php');
-
         if ($no_search) {
             return;
         }
@@ -93,13 +91,11 @@ class SearchSet extends ProfileSet
         $this->conds->addChild($ufc);
 
         $orders = $ufb->getOrders();
-        $orders[] = new UFO_Promo(UserFilter::DISPLAY, true);
-        $orders[] = new UFO_Name(Profile::DN_SORT);
 
         if (S::logged() && Env::has('nonins')) {
             $this->conds = new PFC_And($this->conds,
                 new PFC_Not(new UFC_Dead()),
-                new UFC_Registered()
+                new PFC_Not(new UFC_Registered())
             );
         }
 
@@ -147,7 +143,26 @@ class ArraySet extends UserSet
     }
 }
 
-class MinificheView extends MultipageView
+abstract class ProfileView extends MultipageView
+{
+    protected function getBoundValue($obj)
+    {
+        if ($obj instanceof Profile) {
+            switch ($this->bound_field) {
+            case 'name':
+                $name = $obj->name('%l');
+                return strtoupper($name);
+            case 'promo':
+                return $obj->promo();
+            default:
+                return null;
+            }
+        }
+        return null;
+    }
+}
+
+class MinificheView extends ProfileView
 {
     public function __construct(PlSet &$set, $data, array $params)
     {
@@ -178,22 +193,6 @@ class MinificheView extends MultipageView
         parent::__construct($set, $data, $params);
     }
 
-    protected function getBoundValue($obj)
-    {
-        if ($obj instanceof Profile) {
-            switch ($this->bound_field) {
-            case 'name':
-                $name = $obj->name('%l');
-                return strtoupper($name[0]);
-            case 'promo':
-                return $obj->promo();
-            default:
-                return null;
-            }
-        }
-        return null;
-    }
-
     public function bounds()
     {
         $order = Env::v('order', $this->defaultkey);
@@ -217,7 +216,7 @@ class MinificheView extends MultipageView
     }
 }
 
-class MentorView extends MultipageView
+class MentorView extends ProfileView
 {
     public function __construct(PlSet &$set, $data, array $params)
     {
@@ -236,22 +235,6 @@ class MentorView extends MultipageView
         parent::__construct($set, $data, $params);
     }
 
-    protected function getBoundValue($obj)
-    {
-        if ($obj instanceof Profile) {
-            switch ($this->bound_field) {
-            case 'name':
-                $name = $obj->name('%l');
-                return strtoupper($name[0]);
-            case 'promo':
-                return $obj->promo();
-            default:
-                return null;
-            }
-        }
-        return null;
-    }
-
     public function bounds()
     {
         $order = Env::v('order', $this->defaultkey);
@@ -275,7 +258,7 @@ class MentorView extends MultipageView
     }
 }
 
-class TrombiView extends MultipageView
+class TrombiView extends ProfileView
 {
     public function __construct(PlSet &$set, $data, array $params)
     {
@@ -296,22 +279,6 @@ class TrombiView extends MultipageView
         parent::__construct($set, $data, $params);
     }
 
-    protected function getBoundValue($obj)
-    {
-        if ($obj instanceof Profile) {
-            switch ($this->bound_field) {
-            case 'name':
-                $name = $obj->name('%l');
-                return strtoupper($name[0]);
-            case 'promo':
-                return $obj->promo();
-            default:
-                return null;
-            }
-        }
-        return null;
-    }
-
     public function bounds()
     {
         $order = Env::v('order', $this->defaultkey);