From cfcb8b62f30d7710d29d7ec438ad24dbaeda5d7d Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 24 Jul 2010 23:24:41 +0200 Subject: [PATCH] Adds sport medals (also adds an exemple) (Closes #1203). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/profile/decos.inc.php | 25 ++++++++++++++----------- templates/profile/deco.tpl | 2 +- upgrade/1.0.1/03_medals.sql | 29 +++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 upgrade/1.0.1/03_medals.sql diff --git a/modules/profile/decos.inc.php b/modules/profile/decos.inc.php index a6cfabc..fa40cf9 100644 --- a/modules/profile/decos.inc.php +++ b/modules/profile/decos.inc.php @@ -126,21 +126,24 @@ class ProfileSettingDecos extends ProfilePage public function _prepare(PlPage &$page, $id) { - $res = XDB::iterator("SELECT *, FIND_IN_SET('validation', flags) AS validate - FROM profile_medal_enum - ORDER BY type, text"); - $mlist = array(); + $res = XDB::iterator('SELECT *, FIND_IN_SET(\'validation\', flags) AS validate + FROM profile_medal_enum + ORDER BY type, text'); + $mlist = array(); while ($tmp = $res->next()) { $mlist[$tmp['type']][] = $tmp; } $page->assign('medal_list', $mlist); - $trad = Array('ordre' => 'Ordres', - 'croix' => 'Croix', - 'militaire' => 'Médailles militaires', - 'honneur' => 'Médailles d\'honneur', - 'resistance' => 'Médailles de la résistance', - 'prix' => 'Prix'); - $page->assign('trad', $trad); + $fullType = array( + 'ordre' => 'Ordres', + 'croix' => 'Croix', + 'militaire' => 'Médailles militaires', + 'honneur' => 'Médailles d\'honneur', + 'resistance' => 'Médailles de la résistance', + 'prix' => 'Prix', + 'sport' => 'Médailles sportives' + ); + $page->assign('fullType', $fullType); } } diff --git a/templates/profile/deco.tpl b/templates/profile/deco.tpl index b6ef1a0..f284018 100644 --- a/templates/profile/deco.tpl +++ b/templates/profile/deco.tpl @@ -36,7 +36,7 @@