X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnotifs.inc.php;h=3c99ede47071b21b51aff4d18dc995ab43e6aabe;hb=8cc026af3183534646611a4e9c740aa07bab672d;hp=71ef1e980a3375dbd9fd45c7a4ad087601f8b3ae;hpb=cab0809050d58f8484608e91f7555ebd69dcb451;p=platal.git
diff --git a/include/notifs.inc.php b/include/notifs.inc.php
index 71ef1e9..3c99ede 100644
--- a/include/notifs.inc.php
+++ b/include/notifs.inc.php
@@ -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 "1 évènement !"; }
- return "$n évènements !";
+ if ($n == 0) {
+ return;
+ }
+
+ return "$n évènement".($n > 1 ? 's' : '')." !";
}
// }}}
@@ -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;