X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fdecos.inc.php;h=5c413163a9ba2a32def95bd854f04fa39df39e72;hb=dd9b361324a289efb9b4c9d67c5324a3d5036d53;hp=a6cfabc6d16b374c4400005d741af58a24fece34;hpb=1285cf5413df654ccac839b9d9a32c4df2cee95a;p=platal.git diff --git a/modules/profile/decos.inc.php b/modules/profile/decos.inc.php index a6cfabc..5c41316 100644 --- a/modules/profile/decos.inc.php +++ b/modules/profile/decos.inc.php @@ -38,7 +38,6 @@ class ProfileSettingDeco implements ProfileSetting } // Fetch not yet validated medals - require_once 'validations.inc.php'; $medals = ProfileValidate::get_typed_requests($page->pid(), 'medal'); foreach ($medals as &$medal) { $value[$medal->mid] = array('grade' => $medal->gid, @@ -53,8 +52,6 @@ class ProfileSettingDeco implements ProfileSetting public function save(ProfilePage &$page, $field, $value) { - require_once 'validations.inc.php'; - $orig =& $page->orig[$field]; // Remove old ones @@ -93,7 +90,7 @@ class ProfileSettingDeco implements ProfileSetting } } -class ProfileSettingDecos extends ProfilePage +class ProfilePageDecos extends ProfilePage { protected $pg_template = 'profile/deco.tpl'; @@ -126,21 +123,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); } }