Skip to content

Commit d27ecdd

Browse files
author
LWT Project
committed
Version 1.5.0 (29-Mar-2013 10:34)
1 parent d149974 commit d27ecdd

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎print_impr_text.php‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,24 @@ function get_first_translation($trans) {
3939

4040
$textid = getreq('text')+0;
4141
$editmode = getreq('edit')+0;
42+
$delmode = getreq('del')+0;
4243
$ann_exists = ((get_first_value("select length(TxAnnotatedText) as value from texts where TxID = " . $textid) + 0) > 0);
4344

4445
if($textid==0) {
4546
header("Location: edit_texts.php");
4647
exit();
4748
}
4849

50+
if ( $delmode ) { // Delete
51+
if ( $ann_exists ) $dummy = runsql('update texts set ' .
52+
'TxAnnotatedText = ' . convert_string_to_sqlsyntax("") . ' where TxID = ' . $textid, "");
53+
$ann_exists = ((get_first_value("select length(TxAnnotatedText) as value from texts where TxID = " . $textid) + 0) > 0);
54+
if ( ! $ann_exists ) {
55+
header("Location: print_text.php?text=" . $textid);
56+
exit();
57+
}
58+
}
59+
4960
$sql = 'select TxLgID, TxTitle from texts where TxID = ' . $textid;
5061
$res = mysql_query($sql);
5162
if ($res == FALSE) die("Invalid Query: $sql");
@@ -81,11 +92,15 @@ function get_first_translation($trans) {
8192
if($editmode) {
8293
echo "<input type=\"button\" value=\"Finish Editing and Display/Print...\" onclick=\"location.href='print_impr_text.php?text=" . $textid . "';\" />";
8394
} else {
84-
echo "<input type=\"button\" value=\"Edit Annotations...\" onclick=\"location.href='print_impr_text.php?edit=1&amp;text=" . $textid . "';\" /> &nbsp; | &nbsp; ";
95+
echo "<input type=\"button\" value=\"Edit\" onclick=\"location.href='print_impr_text.php?edit=1&amp;text=" . $textid . "';\" />";
96+
echo " &nbsp; | &nbsp; ";
97+
echo "<input type=\"button\" value=\"Delete\" onclick=\"location.href='print_impr_text.php?del=1&amp;text=" . $textid . "';\" /> ";
98+
echo " &nbsp; | &nbsp; ";
8599
echo "<input type=\"button\" value=\"Print\" onclick=\"window.print();\" /> (only the text below the line)";
86100
}
87101
echo "</p></div> <!-- noprint -->";
88102

103+
89104
if ( $editmode ) { // Edit Mode
90105

91106
if ( ! $ann_exists ) { // No Ann., Create...

‎print_text.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ function output_text($saveterm,$saverom,$savetrans,$savetags,
148148
echo "</select> the term.<br />";
149149
echo "<input type=\"button\" value=\"Print it!\" onclick=\"window.print();\" /> (only the text below the line)";
150150
if ((get_first_value("select length(TxAnnotatedText) as value from texts where TxID = " . $textid) + 0) > 0) {
151-
echo " &nbsp; | &nbsp; Or <input type=\"button\" value=\"Print/Edit\" onclick=\"location.href='print_impr_text.php?text=" . $textid . "';\" /> your improved Annotation.";
151+
echo " &nbsp; | &nbsp; Or <input type=\"button\" value=\"Print/Edit/Delete\" onclick=\"location.href='print_impr_text.php?text=" . $textid . "';\" /> your <b>improved</b> Annotation.";
152152
} else {
153-
echo " &nbsp; | &nbsp; Or <input type=\"button\" value=\"Create/Print\" onclick=\"location.href='print_impr_text.php?edit=1&amp;text=" . $textid . "';\" /> an improved Annotation.";
153+
echo " &nbsp; | &nbsp; <input type=\"button\" value=\"Create/Print\" onclick=\"location.href='print_impr_text.php?edit=1&amp;text=" . $textid . "';\" /> an <b>improved</b> Annotation.";
154154
}
155155
echo "</p></div> <!-- noprint -->";
156156
echo "<div id=\"print\"" . ($rtlScript ? ' dir="rtl"' : '') . ">";

0 commit comments

Comments
 (0)