]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge branch 'kaffeeringe-patch-1' into dev
authorThomas Citharel <tcit@tcit.fr>
Mon, 19 Jan 2015 22:32:01 +0000 (23:32 +0100)
committerThomas Citharel <tcit@tcit.fr>
Mon, 19 Jan 2015 22:32:01 +0000 (23:32 +0100)
1  2 
inc/poche/Poche.class.php

index 8b0d3a19fad82d1a828772a82d88e591a98689f1,01f919d9eb4eef65c04d18ce33c2e9f74e691bd9..5a0edbe417b5a4f98ff02fd390fe6194d185e5d0
@@@ -199,33 -192,21 +199,34 @@@ class Poch
                  } else {
                    Tools::redirect('?view=home&closewin=true');
                  }
+                 return $last_id;
                  break;
              case 'delete':
 -                $msg = 'delete link #' . $id;
 -                if ($this->store->deleteById($id, $this->user->getId())) {
 -                    if (DOWNLOAD_PICTURES) {
 -                        Picture::removeDirectory(ABS_PATH . $id);
 +                if (isset($_GET['search'])) {
 +                    //when we want to apply a delete to a search
 +                    $tags = array($_GET['search']);
 +                    $allentry_ids = $this->store->search($tags[0], $this->user->getId());
 +                    $entry_ids = array();
 +                    foreach ($allentry_ids as $eachentry) {
 +                        $entry_ids[] = $eachentry[0];
                      }
 -                    $this->messages->add('s', _('the link has been deleted successfully'));
 +                } else { // delete a single article
 +                    $entry_ids = array($id);
                  }
 -                else {
 -                    $this->messages->add('e', _('the link wasn\'t deleted'));
 -                    $msg = 'error : can\'t delete link #' . $id;
 +                foreach($entry_ids as $id) {
 +                    $msg = 'delete link #' . $id;
 +                    if ($this->store->deleteById($id, $this->user->getId())) {
 +                        if (DOWNLOAD_PICTURES) {
 +                            Picture::removeDirectory(ABS_PATH . $id);
 +                        }
 +                        $this->messages->add('s', _('the link has been deleted successfully'));
 +                    }
 +                    else {
 +                        $this->messages->add('e', _('the link wasn\'t deleted'));
 +                        $msg = 'error : can\'t delete link #' . $id;
 +                    }
 +                    Tools::logm($msg);
                  }
 -                Tools::logm($msg);
                  Tools::redirect('?');
                  break;
              case 'toggle_fav' :