Esempio n. 1
0
             }
         }
         if ($errors) {
             $errors['err'] = $errors['err'] ?: sprintf(__('Unable to update %s. Correct error(s) below and try again!'), __('custom list items'));
         } else {
             $list->_items = null;
             $msg = sprintf(__('Successfully updated %s'), __('this custom list'));
         }
     } elseif ($errors) {
         $errors['err'] = $errors['err'] ?: sprintf(__('Unable to update %s. Correct error(s) below and try again!'), __('this custom list'));
     } else {
         $errors['err'] = sprintf(__('Unable to update %s.'), __('this custom list')) . ' ' . __('Internal error occurred');
     }
     break;
 case 'add':
     if ($list = DynamicList::add($_POST, $errors)) {
         $msg = sprintf(__('Successfully added %s'), __('this custom list'));
     } elseif ($errors) {
         $errors['err'] = sprintf(__('Unable to add %s. Correct error(s) below and try again.'), __('this custom list'));
     } else {
         $errors['err'] = sprintf(__('Unable to add %s.'), __('this custom list')) . ' ' . __('Internal error occurred');
     }
     break;
 case 'mass_process':
     if (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) {
         $errors['err'] = sprintf(__('You must select at least %s'), __('one custom list'));
     } else {
         $count = count($_POST['ids']);
         switch (strtolower($_POST['a'])) {
             case 'delete':
                 $i = 0;