* @license Unlicense
* @link https://hugofara.github.io/lwt/docs/php/files/print-impr-text.html
* @since 1.5.0
*/
namespace Lwt\Interface\Print_Impr_text;
require_once 'inc/session_utility.php';
require_once 'inc/ajax_edit_impr_text.php';
use function Lwt\Ajax\Improved_Text\edit_term_form;
function edit_mode_display($textid, $ann_exists): void
{
if (!$ann_exists) {
// No annotations, try create them
$ann = create_save_ann($textid);
$ann_exists = strlen($ann) > 0;
}
?>
No annotated text found, and creation seems not possible.';
} else {
// Annotations exist, set up for editing.
?>
>
-1) {
$trans = '';
if (count($vals) > 3) {
$trans = $vals[3];
}
if ($trans == '*') {
$trans = $vals[1] . " "; // <- U+200A HAIR SPACE
}
echo '
' .
tohtml($vals[1]) .
'
';
} else if (count($vals) >= 2) {
echo str_replace(
"¶",
'
',
" " . tohtml($vals[1]) . " "
);
}
}
?>
0;
if ($ann_exists) {
$ann = recreate_save_ann($textid, $ann);
$ann_exists = strlen($ann) > 0;
}
if ($textid == 0) {
header("Location: edit_texts.php");
exit();
}
if ($delmode) {
// Delete
if ($ann_exists) {
runsql(
"UPDATE {$tbpref}texts
SET TxAnnotatedText = NULL
WHERE TxID = $textid",
""
);
}
$ann_exists = (int)get_first_value(
"SELECT LENGTH(TxAnnotatedText) AS value
FROM {$tbpref}texts
WHERE TxID = $textid"
) > 0;
if (!$ann_exists) {
header("Location: print_text.php?text=$textid");
exit();
}
}
$sql = "SELECT TxLgID, TxTitle, TxAudioURI, TxSourceURI
from {$tbpref}texts where TxID = $textid";
$res = do_mysqli_query($sql);
$record = mysqli_fetch_assoc($res);
$title = (string) $record['TxTitle'];
$sourceURI = (string) $record['TxSourceURI'];
$langid = (int) $record['TxLgID'];
if (isset($record['TxAudioURI'])) {
$audio = (string) $record['TxAudioURI'];
} else {
$audio = '';
}
$audio = trim($audio);
mysqli_free_result($res);
saveSetting('currenttext', $textid);
pagestart_nobody('Annotated Text', 'input[type="radio"]{display:inline;}');
?>
ANN.TEXT ▶ " target="_blank">
'
: '') ?>