Xataface
2.0alpha2
Xataface Application Framework
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
actions
invalidate_translations.php
Go to the documentation of this file.
1
<?php
10
class
dataface_actions_invalidate_translations
{
11
12
13
function
handle
(&$params){
14
15
$app
=&
Dataface_Application::getInstance
();
16
if
( !isset($_POST[
'--confirm_invalidate'
]) ){
17
return
PEAR::raiseError
(
"Cannot invalidate translations with a GET request. Please provide the POST parameter '--confirm_invalidate'"
);
18
}
19
20
$record =&
$app
->getRecord();
21
if
( !$record ){
22
return
PEAR::raiseError
(
"Attempt to invalidate translations on null record. No record could be found to match the query parameters."
);
23
}
24
25
import
(
'Dataface/TranslationTool.php'
);
26
$tt =
new
Dataface_TranslationTool
();
27
$res = $tt->markNewCanonicalVersion($record, basename(
$app
->_conf[
'default_language'
]));
28
if
(
PEAR::isError
($res) ){
29
return
$res;
30
}
31
32
$query =&
$app
->getQuery();
33
if
( isset($query[
'--redirect'
]) ){
34
$app
->redirect($query[
'--redirect'
].
'&--msg='
.urlencode(
"Translations successfully invalidated."
));
35
}
else
{
36
$app
->redirect($record->getURL(
'-action=edit'
).
'&--msg='
.urlencode(
'Translations successfully invalidated.'
));
37
}
38
}
39
}
40
41
?>
Generated on Fri Mar 22 2013 09:40:33 for Xataface by
1.8.1.2