From: Andreas Unterkircher Date: Fri, 20 Jun 2008 17:32:17 +0000 (+0200) Subject: issue125, make initial sort-order configureable X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=commitdiff_plain;h=f6b2d6438f1bb0df5fcc9159a38d47628466f80a issue125, make initial sort-order configureable Signed-off-by: Andreas Unterkircher --- diff --git a/CHANGELOG b/CHANGELOG index ca0bb1a..28288cf 100644 --- 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 Sat, 25 May 2008 11:00:00 +0100 + -- Andreas Unterkircher Fri, 20 Jun 2008 19:40:00 +0100 phpfspot (1.5) diff --git a/phpfspot.class.php b/phpfspot.class.php index ae58790..4bc3266 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -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'] = ''; diff --git a/phpfspot_cfg.php.dist b/phpfspot_cfg.php.dist index a04a422..4eec27c 100644 --- a/phpfspot_cfg.php.dist +++ b/phpfspot_cfg.php.dist @@ -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() {