Example #1
0
 function manageEntries()
 {
     // Delete entries in bulk
     if ($_POST['action'] == 'delete' && count($_POST['entry_check']) > 0) {
         if ($this->delete('entry')) {
             $this->showList("Portfolio entries successfully deleted");
             return;
         }
     }
     // If an individual entry is specified, edit it (and/or validate and process it)
     // Otherwise, just show the full list
     if (empty($_GET['entry'])) {
         $this->showList();
     } else {
         $itemID = intval($_GET['entry']);
         if (isset($_POST['submit_check'])) {
             // If the form was submitted...
             $item = new Item($_POST);
             if ($form_errors = $item->validate()) {
                 $this->editIndividual($itemID, $form_errors);
             } else {
                 $item->process();
             }
         } else {
             $this->editIndividual($itemID);
             // If not, just edit the entry
         }
     }
 }