From 77e786e1d93d7017e611c42b6b4541d9ae2fbdbc Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Mon, 16 Jun 2008 17:24:19 +0200 Subject: [PATCH] Convert uses of XDB::(..., $flags->flags()) to XDB::(..., $flags) Signed-off-by: Florent Bruneau --- include/emails.inc.php | 2 +- modules/events.php | 2 +- modules/profile/addresses.inc.php | 13 ++++++------- modules/xnetgrp.php | 7 +++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/emails.inc.php b/include/emails.inc.php index e4d62f4..7f4f17d 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -281,7 +281,7 @@ class EmailStorage extends Email { XDB::execute("UPDATE auth_user_md5 SET mail_storage = {?} - WHERE user_id = {?}", $storages->flags(), $this->uid); + WHERE user_id = {?}", $storages, $this->uid); } // Returns the list of allowed storages for the @p user. diff --git a/modules/events.php b/modules/events.php index 33361c0..75ef0b2 100644 --- a/modules/events.php +++ b/modules/events.php @@ -392,7 +392,7 @@ class EventsModule extends PLModule WHERE id = {?}', Post::v('titre'), Post::v('texte'), Post::v('peremption'), Post::v('promo_min'), Post::v('promo_max'), - $flags->flags(), $eid); + $flags, $eid); if ($upload->exists() && list($x, $y, $type) = $upload->imageInfo()) { XDB::execute('REPLACE INTO evenements_photo SET eid = {?}, attachmime = {?}, x = {?}, y = {?}, attach = {?}', diff --git a/modules/profile/addresses.inc.php b/modules/profile/addresses.inc.php index 2fe7a8d..ec0f031 100644 --- a/modules/profile/addresses.inc.php +++ b/modules/profile/addresses.inc.php @@ -117,23 +117,22 @@ class ProfileAddress extends ProfileGeoloc private function saveAddress($adrid, array &$address) { - $flags = array(); + $flags = new FlagSet(); if ($address['secondaire']) { - $flags[] = 'res-secondaire'; + $flags->addFlag('res-secondaire'); } if ($address['mail']) { - $flags[] = 'courrier'; + $flags->addFlag('courrier'); } if ($address['temporary']) { - $flags[] = 'temporaire'; + $flags->addFlag('temporaire'); } if ($address['current']) { - $flags[] = 'active'; + $flags->addFlag('active'); } if ($address['checked']) { - $flags[] = 'coord-checked'; + $flags->addFlag('coord-checked'); } - $flags = implode(',', $flags); XDB::execute("INSERT INTO adresses (adr1, adr2, adr3, postcode, city, cityid, country, region, regiontxt, diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index dd3fe7d..e727443 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -1186,14 +1186,13 @@ class XnetGrpModule extends PLModule if (Post::v('valid') == 'Enregistrer') { $promo_min = ($art['public'] ? 0 : $art['promo_min']); $promo_max = ($art['public'] ? 0 : $art['promo_max']); - $flags = array(); + $flags = new FlagSet(); if ($art['public']) { - $flags[] = 'public'; + $flags->addFlag('public'); } if ($art['photo']) { - $flags[] = 'photo'; + $flags->addFlag('photo'); } - $flags = implode(',', $flags); if (is_null($aid)) { $fulltext = $art['texte']; if (!empty($art['contact_html'])) { -- 2.1.4