2 import(
'Dataface/TranslationTool.php');
9 $tt->createTranslationSubmissionsTable();
14 if ( !@$_POST[
'--submit']){
16 df_display(array(
'query'=>
$app->getQuery(),
'success'=>@$_REQUEST[
'--success']),
'Dataface_submit_translation.html');
20 if ( @$_POST[
'subject'] ){
22 $app->redirect(
$app->url(
'-action=list'));
25 if ( @$_POST[
'--recordid'] ){
26 $record = df_get_record_by_id($_POST[
'--recordid']);
28 'record_id'=>@$_POST[
'--recordid'],
29 'language'=>@$_POST[
'--language'],
30 'url'=>@$_POST[
'--url'],
31 'original_text'=>@$_POST[
'--original_text'],
32 'translated_text'=>@$_POST[
'--translated_text'],
33 'translated_by'=>@$_POST[
'--translated_by']);
34 $trec =
new Dataface_Record(
'dataface__translation_submissions', array());
35 $trec->setValues($values);
39 The following translation was submitted to the web site {
$app->url(
'')}:
41 Translation
for record {$record->getTitle()} which can be viewed at {$record->getURL(
'-action=view')}.
42 This translation was submitted by {$_POST[
'--translated_by']} after viewing the content at {$_POST[
'--url']}.
44 The original text that was being translated is as follows:
46 {$_POST[
'--original_text']}
48 The translation proposed by
this person is as follows:
50 {$_POST[
'--translated_text']}
52 For more details about
this translation, please visit {$trec->getURL(
'-action=view')}.
56 if ( @
$app->_conf[
'admin_email'] ){
57 mail(
$app->_conf[
'admin_email'],
58 'New translation submitted',
64 if ( @$_POST[
'--redirect'] || @$_POST[
'--url']){
65 $url = @$_POST[
'--redirect'] ? $_POST[
'--redirect'] : $_POST[
'--url'];
66 $app->redirect($url.
'&--msg='.urlencode(
'Thank you for your submission.'));
69 $app->redirect(
$app->url(
'').
'&--success=1&--msg='.urlencode(
'Thank you for your submission.'));
73 throw new Exception(
"No record id was provided", E_USER_ERROR);