Convert uses of XDB::(..., $flags->flags()) to XDB::(..., $flags)
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 16 Jun 2008 15:24:19 +0000 (17:24 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 16 Jun 2008 15:25:04 +0000 (17:25 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
include/emails.inc.php
modules/events.php
modules/profile/addresses.inc.php
modules/xnetgrp.php

index e4d62f4..7f4f17d 100644 (file)
@@ -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.
index 33361c0..75ef0b2 100644 (file)
@@ -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 = {?}',
index 2fe7a8d..ec0f031 100644 (file)
@@ -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,
index dd3fe7d..e727443 100644 (file)
@@ -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'])) {