google maps need a better icon
[platal.git] / include / notifs.inc.php
index 71ef1e9..3c99ede 100644 (file)
@@ -133,7 +133,6 @@ function select_notifs($mail, $uid=null, $last=null, $iterator=true)
 // {{{ function getNbNotifs
 
 function getNbNotifs() {
-    global $globals;
     if (!S::has('uid')) {
         return 0;
     }
@@ -145,10 +144,11 @@ function getNbNotifs() {
     $res = select_notifs(false, $uid, $watchlast, false);
     $n   = $res->numRows();
     $res->free();
-    $url = $globals->baseurl."/carnet/panel";
-    if($n==0) { return; }
-    if($n==1) { return "<a href='$url'>1 évènement !</a>"; }
-    return "<a href='$url'>$n évènements !</a>";
+    if ($n == 0) {
+        return;
+    }
+
+    return "<a href='carnet/panel'>$n évènement".($n > 1 ? 's' : '')." !</a>";
 }
 
 // }}}
@@ -285,7 +285,7 @@ class WatchSub {
     function update($ind) {
         $this->_data = Array();
         XDB::execute('DELETE FROM watch_sub WHERE uid={?}', $this->_uid);
-        foreach(Env::getMixed($ind) as $key=>$val) {
+        foreach (Env::v($ind) as $key=>$val) {
             XDB::query('INSERT INTO watch_sub SELECT {?},id FROM watch_cat WHERE id={?}', $this->_uid, $key);
             if(mysql_affected_rows()) {
                 $this->_data[$key] = $key;