diff options
author | Sashi20 | 2020-08-10 20:06:50 +0530 |
---|---|---|
committer | GitHub | 2020-08-10 20:06:50 +0530 |
commit | 8fff84c30a9218ba49877babe4c3fc8e3a7b8d47 (patch) | |
tree | c787da0aeefae768b022c7eebede01b1f3d9c9b4 /textbook_companion.module | |
parent | 3f7a749f39f656c46e08fef8c001025183af3ae0 (diff) | |
parent | 9fdf3f392432e51434566feccc8315c0f1b7c6b6 (diff) | |
download | r_textbook_companion-8fff84c30a9218ba49877babe4c3fc8e3a7b8d47.tar.gz r_textbook_companion-8fff84c30a9218ba49877babe4c3fc8e3a7b8d47.tar.bz2 r_textbook_companion-8fff84c30a9218ba49877babe4c3fc8e3a7b8d47.zip |
Merge pull request #40 from Sashi20/drupal_7.x
Modify regenerate pdf function to delete pdf
Diffstat (limited to 'textbook_companion.module')
-rwxr-xr-x | textbook_companion.module | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/textbook_companion.module b/textbook_companion.module index 3fb1f79..2fc97e6 100755 --- a/textbook_companion.module +++ b/textbook_companion.module @@ -3688,7 +3688,12 @@ function del_book_pdf($book_id) { $root_path = textbook_companion_path(); $dir_path = $root_path . "latex/"; - $pdf_filename = "book_" . $book_id . ".pdf"; + $query = db_select('textbook_companion_preference'); + $query->fields('textbook_companion_preference'); + $query->condition('id', $book_id); + $query_pre_data = $query->execute(); + $result = $query_pre_data->fetchObject(); + $pdf_filename = "book_" . $result->directory_name . ".pdf"; if (file_exists($dir_path . $pdf_filename)) unlink($dir_path . $pdf_filename); } |