issue125, make initial sort-order configureable
authorAndreas Unterkircher <unki@netshadow.at>
Fri, 20 Jun 2008 17:32:17 +0000 (19:32 +0200)
committerAndreas Unterkircher <unki@netshadow.at>
Fri, 20 Jun 2008 17:41:54 +0000 (19:41 +0200)
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
CHANGELOG
phpfspot.class.php
phpfspot_cfg.php.dist

index ca0bb1a5fe9323609e25f457cd63367b013b5e39..28288cff56cc8919f93d906e94e5fabc059d0e24 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,8 +6,9 @@ phpfspot (1.6)
    F-Spot does.
  * feature, date-input appears now as one field instead of seperates for year, month
    and day.
+ * feature, make sort-order pre-configurable in phpfspot_cfg.php
 
- -- Andreas Unterkircher <unki@netshadow.at>  Sat, 25 May 2008 11:00:00 +0100
+ -- Andreas Unterkircher <unki@netshadow.at>  Fri, 20 Jun 2008 19:40:00 +0100
 
 phpfspot (1.5)
 
index ae5879076de025ef0f45b73406335518a5370fbf..4bc3266d734731a10025f44d9c528d7f0193438e 100644 (file)
@@ -227,8 +227,9 @@ class PHPFSPOT {
       if(!isset($_SESSION['tag_condition']))
          $_SESSION['tag_condition'] = 'or';
 
+      /* if sort-order has not been set yet, get the one specified in the config */
       if(!isset($_SESSION['sort_order']))
-         $_SESSION['sort_order'] = 'date_desc';
+         $_SESSION['sort_order'] = $this->cfg->sort_order;
 
       if(!isset($_SESSION['searchfor_tag']))
          $_SESSION['searchfor_tag'] = '';
index a04a4223c9d35c788ceeb495df4569ed371d3e11..4eec27c1a40a4e5b673999539549b10f76de2ddf 100644 (file)
@@ -122,6 +122,22 @@ class PHPFSPOT_CFG {
    /* user friendly URLs */
    var $user_friendly_url = false;
 
+   /* default sort order - possible values are:
+
+        date_asc  => sort by date ascending (17.1, 18.1, 19.1, ...)
+        date_desc => sort by date descending (19.1, 18.1, 17.1, ...)
+        name_asc  => sort by name ascending (alphabetical)
+        name_desc => sort by name descending (alphabetical)
+        tags_asc  => sort by tag ascending (alphabetical)
+        tags_desc => sort by tag descending (alphabetical)
+        rate_asc  => sort by rate value ascending (1, 2, 3, 4, 5)
+        rate_desc => sort by rate value descending (5, 4, 3, 2, 1)
+
+      Attention: Rate value is available beginning with F-Spot version 0.4.1
+
+   */
+   var $sort_order = "tags_asc";
+
    public function __construct()
    {