/** * Called statically. Shows all errors that accumulated on the stack * @return unknown_type */ function showAllErrors(&$stack, $print = true) { $msg = PhotoQErrorHandler::showAllErrorsExcept($stack, array(), false); if ($print) { echo $msg; } return $msg; }
<div class="submit"> <input type="submit" class="button-primary submit-btn" name="save_batch" value="<?php _e('Save Changes', 'PhotoQ'); ?> " /> <input type="submit" class="button-secondary submit-btn" onclick="window.location = window.location.href;" value="<?php _e('Cancel', 'PhotoQ'); ?> " /> </div> </div> </form> <?php PhotoQHelper::debug('form over'); break; case 'batchProcessing': check_ajax_referer("photoq-batchProcess"); PhotoQHelper::debug('starting batch with id: ' . $_POST['id']); $photoqBatchResult = $photoq->executeBatch($_POST['id']); PhotoQHelper::debug('executed'); $photoqErrMsg = PhotoQErrorHandler::showAllErrorsExcept($photoqErrStack, array(PHOTOQ_QUEUED_PHOTO_NOT_FOUND), false); echo '{ "percentage": "' . $photoqBatchResult->getPercentage() * 100 . '", "message": "' . $photoqBatchResult->getMessage() . '", "errorMessage": "' . addslashes($photoqErrMsg) . '" }'; break; }